From ba6af68c0f3c1b2c3ca929237dfb2d34ee99e997 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 1 Dec 2016 12:35:59 +1100 Subject: [PATCH 001/135] MDEV-9872: Generic CRC32 message using ptr Signed-off-by: Daniel Black --- storage/innobase/include/ut0crc32.h | 4 +--- storage/innobase/srv/srv0start.cc | 9 ++------- storage/innobase/ut/ut0crc32.cc | 18 ++++++++---------- storage/xtradb/include/ut0crc32.h | 3 +-- storage/xtradb/srv/srv0start.cc | 8 +------- storage/xtradb/ut/ut0crc32.cc | 12 ++++++------ 6 files changed, 19 insertions(+), 35 deletions(-) diff --git a/storage/innobase/include/ut0crc32.h b/storage/innobase/include/ut0crc32.h index 91af6a910ff..712f1b92d46 100644 --- a/storage/innobase/include/ut0crc32.h +++ b/storage/innobase/include/ut0crc32.h @@ -54,8 +54,6 @@ extern ut_crc32_func_t ut_crc32_legacy_big_endian; but very slow). */ extern ut_crc32_func_t ut_crc32_byte_by_byte; -/** Flag that tells whether the CPU supports CRC32 or not */ -extern bool ut_crc32_sse2_enabled; -extern bool ut_crc32_power8_enabled; +extern const char *ut_crc32_implementation; #endif /* ut0crc32_h */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4be92906851..69d14ff5d1c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1702,13 +1702,8 @@ innobase_start_or_create_for_mysql(void) srv_boot(); - if (ut_crc32_sse2_enabled) { - ib::info() << "Using SSE crc32 instructions"; - } else if (ut_crc32_power8_enabled) { - ib::info() << "Using POWER8 crc32 instructions"; - } else { - ib::info() << "Using generic crc32 instructions"; - } + ib::info() << ut_crc32_implementation; + if (!srv_read_only_mode) { diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 2d892be869b..379a6c4f6ef 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -96,6 +96,9 @@ ut_crc32_func_t ut_crc32_legacy_big_endian; but very slow). */ ut_crc32_func_t ut_crc32_byte_by_byte; +/** Text description of CRC32 implementation */ +const char *ut_crc32_implementation = NULL; + /** Swap the byte order of an 8 byte integer. @param[in] i 8-byte integer @return 8-byte integer */ @@ -116,10 +119,6 @@ ut_crc32_swap_byteorder( /* CRC32 hardware implementation. */ -/* Flag that tells whether the CPU supports CRC32 or not */ -bool ut_crc32_sse2_enabled = false; -UNIV_INTERN bool ut_crc32_power8_enabled = false; - #ifdef HAVE_CRC32_VPMSUM extern "C" { unsigned int crc32c_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); @@ -284,8 +283,6 @@ ut_crc32_hw( { uint32_t crc = 0xFFFFFFFFU; - ut_a(ut_crc32_sse2_enabled); - /* Calculate byte-by-byte up to an 8-byte aligned address. After this consume the input 8-bytes at a time. */ while (len > 0 && (reinterpret_cast(buf) & 7) != 0) { @@ -375,8 +372,6 @@ ut_crc32_legacy_big_endian_hw( { uint32_t crc = 0xFFFFFFFFU; - ut_a(ut_crc32_sse2_enabled); - /* Calculate byte-by-byte up to an 8-byte aligned address. After this consume the input 8-bytes at a time. */ while (len > 0 && (reinterpret_cast(buf) & 7) != 0) { @@ -427,8 +422,6 @@ ut_crc32_byte_by_byte_hw( { uint32_t crc = 0xFFFFFFFFU; - ut_a(ut_crc32_sse2_enabled); - while (len > 0) { ut_crc32_8_hw(&crc, &buf, &len); } @@ -706,6 +699,8 @@ void ut_crc32_init() /*===========*/ { + bool ut_crc32_sse2_enabled = false; + bool ut_crc32_power8_enabled = false; #if defined(__GNUC__) && defined(__x86_64__) uint32_t vend[3]; uint32_t model; @@ -741,6 +736,7 @@ ut_crc32_init() ut_crc32 = ut_crc32_hw; ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_hw; ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_hw; + ut_crc32_implementation = "Using SSE2 crc32 instructions"; } #endif /* defined(__GNUC__) && defined(__x86_64__) */ @@ -748,6 +744,7 @@ ut_crc32_init() #ifdef HAVE_CRC32_VPMSUM ut_crc32_power8_enabled = true; ut_crc32 = ut_crc32_power8; + ut_crc32_implementation = "Using POWER8 crc32 instructions"; #endif if (!ut_crc32_sse2_enabled && !ut_crc32_power8_enabled) { @@ -755,5 +752,6 @@ ut_crc32_init() ut_crc32 = ut_crc32_sw; ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_sw; ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_sw; + ut_crc32_implementation = "Using generic crc32 instructions"; } } diff --git a/storage/xtradb/include/ut0crc32.h b/storage/xtradb/include/ut0crc32.h index ab1d2db9874..d6dd376d9af 100644 --- a/storage/xtradb/include/ut0crc32.h +++ b/storage/xtradb/include/ut0crc32.h @@ -46,7 +46,6 @@ typedef ib_uint32_t (*ib_ut_crc32_t)(const byte* ptr, ulint len); extern ib_ut_crc32_t ut_crc32; -extern bool ut_crc32_sse2_enabled; -extern bool ut_crc32_power8_enabled; +extern const char *ut_crc32_implementation; #endif /* ut0crc32_h */ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 87ceeaf65c3..e01537e8f73 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -1938,13 +1938,7 @@ innobase_start_or_create_for_mysql(void) srv_boot(); - if (ut_crc32_sse2_enabled) { - ib_logf(IB_LOG_LEVEL_INFO, "Using SSE crc32 instructions"); - } else if (ut_crc32_power8_enabled) { - ib_logf(IB_LOG_LEVEL_INFO, "Using POWER8 crc32 instructions"); - } else { - ib_logf(IB_LOG_LEVEL_INFO, "Using generic crc32 instructions"); - } + ib_logf(IB_LOG_LEVEL_INFO, ut_crc32_implementation); if (!srv_read_only_mode) { diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index 1484d245953..6d4087fcb2c 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -97,9 +97,8 @@ have support for it */ static ib_uint32_t ut_crc32_slice8_table[8][256]; static ibool ut_crc32_slice8_table_initialized = FALSE; -/* Flag that tells whether the CPU supports CRC32 or not */ -UNIV_INTERN bool ut_crc32_sse2_enabled = false; -UNIV_INTERN bool ut_crc32_power8_enabled = false; +/** Text description of CRC32 implementation */ +const char *ut_crc32_implementation = NULL; /********************************************************************//** Initializes the table that is used to generate the CRC32 if the CPU does @@ -213,8 +212,6 @@ ut_crc32_sse42( #if defined(__GNUC__) && defined(__x86_64__) ib_uint64_t crc = (ib_uint32_t) (-1); - ut_a(ut_crc32_sse2_enabled); - while (len && ((ulint) buf & 7)) { ut_crc32_sse42_byte; } @@ -302,6 +299,7 @@ void ut_crc32_init() /*===========*/ { + bool ut_crc32_sse2_enabled = false; #if defined(__GNUC__) && defined(__x86_64__) ib_uint32_t vend[3]; ib_uint32_t model; @@ -336,14 +334,16 @@ ut_crc32_init() #endif /* defined(__GNUC__) && defined(__x86_64__) */ #ifdef HAVE_CRC32_VPMSUM - ut_crc32_power8_enabled = true; ut_crc32 = ut_crc32_power8; + ut_crc32_implementation = "Using POWER8 crc32 instructions"; #else if (ut_crc32_sse2_enabled) { ut_crc32 = ut_crc32_sse42; + ut_crc32_implementation = "Using SSE2 crc32 instructions"; } else { ut_crc32_slice8_table_init(); ut_crc32 = ut_crc32_slice8; + ut_crc32_implementation = "Using generic crc32 instructions"; } #endif } From 6d1256973ab82406853ee114d03ae6bb8a877895 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 1 Dec 2016 13:17:19 +1100 Subject: [PATCH 002/135] MDEV-9872: crc32 initialization (innodb/xtradb) Reorder logic as suggested by Svoj. Signed-off-by: Daniel Black --- storage/innobase/ut/ut0crc32.cc | 27 +++++++++------------------ storage/xtradb/ut/ut0crc32.cc | 27 ++++++++++----------------- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 379a6c4f6ef..6468ade22e9 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -699,9 +699,13 @@ void ut_crc32_init() /*===========*/ { - bool ut_crc32_sse2_enabled = false; - bool ut_crc32_power8_enabled = false; -#if defined(__GNUC__) && defined(__x86_64__) + ut_crc32_slice8_table_init(); + ut_crc32 = ut_crc32_sw; + ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_sw; + ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_sw; + ut_crc32_implementation = "Using generic crc32 instructions"; + +#if defined(__GNUC__) && defined(__x86_64__) && !defined(UNIV_DEBUG_VALGRIND) uint32_t vend[3]; uint32_t model; uint32_t family; @@ -728,30 +732,17 @@ ut_crc32_init() probably kill your program. */ -#ifndef UNIV_DEBUG_VALGRIND - ut_crc32_sse2_enabled = (features_ecx >> 20) & 1; -#endif /* UNIV_DEBUG_VALGRIND */ - if (ut_crc32_sse2_enabled) { + if ((features_ecx >> 20) & 1) { ut_crc32 = ut_crc32_hw; ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_hw; ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_hw; ut_crc32_implementation = "Using SSE2 crc32 instructions"; } -#endif /* defined(__GNUC__) && defined(__x86_64__) */ - -#ifdef HAVE_CRC32_VPMSUM - ut_crc32_power8_enabled = true; +#elif defined(HAVE_CRC32_VPMSUM) ut_crc32 = ut_crc32_power8; ut_crc32_implementation = "Using POWER8 crc32 instructions"; #endif - if (!ut_crc32_sse2_enabled && !ut_crc32_power8_enabled) { - ut_crc32_slice8_table_init(); - ut_crc32 = ut_crc32_sw; - ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_sw; - ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_sw; - ut_crc32_implementation = "Using generic crc32 instructions"; - } } diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index 6d4087fcb2c..53d4295361b 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -299,8 +299,11 @@ void ut_crc32_init() /*===========*/ { - bool ut_crc32_sse2_enabled = false; -#if defined(__GNUC__) && defined(__x86_64__) + ut_crc32_slice8_table_init(); + ut_crc32 = ut_crc32_slice8; + ut_crc32_implementation = "Using generic crc32 instructions"; + +#if defined(__GNUC__) && defined(__x86_64__) && !defined(UNIV_DEBUG_VALGRIND) ib_uint32_t vend[3]; ib_uint32_t model; ib_uint32_t family; @@ -327,23 +330,13 @@ ut_crc32_init() probably kill your program. */ -#ifndef UNIV_DEBUG_VALGRIND - ut_crc32_sse2_enabled = (features_ecx >> 20) & 1; -#endif /* UNIV_DEBUG_VALGRIND */ - -#endif /* defined(__GNUC__) && defined(__x86_64__) */ - -#ifdef HAVE_CRC32_VPMSUM - ut_crc32 = ut_crc32_power8; - ut_crc32_implementation = "Using POWER8 crc32 instructions"; -#else - if (ut_crc32_sse2_enabled) { + if ((features_ecx >> 20) & 1) { ut_crc32 = ut_crc32_sse42; ut_crc32_implementation = "Using SSE2 crc32 instructions"; - } else { - ut_crc32_slice8_table_init(); - ut_crc32 = ut_crc32_slice8; - ut_crc32_implementation = "Using generic crc32 instructions"; } + +#elif defined(HAVE_CRC32_VPMSUM) + ut_crc32 = ut_crc32_power8; + ut_crc32_implementation = "Using POWER8 crc32 instructions"; #endif } From 02c8852373f7951369b626efe5e45ef3931dd604 Mon Sep 17 00:00:00 2001 From: sensssz Date: Thu, 1 Dec 2016 13:50:00 -0500 Subject: [PATCH 003/135] Bug fix: consider lock wait mode first. --- storage/innobase/lock/lock0lock.cc | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 56d17e4fe1f..a0866945282 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1730,9 +1730,9 @@ RecLock::lock_alloc( /*********************************************************************//** Check if lock1 has higher priority than lock2. NULL has lowest priority. -If either is a high priority transaction, the lock has higher priority. If neither of them is wait lock, the first one has higher priority. If only one of them is a wait lock, it has lower priority. +If either is a high priority transaction, the lock has higher priority. Otherwise, the one with an older transaction has higher priority. @returns true if lock1 has higher priority, false otherwise. */ bool @@ -1744,28 +1744,19 @@ has_higher_priority( return false; } else if (lock2 == NULL) { return true; - } - // Ask the upper server layer if any of the two trx should be prefered. - int preference = thd_deadlock_victim_preference(lock1->trx->mysql_thd, lock2->trx->mysql_thd); - if (preference == -1) { - // lock1 is preferred as a victim, so lock2 has higher priority - return false; - } else if (preference == 1) { - // lock2 is preferred as a victim, so lock1 has higher priority - return true; - } - if (trx_is_high_priority(lock1->trx)) { + } + // Granted locks has higher priority. + if (!lock_get_wait(lock1)) { + return true; + } else if (!lock_get_wait(lock2)) { + return false; + } + if (trx_is_high_priority(lock1->trx)) { return true; } if (trx_is_high_priority(lock2->trx)) { return false; } - // No preference. Compre them by wait mode and trx age. - if (!lock_get_wait(lock1)) { - return true; - } else if (!lock_get_wait(lock2)) { - return false; - } return lock1->trx->start_time_micro <= lock2->trx->start_time_micro; } From 410bf82b98cb2b29e7663ea8f2fc2d45cd0579b0 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 5 Dec 2016 08:35:55 +1100 Subject: [PATCH 004/135] MDEV-9872: Valgrind supports CRC32B and CRC32Q since valgrind-3.6.1 We don't need to drop down to unoptimized crc because of valgrind now. Valgrind-3.6.1 was released 16 February 2011. The Power8 ASM instructions seem to be supported in 3.9.0 (31 October 2013). Signed-off-by: Daniel Black --- storage/innobase/ut/ut0crc32.cc | 2 +- storage/xtradb/ut/ut0crc32.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 6468ade22e9..6415d04e89f 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -705,7 +705,7 @@ ut_crc32_init() ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_sw; ut_crc32_implementation = "Using generic crc32 instructions"; -#if defined(__GNUC__) && defined(__x86_64__) && !defined(UNIV_DEBUG_VALGRIND) +#if defined(__GNUC__) && defined(__x86_64__) uint32_t vend[3]; uint32_t model; uint32_t family; diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index 53d4295361b..15ed6bfadee 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -303,7 +303,7 @@ ut_crc32_init() ut_crc32 = ut_crc32_slice8; ut_crc32_implementation = "Using generic crc32 instructions"; -#if defined(__GNUC__) && defined(__x86_64__) && !defined(UNIV_DEBUG_VALGRIND) +#if defined(__GNUC__) && defined(__x86_64__) ib_uint32_t vend[3]; ib_uint32_t model; ib_uint32_t family; From 7f6710e5be30c2128e0a1b71359b044a606572c9 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 8 Dec 2016 11:25:21 +0400 Subject: [PATCH 005/135] MDEV-11489 Assertion `0' failed in json_find_path. When the json was just a scalar value, json_extract tried to parse after the value ended. --- mysql-test/r/func_json.result | 3 +++ mysql-test/t/func_json.test | 1 + sql/item_jsonfunc.cc | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index ac604b9e09c..ae20b8c6849 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -138,6 +138,9 @@ json_extract('[10, 20, [30, 40]]', '$[2][*]') select json_extract('[10, 20, [{"a":3}, 30, 40]]', '$[2][*]'); json_extract('[10, 20, [{"a":3}, 30, 40]]', '$[2][*]') [{"a":3}, 30, 40] +select json_extract('1', '$'); +json_extract('1', '$') +1 select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word'); json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word') {"a":1, "b":{"c":1, "k1":"word"}, "d":[1, 2]} diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 2b4385a43b9..2b0f1cb662e 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -54,6 +54,7 @@ select json_extract('{"key0":true, "key1":"qwe"}', "$.key1"); select json_extract(json_object('foo', 'foobar'),'$'); select json_extract('[10, 20, [30, 40]]', '$[2][*]'); select json_extract('[10, 20, [{"a":3}, 30, 40]]', '$[2][*]'); +select json_extract('1', '$'); select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word'); select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 829a547bb07..9978d86e97d 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -476,9 +476,6 @@ String *Item_func_json_extract::val_str(String *str) v_len= je.s.c_str - value; } - if (json_scan_next(&je) && je.s.error) - goto error; - if (!multiple_values_found) { if (first_value == NULL) @@ -489,7 +486,6 @@ String *Item_func_json_extract::val_str(String *str) */ first_value= (const char *) value; first_len= v_len; - continue; } else { @@ -500,15 +496,20 @@ String *Item_func_json_extract::val_str(String *str) } } - if (str->append(", ", 2) || - str->append((const char *) value, v_len)) + if (multiple_values_found && + (str->append(", ", 2) || + str->append((const char *) value, v_len))) goto error; /* Out of memory. */ - } - if (je.s.error) - goto error; + if (json_scan_next(&je)) + break; + + } } + if (je.s.error) + goto error; + if (first_value == NULL) { /* Nothing was found. */ From 6816c80c308d9586818c1b6abf637c984aad0fc0 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 8 Dec 2016 15:41:09 +0100 Subject: [PATCH 006/135] MDEV-11435 - fix integer divided by zero exception when calculating buffer pool size The reason for the exception is previous overflow in multiplication of two 32bit integers (product was 0 rather than expected 8GB, due to truncation) --- storage/innobase/include/buf0buf.ic | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index a912f3eb127..6d602120e70 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -1451,13 +1451,13 @@ ulint buf_pool_size_align( ulint size) { - const ulint m = srv_buf_pool_instances * srv_buf_pool_chunk_unit; + const ib_uint64_t m = ((ib_uint64_t)srv_buf_pool_instances) * srv_buf_pool_chunk_unit; size = ut_max(size, srv_buf_pool_min_size); if (size % m == 0) { return(size); } else { - return((size / m + 1) * m); + return (ulint)((size / m + 1) * m); } } From 7ca1e2abad42a7436e6b668b4568d6fadc2ca165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Dec 2016 14:34:54 +0200 Subject: [PATCH 007/135] MDEV-11422 rpl.rpl_parallel_optimistic_nobinlog failed in buildbot with "InnoDB: Killing connection failed Deadlock" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit innobase_kill_query(): Remove the bogus warning message (for the valid outcome err==DB_DEADLOCK) that was added in commit fec844aca88e1c6b9c36bb0b811e92d9d023ffb9 Author: Jan Lindström Date: Tue Sep 6 09:43:16 2016 +0300 Merge InnoDB 5.7 from mysql-5.7.14. Also, remove some redundant variables and add a debug assertion for enforcing the proper outcome of lock_trx_handle_wait(). --- storage/innobase/handler/ha_innodb.cc | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index eb817b295af..7b526b7f9b2 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5665,9 +5665,6 @@ innobase_kill_query( /* Cancel a pending lock request if there are any */ bool lock_mutex_taken = false; bool trx_mutex_taken = false; - bool already_have_lock_mutex = false; - bool already_have_trx_mutex = false; - dberr_t err = DB_SUCCESS; if (trx->lock.wait_lock) { WSREP_DEBUG("Killing victim trx %p BF %d trx BF %d trx_id " IB_ID_FMT " ABORT %d thd %p" @@ -5681,38 +5678,30 @@ innobase_kill_query( } if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - ut_ad(!lock_mutex_own()); lock_mutex_enter(); lock_mutex_taken = true; - } else { - already_have_lock_mutex = true; } if (trx->abort_type != TRX_WSREP_ABORT) { - ut_ad(!trx_mutex_own(trx)); trx_mutex_enter(trx); trx_mutex_taken = true; - } else { - already_have_trx_mutex = true; } - err = lock_trx_handle_wait(trx, - (lock_mutex_taken || already_have_lock_mutex), - (trx_mutex_taken || already_have_trx_mutex)); +#ifdef UNIV_DEBUG + dberr_t err = +#endif + lock_trx_handle_wait(trx, true, true); + + ut_ad(err == DB_SUCCESS || err == DB_LOCK_WAIT + || err == DB_DEADLOCK); if (lock_mutex_taken) { - ut_ad(lock_mutex_own()); lock_mutex_exit(); } if (trx_mutex_taken) { - ut_ad(trx_mutex_own(trx)); trx_mutex_exit(trx); } - - if (err != DB_SUCCESS && err != DB_LOCK_WAIT) { - ib::warn() << "Killing connection failed " << ut_strerr(err) << "("< Date: Fri, 9 Dec 2016 14:58:23 +1100 Subject: [PATCH 008/135] MDEV-11075: changing to algorithm innodb from crc32 With innodb compressed pages formerly as crc32 changing to the innodb checksum, optimize for speed by only calcuating the big endian variant of crc32 after checking that the little endian doesn't validate the page. Signed-off-by: Daniel Black --- storage/innobase/page/page0zip.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index d93b80778b5..a73d383ccce 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -5243,13 +5243,15 @@ page_zip_verify_checksum( const uint32_t calculated = page_zip_calc_checksum( data, size, SRV_CHECKSUM_ALGORITHM_CRC32); - const uint32_t calculated1 = page_zip_calc_checksum( - data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true); + uint32_t calculated1; if (stored == calculated - || stored == calculated1 #ifdef UNIV_INNOCHECKSUM || ( encrypted == true && checksum == calculated) +#endif + || stored == (calculated1 = + page_zip_calc_checksum(data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true)) +#ifdef UNIV_INNOCHECKSUM || ( encrypted == true && checksum == calculated1) #endif ) { From 50617c42d42c7a9a4f8dec0163a342d4b3fe21f3 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 9 Dec 2016 15:29:42 +1100 Subject: [PATCH 009/135] MDEV-11075: allow software crc32c on Power8 (for BE) --- storage/innobase/ut/ut0crc32.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 6415d04e89f..cf2a2407707 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -445,7 +445,6 @@ void ut_crc32_slice8_table_init() /*========================*/ { -#ifndef HAVE_CRC32_VPMSUM /* bit-reversed poly 0x1EDC6F41 (from SSE42 crc32 instruction) */ static const uint32_t poly = 0x82f63b78; uint32_t n; @@ -469,7 +468,6 @@ ut_crc32_slice8_table_init() } ut_crc32_slice8_table_initialized = true; -#endif } /** Calculate CRC32 over 8-bit data using a software implementation. From c6017b77e0d2bf2f5b610317b95646e45fa13496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 9 Dec 2016 09:12:32 +0200 Subject: [PATCH 010/135] Address my review comments in the contributed patch. --- storage/innobase/include/ut0crc32.h | 3 ++- storage/innobase/ut/ut0crc32.cc | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/storage/innobase/include/ut0crc32.h b/storage/innobase/include/ut0crc32.h index 712f1b92d46..36b389b5bd2 100644 --- a/storage/innobase/include/ut0crc32.h +++ b/storage/innobase/include/ut0crc32.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -54,6 +55,6 @@ extern ut_crc32_func_t ut_crc32_legacy_big_endian; but very slow). */ extern ut_crc32_func_t ut_crc32_byte_by_byte; -extern const char *ut_crc32_implementation; +extern const char* ut_crc32_implementation; #endif /* ut0crc32_h */ diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index cf2a2407707..386d32f6a60 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -2,6 +2,7 @@ Copyright (c) 2009, 2010 Facebook, Inc. All Rights Reserved. Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -97,7 +98,7 @@ but very slow). */ ut_crc32_func_t ut_crc32_byte_by_byte; /** Text description of CRC32 implementation */ -const char *ut_crc32_implementation = NULL; +const char* ut_crc32_implementation; /** Swap the byte order of an 8 byte integer. @param[in] i 8-byte integer @@ -731,7 +732,7 @@ ut_crc32_init() */ - if ((features_ecx >> 20) & 1) { + if (features_ecx & 1 << 20) { ut_crc32 = ut_crc32_hw; ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_hw; ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_hw; From 04aa31c70bf90d6a89833791547a082d82cb2365 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 9 Dec 2016 12:26:32 +0400 Subject: [PATCH 011/135] MDEV-11469 JSON_SEARCH returns incorrect results. Support for '**' in json path expressions added. --- include/json_lib.h | 21 +++++++--- mysql-test/r/func_json.result | 6 +++ mysql-test/t/func_json.test | 2 + sql/item_jsonfunc.cc | 75 +++++++++++++++++++++++++--------- strings/json_lib.c | 68 ++++++++++++++++++------------ unittest/json_lib/json_lib-t.c | 8 ++-- 6 files changed, 125 insertions(+), 55 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index aabf97ad073..b2ea39cd728 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -69,17 +69,26 @@ int json_read_string_const_chr(json_string_t *js); */ +/* Path step types - actually bitmasks to let '&' or '|' operations. */ enum json_path_step_types { - JSON_PATH_KEY=0, - JSON_PATH_ARRAY=1 + JSON_PATH_KEY_NULL=0, + JSON_PATH_KEY=1, /* Must be equal to JSON_VALUE_OBJECT. */ + JSON_PATH_ARRAY=2, /* Must be equal to JSON_VALUE_ARRAY. */ + JSON_PATH_KEY_OR_ARRAY=3, + JSON_PATH_WILD=4, /* Step like .* or [*] */ + JSON_PATH_DOUBLE_WILD=8, /* Step like **.k or **[1] */ + JSON_PATH_KEY_WILD= 1+4, + JSON_PATH_KEY_DOUBLEWILD= 1+8, + JSON_PATH_ARRAY_WILD= 2+4, + JSON_PATH_ARRAY_DOUBLEWILD= 2+8 }; typedef struct st_json_path_step_t { - enum json_path_step_types type; /* The type of the step - KEY or ARRAY */ - int wild; /* If the step is a wildcard */ + enum json_path_step_types type; /* The type of the step - */ + /* see json_path_step_types */ const uchar *key; /* Pointer to the beginning of the key. */ const uchar *key_end; /* Pointer to the end of the key. */ uint n_item; /* Item number in an array. No meaning for the key step. */ @@ -162,8 +171,8 @@ enum json_states { enum json_value_types { - JSON_VALUE_OBJECT=0, - JSON_VALUE_ARRAY=1, + JSON_VALUE_OBJECT=1, + JSON_VALUE_ARRAY=2, JSON_VALUE_STRING, JSON_VALUE_NUMBER, JSON_VALUE_TRUE, diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index ae20b8c6849..bae7da495b0 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -40,6 +40,9 @@ NULL select json_query('{"key1":123, "key1": [1,2,3]}', '$.key1'); json_query('{"key1":123, "key1": [1,2,3]}', '$.key1') [1,2,3] +select json_query('{"key1":123, "key1": [1,2,3]}', concat('$', repeat('.k', 1000))); +json_query('{"key1":123, "key1": [1,2,3]}', concat('$', repeat('.k', 1000))) +NULL select json_array(); json_array() [] @@ -289,6 +292,9 @@ json_search(@j, 'all', '10', NULL, '$[*]') select json_search(@j, 'all', '10', NULL, '$[*][0].k'); json_search(@j, 'all', '10', NULL, '$[*][0].k') "$[1][0].k" +select json_search(@j, 'all', '10', NULL, '$**.k'); +json_search(@j, 'all', '10', NULL, '$**.k') +"$[1][0].k" create table t1( json_col text ); insert into t1 values ('{ "a": "foobar" }'), diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 2b0f1cb662e..12e1c742a26 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -14,6 +14,7 @@ select json_query('{"key1":{"a":1, "b":[1,2]}}', '$.key2'); select json_query('{"key1":{"a":1, "b":[1,2]}}', '$.key1'); select json_query('{"key1": 1}', '$.key1'); select json_query('{"key1":123, "key1": [1,2,3]}', '$.key1'); +select json_query('{"key1":123, "key1": [1,2,3]}', concat('$', repeat('.k', 1000))); select json_array(); select json_array(1); @@ -120,6 +121,7 @@ select json_search(@j, 'all', 'abc', NULL, '$'); select json_search(@j, 'all', '10', NULL, '$'); select json_search(@j, 'all', '10', NULL, '$[*]'); select json_search(@j, 'all', '10', NULL, '$[*][0].k'); +select json_search(@j, 'all', '10', NULL, '$**.k'); create table t1( json_col text ); insert into t1 values ('{ "a": "foobar" }'), diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 9978d86e97d..adb0912f1fc 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1506,7 +1506,7 @@ String *Item_func_json_insert::val_str(String *str) goto error; lp= c_path->p.last_step+1; - if (lp->type == JSON_PATH_ARRAY) + if (lp->type & JSON_PATH_ARRAY) { uint n_item= 0; @@ -1722,7 +1722,7 @@ String *Item_func_json_remove::val_str(String *str) goto error; lp= c_path->p.last_step+1; - if (lp->type == JSON_PATH_ARRAY) + if (lp->type & JSON_PATH_ARRAY) { if (je.value_type != JSON_VALUE_ARRAY) continue; @@ -1982,7 +1982,7 @@ static int append_json_path(String *str, const json_path_t *p) for (c= p->steps+1; c <= p->last_step; c++) { - if (c->type == JSON_PATH_KEY) + if (c->type & JSON_PATH_KEY) { if (str->append(".", 1) || append_simple(str, c->key, c->key_end-c->key)) @@ -2002,6 +2002,7 @@ static int append_json_path(String *str, const json_path_t *p) } +#ifdef DUMMY static int json_path_compare(const json_path_t *a, const json_path_t *b) { uint i, a_len= a->last_step - a->steps, b_len= b->last_step - b->steps; @@ -2014,17 +2015,17 @@ static int json_path_compare(const json_path_t *a, const json_path_t *b) const json_path_step_t *sa= a->steps + i; const json_path_step_t *sb= b->steps + i; - if (sa->type != sb->type) + if (!((sa->type & sb->type) & JSON_PATH_KEY_OR_ARRAY)) return -1; - if (sa->type == JSON_PATH_ARRAY) + if (sa->type & JSON_PATH_ARRAY) { - if (!sa->wild && sa->n_item != sb->n_item) + if (!(sa->type & JSON_PATH_WILD) && sa->n_item != sb->n_item) return -1; } else /* JSON_PATH_KEY */ { - if (!sa->wild && + if (!(sa->type & JSON_PATH_WILD) && (sa->key_end - sa->key != sb->key_end - sb->key || memcmp(sa->key, sb->key, sa->key_end - sa->key) != 0)) return -1; @@ -2033,6 +2034,49 @@ static int json_path_compare(const json_path_t *a, const json_path_t *b) return b_len > a_len; } +#endif /*DUMMY*/ + + +static int json_path_compare(const json_path_t *a, const json_path_t *b) +{ + const json_path_step_t *sa= a->steps + 1; + const json_path_step_t *sb= b->steps + 1; + + if (a->last_step - sa > b->last_step - sb) + return -2; + + while (sa <= a->last_step) + { + if (sb > b->last_step) + return -2; + + if (!((sa->type & sb->type) & JSON_PATH_KEY_OR_ARRAY)) + goto step_failed; + + if (sa->type & JSON_PATH_ARRAY) + { + if (!(sa->type & JSON_PATH_WILD) && sa->n_item != sb->n_item) + goto step_failed; + } + else /* JSON_PATH_KEY */ + { + if (!(sa->type & JSON_PATH_WILD) && + (sa->key_end - sa->key != sb->key_end - sb->key || + memcmp(sa->key, sb->key, sa->key_end - sa->key) != 0)) + goto step_failed; + } + sb++; + sa++; + continue; + +step_failed: + if (!(sa->type & JSON_PATH_DOUBLE_WILD)) + return -1; + sb++; + } + + return sb <= b->last_step; +} static bool path_ok(const json_path_with_flags *paths_list, int n_paths, @@ -2088,8 +2132,7 @@ String *Item_func_json_search::val_str(String *str) (const uchar *) js->ptr() + js->length()); p.last_step= p.steps; - p.steps[0].wild= 0; - p.steps[0].type= JSON_PATH_ARRAY; + p.steps[0].type= JSON_PATH_ARRAY_WILD; p.steps[0].n_item= 0; do @@ -2133,27 +2176,21 @@ String *Item_func_json_search::val_str(String *str) if (mode_one) goto end; } - if (p.last_step->type == JSON_PATH_ARRAY) + if (p.last_step->type & JSON_PATH_ARRAY) p.last_step->n_item++; } else { p.last_step++; - if (je.value_type == JSON_VALUE_ARRAY) - { - p.last_step->type= JSON_PATH_ARRAY; - p.last_step->n_item= 0; - } - else /*JSON_VALUE_OBJECT*/ - p.last_step->type= JSON_PATH_KEY; + p.last_step->type= (enum json_path_step_types) je.value_type; + p.last_step->n_item= 0; } - break; case JST_OBJ_END: case JST_ARRAY_END: p.last_step--; - if (p.last_step->type == JSON_PATH_ARRAY) + if (p.last_step->type & JSON_PATH_ARRAY) p.last_step->n_item++; break; default: diff --git a/strings/json_lib.c b/strings/json_lib.c index 976fab7e7f6..a9498070195 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1006,6 +1006,8 @@ enum json_path_states { PS_KEY, /* Key. */ PS_KNM, /* Parse key name. */ PS_KWD, /* Key wildcard. */ + PS_AST, /* Asterisk. */ + PS_DWD, /* Double wildcard. */ N_PATH_STATES, /* Below are states that aren't in the transitions table. */ PS_SCT, /* Parse the 'strict' keyword. */ PS_EKY, /* '.' after the keyname so next step is the key. */ @@ -1029,7 +1031,7 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]= /* LAX */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, PS_LAX, JE_SYN, PS_GO, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, -/* PT */ { PS_OK, JE_SYN, JE_SYN, PS_AR, JE_SYN, PS_KEY, JE_SYN, JE_SYN, +/* PT */ { PS_OK, JE_SYN, PS_AST, PS_AR, JE_SYN, PS_KEY, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, /* AR */ { JE_EOS, JE_SYN, PS_AWD, JE_SYN, PS_PT, JE_SYN, PS_Z, @@ -1050,11 +1052,17 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]= /* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, JE_SYN, PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_KNM, JE_SYN, PS_KNM, JE_NOT_JSON_CHR, JE_BAD_CHR}, -/* KNM */ { PS_KOK, PS_KNM, PS_KNM, PS_EAR, PS_KNM, PS_EKY, PS_KNM, +/* KNM */ { PS_KOK, PS_KNM, PS_AST, PS_EAR, PS_KNM, PS_EKY, PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_ESC, PS_KNM, JE_NOT_JSON_CHR, JE_BAD_CHR}, /* KWD */ { PS_OK, JE_SYN, JE_SYN, PS_AR, JE_SYN, PS_EKY, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, + JE_BAD_CHR}, +/* AST */ { JE_SYN, JE_SYN, PS_DWD, JE_SYN, JE_SYN, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, + JE_BAD_CHR}, +/* DWD */ { JE_SYN, JE_SYN, PS_AST, PS_AR, JE_SYN, PS_KEY, JE_SYN, JE_SYN, + JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR} }; @@ -1063,11 +1071,11 @@ int json_path_setup(json_path_t *p, CHARSET_INFO *i_cs, const uchar *str, const uchar *end) { int c_len, t_next, state= PS_GO; + enum json_path_step_types double_wildcard= JSON_PATH_KEY_NULL; json_string_setup(&p->s, i_cs, str, end); - p->steps[0].type= JSON_PATH_ARRAY; - p->steps[0].wild= 1; + p->steps[0].type= JSON_PATH_ARRAY_WILD; p->last_step= p->steps; p->mode_strict= FALSE; @@ -1096,8 +1104,11 @@ int json_path_setup(json_path_t *p, p->mode_strict= TRUE; state= PS_LAX; continue; + case PS_KWD: case PS_AWD: - p->last_step->wild= 1; + if (p->last_step->type & JSON_PATH_DOUBLE_WILD) + return p->s.error= JE_SYN; + p->last_step->type|= JSON_PATH_WILD; continue; case PS_INT: p->last_step->n_item*= 10; @@ -1109,8 +1120,10 @@ int json_path_setup(json_path_t *p, /* Note no 'continue' here. */ case PS_KEY: p->last_step++; - p->last_step->type= JSON_PATH_KEY; - p->last_step->wild= 0; + if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) + return p->s.error= JE_DEPTH; + p->last_step->type= JSON_PATH_KEY | double_wildcard; + double_wildcard= JSON_PATH_KEY_NULL; p->last_step->key= p->s.c_str; continue; case PS_EAR: @@ -1119,13 +1132,12 @@ int json_path_setup(json_path_t *p, /* Note no 'continue' here. */ case PS_AR: p->last_step++; - p->last_step->type= JSON_PATH_ARRAY; - p->last_step->wild= 0; + if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) + return p->s.error= JE_DEPTH; + p->last_step->type= JSON_PATH_ARRAY | double_wildcard; + double_wildcard= JSON_PATH_KEY_NULL; p->last_step->n_item= 0; continue; - case PS_KWD: - p->last_step->wild= 1; - continue; case PS_ESC: if (json_handle_esc(&p->s)) return 1; @@ -1133,11 +1145,14 @@ int json_path_setup(json_path_t *p, case PS_KOK: p->last_step->key_end= p->s.c_str - c_len; state= PS_OK; - break; + break; /* 'break' as the loop supposed to end after that. */ + case PS_DWD: + double_wildcard= JSON_PATH_DOUBLE_WILD; + continue; }; } while (state != PS_OK); - return 0; + return double_wildcard ? (p->s.error= JE_SYN) : 0; } @@ -1196,7 +1211,8 @@ static int handle_match(json_engine_t *je, json_path_t *p, (*p_cur_step)++; array_counters[*p_cur_step - p->steps]= 0; - if ((int) je->value_type != (int) (*p_cur_step)->type) + if ((int) je->value_type != + (int) ((*p_cur_step)->type & JSON_PATH_KEY_OR_ARRAY)) { (*p_cur_step)--; return json_skip_level(je); @@ -1240,8 +1256,8 @@ int json_find_path(json_engine_t *je, switch (je->state) { case JST_KEY: - DBUG_ASSERT(cur_step->type == JSON_PATH_KEY); - if (!cur_step->wild) + DBUG_ASSERT(cur_step->type & JSON_PATH_KEY); + if (!(cur_step->type & JSON_PATH_WILD)) { json_string_set_str(&key_name, cur_step->key, cur_step->key_end); if (!json_key_matches(je, &key_name)) @@ -1256,8 +1272,8 @@ int json_find_path(json_engine_t *je, goto exit; break; case JST_VALUE: - DBUG_ASSERT(cur_step->type == JSON_PATH_ARRAY); - if (cur_step->wild || + DBUG_ASSERT(cur_step->type & JSON_PATH_ARRAY); + if (cur_step->type & JSON_PATH_WILD || cur_step->n_item == array_counters[cur_step - p->steps]) { /* Array item matches. */ @@ -1316,11 +1332,11 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) json_path_step_t *cur_step; if (state->path_depths[p_c] < state->cur_depth /* Path already failed. */ || - (cur_step= state->paths[p_c].steps + state->cur_depth)->type != - JSON_PATH_KEY) + !((cur_step= state->paths[p_c].steps + state->cur_depth)->type & + JSON_PATH_KEY)) continue; - if (!cur_step->wild) + if (!(cur_step->type & JSON_PATH_WILD)) { json_string_t key_name; json_string_setup(&key_name, state->paths[p_c].s.cs, @@ -1354,10 +1370,10 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) { json_path_step_t *cur_step; if (state->path_depths[p_c]< state->cur_depth /* Path already failed. */ || - (cur_step= state->paths[p_c].steps + state->cur_depth)->type != - JSON_PATH_ARRAY) + !((cur_step= state->paths[p_c].steps + state->cur_depth)->type & + JSON_PATH_ARRAY)) continue; - if (cur_step->wild || + if (cur_step->type & JSON_PATH_WILD || cur_step->n_item == state->array_counters[state->cur_depth]) { /* Array item matches. */ @@ -1386,7 +1402,7 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) if (state->path_depths[p_c] < state->cur_depth) /* Path already failed. */ continue; - if (state->paths[p_c].steps[state->cur_depth].type == + if (state->paths[p_c].steps[state->cur_depth].type & (je->state == JST_OBJ_START) ? JSON_PATH_KEY : JSON_PATH_ARRAY) state->path_depths[p_c]++; } diff --git a/unittest/json_lib/json_lib-t.c b/unittest/json_lib/json_lib-t.c index 49c8f7e34c2..11f02b204f8 100644 --- a/unittest/json_lib/json_lib-t.c +++ b/unittest/json_lib/json_lib-t.c @@ -117,11 +117,11 @@ test_path_parsing() if (json_path_setup(&p, ci, s_e(p0))) return; ok(p.last_step - p.steps == 4 && - p.steps[0].type == JSON_PATH_ARRAY && p.steps[0].wild == 1 && - p.steps[1].type == JSON_PATH_KEY && p.steps[1].wild == 0 && + p.steps[0].type == JSON_PATH_ARRAY_WILD && + p.steps[1].type == JSON_PATH_KEY && p.steps[2].type == JSON_PATH_ARRAY && p.steps[2].n_item == 12 && - p.steps[3].type == JSON_PATH_KEY && p.steps[3].wild == 1 && - p.steps[4].type == JSON_PATH_ARRAY && p.steps[4].wild == 1, + p.steps[3].type == JSON_PATH_KEY_WILD && + p.steps[4].type == JSON_PATH_ARRAY_WILD, "path"); } From 63152a52dac85e5511365c9502d1e9900c0976f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 9 Dec 2016 12:00:19 +0200 Subject: [PATCH 012/135] Port the test innodb.innodb_misc1 from MySQL. Adjust some results and error codes. --- mysql-test/suite/innodb/r/innodb_misc1.result | 922 +++++++++++++ .../suite/innodb/t/innodb_misc1-master.opt | 1 + mysql-test/suite/innodb/t/innodb_misc1.test | 1196 +++++++++++++++++ 3 files changed, 2119 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_misc1.result create mode 100644 mysql-test/suite/innodb/t/innodb_misc1-master.opt create mode 100644 mysql-test/suite/innodb/t/innodb_misc1.test diff --git a/mysql-test/suite/innodb/r/innodb_misc1.result b/mysql-test/suite/innodb/r/innodb_misc1.result new file mode 100644 index 00000000000..9529578b6d6 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_misc1.result @@ -0,0 +1,922 @@ +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +create table t1 (v varchar(16384)) engine=innodb; +drop table t1; +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +min(a) +4 +select min(b) from t1 where a='8'; +min(b) +6 +drop table t1; +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +a b +3 1 +2 2 +4 3 +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +a b +3 1 +2 2 +4 3 +drop table t1; +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +insert into t1 (val) values ('1'),('2'); +ERROR 23000: Duplicate entry '1' for key 'val' +select * from t1; +rowid val +3 1 +4 2 +drop table t1; +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +insert into t1 (val) values (1); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +select * from t1; +a val +2 1 +drop table t1; +CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; +INSERT INTO t1 (GRADE) VALUES (151),(252),(343); +SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; +GRADE +252 +SELECT GRADE FROM t1 WHERE GRADE= 151; +GRADE +151 +DROP TABLE t1; +create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; +create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; +insert into t2 values ('aa','cc'); +insert into t1 values ('aa','bb'),('aa','cc'); +delete t1 from t1,t2 where f1=f3 and f4='cc'; +select * from t1; +f1 f2 +drop table t1,t2; +CREATE TABLE t1 ( +id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +TRUNCATE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +2 +DELETE FROM t1; +TRUNCATE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +3 +DROP TABLE t2, t1; +CREATE TABLE t1 +( +id INT PRIMARY KEY +) ENGINE=InnoDB; +CREATE TEMPORARY TABLE t2 +( +id INT NOT NULL PRIMARY KEY, +b INT, +FOREIGN KEY (b) REFERENCES test.t1(id) +) ENGINE=InnoDB; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +DROP TABLE t1; +create table t1 (col1 varchar(2000), index (col1(767))) +character set = latin1 engine = innodb; +create table t2 (col1 char(255), index (col1)) +character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) +character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) +character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) +character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) +character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) +character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) +character set = latin1 engine = innodb; +drop table t1, t2, t3, t4, t5, t6, t7, t8; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +SET GLOBAL innodb_default_row_format=compact; +create table t1 (col1 varchar(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t2 (col1 varbinary(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t3 (col1 text, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t4 (col1 blob, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +SET GLOBAL innodb_default_row_format=dynamic; +create table t1 (col1 varchar(768) primary key) +character set = latin1 engine = innodb; +drop table t1; +create table t2 (col1 varbinary(768) primary key) +character set = latin1 engine = innodb; +drop table t2; +create table t3 (col1 text, primary key(col1(768))) +character set = latin1 engine = innodb; +drop table t3; +create table t4 (col1 blob, primary key(col1(768))) +character set = latin1 engine = innodb; +drop table t4; +SET GLOBAL innodb_default_row_format=default; +SET sql_mode = default; +SET GLOBAL innodb_default_row_format=compact; +create table t1 (col1 varchar(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t2 (col1 varbinary(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t3 (col1 text, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table t4 (col1 blob, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +SET GLOBAL innodb_default_row_format=default; +CREATE TABLE t1 +( +id INT PRIMARY KEY +) ENGINE=InnoDB; +CREATE TABLE t2 +( +v INT, +CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); +DELETE FROM t1 WHERE id = 1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; +INSERT INTO t2 VALUES(3); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t2; +connect a,localhost,root,,; +connect b,localhost,root,,; +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=0; +checksum table t1; +Table Checksum +test.t1 1531596814 +connection b; +insert into t1 values(3); +connection a; +checksum table t1; +Table Checksum +test.t1 1531596814 +connection a; +commit; +checksum table t1; +Table Checksum +test.t1 2050879373 +commit; +drop table t1; +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=1; +checksum table t1; +Table Checksum +test.t1 1531596814 +connection b; +set autocommit=1; +insert into t1 values(3); +connection a; +checksum table t1; +Table Checksum +test.t1 2050879373 +drop table t1; +connection default; +disconnect a; +disconnect b; +set foreign_key_checks=0; +create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; +create table t1(a char(10) primary key, b varchar(20)) engine = innodb; +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") +set foreign_key_checks=1; +drop table t2; +set foreign_key_checks=0; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +set foreign_key_checks=1; +drop table t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; +create table t1(a varchar(10) primary key) engine = innodb; +alter table t1 modify column a int; +Got one of the listed errors +set foreign_key_checks=1; +drop table t2,t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +alter table t1 convert to character set utf8; +set foreign_key_checks=1; +drop table t2,t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; +rename table t3 to t1; +ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed") +set foreign_key_checks=1; +drop table t2,t3; +create table t1(a int primary key) row_format=redundant engine=innodb; +create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; +create table t3(a int primary key) row_format=compact engine=innodb; +create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; +insert into t1 values(1); +insert into t3 values(1); +insert into t2 values(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +insert into t4 values(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +insert into t2 values(1); +insert into t4 values(1); +update t1 set a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +update t2 set a=2; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +update t3 set a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +update t4 set a=2; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +truncate t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) +truncate t3; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`)) +truncate t2; +truncate t4; +truncate t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) +truncate t3; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`)) +drop table t4,t3,t2,t1; +create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; +create table t2 (s1 binary(2),primary key (s1)) engine=innodb; +create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; +create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; +insert into t1 values (0x41),(0x4120),(0x4100); +insert into t2 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' +insert into t2 values (0x41),(0x4120); +insert into t3 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY' +insert into t3 values (0x41),(0x4100); +insert into t4 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' +insert into t4 values (0x41),(0x4100); +select hex(s1) from t1; +hex(s1) +41 +4100 +4120 +select hex(s1) from t2; +hex(s1) +4100 +4120 +select hex(s1) from t3; +hex(s1) +4100 +41 +select hex(s1) from t4; +hex(s1) +4100 +41 +drop table t1,t2,t3,t4; +create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; +create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; +insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); +insert into t2 values(0x42); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +insert into t2 values(0x41); +select hex(s1) from t2; +hex(s1) +4100 +update t1 set s1=0x123456 where a=2; +select hex(s1) from t2; +hex(s1) +4100 +update t1 set s1=0x12 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +update t1 set s1=0x12345678 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +SET sql_mode = default; +update t1 set s1=0x123457 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +update t1 set s1=0x1220 where a=1; +select hex(s1) from t2; +hex(s1) +1220 +update t1 set s1=0x1200 where a=1; +select hex(s1) from t2; +hex(s1) +1200 +update t1 set s1=0x4200 where a=1; +select hex(s1) from t2; +hex(s1) +4200 +delete from t1 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +delete from t1 where a=2; +update t2 set s1=0x4120; +delete from t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +delete from t1 where a!=3; +select a,hex(s1) from t1; +a hex(s1) +3 4120 +select hex(s1) from t2; +hex(s1) +4120 +drop table t2,t1; +create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; +create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; +insert into t1 values(1,0x4100),(2,0x41); +insert into t2 values(0x41); +select hex(s1) from t2; +hex(s1) +41 +update t1 set s1=0x1234 where a=1; +select hex(s1) from t2; +hex(s1) +41 +update t1 set s1=0x12 where a=2; +select hex(s1) from t2; +hex(s1) +12 +delete from t1 where a=1; +delete from t1 where a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +select a,hex(s1) from t1; +a hex(s1) +2 12 +select hex(s1) from t2; +hex(s1) +12 +drop table t2,t1; +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; +ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + KEY `t2_ibfk_0` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2,t1; +CREATE TABLE t1 ( +field1 varchar(8) NOT NULL DEFAULT '', +field2 varchar(8) NOT NULL DEFAULT '', +PRIMARY KEY (field1, field2) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, +FOREIGN KEY (field1) REFERENCES t1 (field1) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('old', 'somevalu'); +INSERT INTO t1 VALUES ('other', 'anyvalue'); +INSERT INTO t2 VALUES ('old'); +INSERT INTO t2 VALUES ('other'); +UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; +ERROR 23000: Foreign key constraint for table 't1', record 'other-somevalu' would lead to a duplicate entry in table 't2', key 'PRIMARY' +DROP TABLE t2; +DROP TABLE t1; +create table t1 ( +c1 bigint not null, +c2 bigint not null, +primary key (c1), +unique key (c2) +) engine=innodb; +create table t2 ( +c1 bigint not null, +primary key (c1) +) engine=innodb; +alter table t1 add constraint c2_fk foreign key (c2) +references t2(c1) on delete cascade; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL, + `c2` bigint(20) NOT NULL, + PRIMARY KEY (`c1`), + UNIQUE KEY `c2` (`c2`), + CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 drop foreign key c2_fk; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL, + `c2` bigint(20) NOT NULL, + PRIMARY KEY (`c1`), + UNIQUE KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1(a date) engine=innodb; +create table t2(a date, key(a)) engine=innodb; +insert into t1 values('2005-10-01'); +insert into t2 values('2005-10-01'); +select * from t1, t2 +where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; +a a +2005-10-01 2005-10-01 +drop table t1, t2; +create table t1 (id int not null, f_id int not null, f int not null, +primary key(f_id, id)) engine=innodb; +create table t2 (id int not null,s_id int not null,s varchar(200), +primary key(id)) engine=innodb; +INSERT INTO t1 VALUES (8, 1, 3); +INSERT INTO t1 VALUES (1, 2, 1); +INSERT INTO t2 VALUES (1, 0, ''); +INSERT INTO t2 VALUES (8, 1, ''); +commit; +DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) +WHERE mm.id IS NULL; +select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) +where mm.id is null lock in share mode; +id f_id f +drop table t1,t2; +connect a,localhost,root,,; +connect b,localhost,root,,; +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); +commit; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t1 set b = 5 where b = 1; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +select * from t1 where a = 7 and b = 3 for update; +a b +7 3 +connection a; +commit; +connection b; +commit; +drop table t1; +connection default; +disconnect a; +disconnect b; +connect a,localhost,root,,; +connect b,localhost,root,,; +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); +commit; +set autocommit = 0; +select * from t1 lock in share mode; +a b +1 1 +2 2 +3 1 +4 2 +5 1 +6 2 +update t1 set b = 5 where b = 1; +connection b; +set autocommit = 0; +select * from t1 where a = 2 and b = 2 for update; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection a; +commit; +connection b; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1; +connect a,localhost,root,,; +connect b,localhost,root,,; +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(d int not null, e int, primary key(d)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +d e +3 1 +8 6 +12 1 +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t1 select * from t2; +update t1 set b = (select e from t2 where a = d); +create table t3(d int not null, e int, primary key(d)) engine=innodb +select * from t2; +commit; +connection a; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1, t2, t3; +connect a,localhost,root,,; +connect b,localhost,root,,; +connect c,localhost,root,,; +connect d,localhost,root,,; +connect e,localhost,root,,; +connect f,localhost,root,,; +connect g,localhost,root,,; +connect h,localhost,root,,; +connect i,localhost,root,,; +connect j,localhost,root,,; +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(a int not null, b int, primary key(a)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +create table t3(d int not null, b int, primary key(d)) engine=innodb; +insert into t3 values (8,6),(12,1),(3,1); +create table t5(a int not null, b int, primary key(a)) engine=innodb; +insert into t5 values (1,2),(5,3),(4,2); +create table t6(d int not null, e int, primary key(d)) engine=innodb; +insert into t6 values (8,6),(12,1),(3,1); +create table t8(a int not null, b int, primary key(a)) engine=innodb; +insert into t8 values (1,2),(5,3),(4,2); +create table t9(d int not null, e int, primary key(d)) engine=innodb; +insert into t9 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +a b +3 1 +8 6 +12 1 +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +insert into t1 select * from t2; +connection c; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +update t3 set b = (select b from t2 where a = d); +connection d; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; +connection e; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t5 (select * from t2 lock in share mode); +connection f; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t6 set e = (select b from t2 where a = d lock in share mode); +connection g; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; +connection h; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t8 (select * from t2 for update); +connection i; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t9 set e = (select b from t2 where a = d for update); +connection j; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; +connection b; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection c; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection d; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection e; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection f; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection g; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection h; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection i; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection j; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection a; +commit; +connection default; +disconnect a; +disconnect b; +disconnect c; +disconnect d; +disconnect e; +disconnect f; +disconnect g; +disconnect h; +disconnect i; +disconnect j; +drop table t1, t2, t3, t5, t6, t8, t9; +CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; +ERROR 42000: Incorrect column name 'DB_ROW_ID' +CREATE TABLE t1 ( +a BIGINT(20) NOT NULL, +PRIMARY KEY (a) +) ENGINE=INNODB DEFAULT CHARSET=UTF8; +CREATE TABLE t2 ( +a BIGINT(20) NOT NULL, +b VARCHAR(128) NOT NULL, +c TEXT NOT NULL, +PRIMARY KEY (a,b), +KEY idx_t2_b_c (b,c(100)), +CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) +ON DELETE CASCADE +) ENGINE=INNODB DEFAULT CHARSET=UTF8; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1, 'bar', 'vbar'); +INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); +INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); +INSERT INTO t2 VALUES (1, 'customer_over', '1'); +SELECT * FROM t2 WHERE b = 'customer_over'; +a b c +1 customer_over 1 +SELECT * FROM t2 WHERE BINARY b = 'customer_over'; +a b c +1 customer_over 1 +SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; +a +1 +/* Bang: Empty result set, above was expected: */ +SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +a +1 +SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +a +1 +drop table t2, t1; +CREATE TABLE t1 ( a int ) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; +CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, +CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) +ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON +DELETE CASCADE ON UPDATE CASCADE; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `f` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `f` (`f`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t1; +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +ALTER TABLE t2 MODIFY a INT NOT NULL; +ERROR HY000: Cannot change column 'a': used in a foreign key constraint 't2_ibfk_1' +DELETE FROM t1; +DROP TABLE t2,t1; +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +a +DDD +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB +AUTO_INCREMENT=42; +INSERT INTO t1 VALUES (0),(347),(0); +SELECT * FROM t1; +id +42 +347 +348 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 +CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 VALUES(42),(347),(348); +ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 +DROP TABLE t1,t2; +SET innodb_strict_mode=ON; +CREATE TABLE t1 ( +c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), +c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), +c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), +c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), +c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), +c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), +c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), +c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) +) ENGINE = InnoDB; +ERROR 42000: Row size too large (> {checked_valid}). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +SET innodb_strict_mode=OFF; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 'test.t1' +CREATE TABLE t1( +id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +id +-10 +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +id +-10 +1 +DROP TABLE t1; +CONNECT c1,localhost,root,,; +CONNECT c2,localhost,root,,; +connection c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +Warnings: +Note 1051 Unknown table 'test.t1' +Note 1051 Unknown table 'test.t2' +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +a +connection c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +connection c1; +SELECT * FROM t1 WHERE a=1; +a +1 +disconnect c1; +disconnect c2; +CONNECT c1,localhost,root,,; +CONNECT c2,localhost,root,,; +connection c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +a +connection c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +connection c1; +SELECT * FROM t1 WHERE a=2; +a +2 +SELECT * FROM t1 WHERE a=2; +a +2 +DROP TABLE t1; +DROP TABLE t2; +disconnect c1; +disconnect c2; +connection default; +create table t1 (i int, j int) engine=innodb; +insert into t1 (i, j) values (1, 1), (2, 2); +update t1 set j = 2; +affected rows: 1 +info: Rows matched: 2 Changed: 1 Warnings: 0 +drop table t1; +set @save_innodb_file_per_table= @@global.innodb_file_per_table; +set @@global.innodb_file_per_table=0; +create table t1 (id int) comment='this is a comment' engine=innodb; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select table_comment, data_free > 0 as data_free_is_set +from information_schema.tables +where table_schema='test' and table_name = 't1'; +table_comment data_free_is_set +this is a comment 1 +drop table t1; +set @@global.innodb_file_per_table= @save_innodb_file_per_table; +connection default; +CREATE TABLE t1 ( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +c2 VARCHAR(128) NOT NULL, +PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; +CREATE TABLE t2 ( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +c2 INT(10) UNSIGNED DEFAULT NULL, +PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +AUTO_INCREMENT +200 +ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +AUTO_INCREMENT +200 +DROP TABLE t2; +DROP TABLE t1; +connection default; +CREATE TABLE t1 (c1 int default NULL, +c2 int default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +TRUNCATE TABLE t1; +affected rows: 0 +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +TRUNCATE TABLE t1; +affected rows: 0 +DROP TABLE t1; +Variable_name Value +Handler_update 0 +Variable_name Value +Handler_delete 0 +Variable_name Value +Handler_update 1 +Variable_name Value +Handler_delete 1 diff --git a/mysql-test/suite/innodb/t/innodb_misc1-master.opt b/mysql-test/suite/innodb/t/innodb_misc1-master.opt new file mode 100644 index 00000000000..4901efb416c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_misc1-master.opt @@ -0,0 +1 @@ +--binlog_cache_size=32768 --innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_misc1.test b/mysql-test/suite/innodb/t/innodb_misc1.test new file mode 100644 index 00000000000..9efec68afd5 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_misc1.test @@ -0,0 +1,1196 @@ +-- source include/have_innodb.inc + +let $MYSQLD_DATADIR= `select @@datadir`; +# Save the original values of some variables in order to be able to +# estimate how much they have changed during the tests. Previously this +# test assumed that e.g. rows_deleted is 0 here and after deleting 23 +# rows it expected that rows_deleted will be 23. Now we do not make +# assumptions about the values of the variables at the beginning, e.g. +# rows_deleted should be 23 + "rows_deleted before the test". This allows +# the test to be run multiple times without restarting the mysqld server. +# See Bug#43309 Test main.innodb can't be run twice +-- disable_query_log + +call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is"); +call mtr.add_suppression("\\[ERROR\\] InnoDB: in ALTER TABLE `test`.`t1`"); +call mtr.add_suppression("\\[ERROR\\] InnoDB: in RENAME TABLE table `test`.`t1`"); +SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency; +-- enable_query_log + +--disable_warnings +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +--enable_warnings + +# InnoDB specific varchar tests +create table t1 (v varchar(16384)) engine=innodb; +drop table t1; + +# +# BUG#11039 Wrong key length in min() +# + +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +select min(b) from t1 where a='8'; +drop table t1; + +# +# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error +# + +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +drop table t1; + +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +--error ER_DUP_ENTRY +insert into t1 (val) values ('1'),('2'); +select * from t1; +drop table t1; + +# +# Test that update does not change internal auto-increment value +# + +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +# We should get the following error because InnoDB does not update the counter +--error ER_DUP_ENTRY +insert into t1 (val) values (1); +select * from t1; +drop table t1; +# +# Bug #10465 +# + +--disable_warnings +CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; +--enable_warnings +INSERT INTO t1 (GRADE) VALUES (151),(252),(343); +SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; +SELECT GRADE FROM t1 WHERE GRADE= 151; +DROP TABLE t1; + +# +# Bug #12340 multitable delete deletes only one record +# +create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; +create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; +insert into t2 values ('aa','cc'); +insert into t1 values ('aa','bb'),('aa','cc'); +delete t1 from t1,t2 where f1=f3 and f4='cc'; +select * from t1; +drop table t1,t2; + +# +# Test that the slow TRUNCATE implementation resets autoincrement columns +# (bug #11946) +# + +CREATE TABLE t1 ( +id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; + +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; + +# continued from above; test that doing a slow TRUNCATE on a table with 0 +# rows resets autoincrement columns +DELETE FROM t1; +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t2, t1; + +# Test that foreign keys in temporary tables are not accepted (bug #12084) +CREATE TABLE t1 +( + id INT PRIMARY KEY +) ENGINE=InnoDB; + +--error ER_CANT_CREATE_TABLE +CREATE TEMPORARY TABLE t2 +( + id INT NOT NULL PRIMARY KEY, + b INT, + FOREIGN KEY (b) REFERENCES test.t1(id) +) ENGINE=InnoDB; +DROP TABLE t1; + +# +# Test that index column max sizes are honored (bug #13315) +# + +# prefix index +create table t1 (col1 varchar(2000), index (col1(767))) + character set = latin1 engine = innodb; + +# normal indexes +create table t2 (col1 char(255), index (col1)) + character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) + character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) + character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) + character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) + character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) + character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) + character set = latin1 engine = innodb; + +# multi-column tests can be found in innodb_16k, innodb_8k & innodb_4k + +drop table t1, t2, t3, t4, t5, t6, t7, t8; + +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; + +SET GLOBAL innodb_default_row_format=compact; +--error ER_INDEX_COLUMN_TOO_LONG +create table t1 (col1 varchar(768) primary key) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t2 (col1 varbinary(768) primary key) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t3 (col1 text, primary key(col1(768))) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t4 (col1 blob, primary key(col1(768))) + character set = latin1 engine = innodb; + +SET GLOBAL innodb_default_row_format=dynamic; +create table t1 (col1 varchar(768) primary key) + character set = latin1 engine = innodb; +drop table t1; +create table t2 (col1 varbinary(768) primary key) + character set = latin1 engine = innodb; +drop table t2; +create table t3 (col1 text, primary key(col1(768))) + character set = latin1 engine = innodb; +drop table t3; +create table t4 (col1 blob, primary key(col1(768))) + character set = latin1 engine = innodb; +drop table t4; +SET GLOBAL innodb_default_row_format=default; + +SET sql_mode = default; + +# these should be refused +SET GLOBAL innodb_default_row_format=compact; +--error ER_INDEX_COLUMN_TOO_LONG +create table t1 (col1 varchar(768) primary key) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t2 (col1 varbinary(768) primary key) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t3 (col1 text, primary key(col1(768))) + character set = latin1 engine = innodb; +--error ER_INDEX_COLUMN_TOO_LONG +create table t4 (col1 blob, primary key(col1(768))) + character set = latin1 engine = innodb; +SET GLOBAL innodb_default_row_format=default; + +# +# Test improved foreign key error messages (bug #3443) +# + +CREATE TABLE t1 +( + id INT PRIMARY KEY +) ENGINE=InnoDB; + +CREATE TABLE t2 +( + v INT, + CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; + +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES(2); + +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); + +--error ER_ROW_IS_REFERENCED_2 +DELETE FROM t1 WHERE id = 1; + +--error ER_ROW_IS_REFERENCED_2 +DROP TABLE t1; + +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; + +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES(3); + +DROP TABLE t2; +# +# Test that checksum table uses a consistent read Bug #12669 +# +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=0; +checksum table t1; +connection b; +insert into t1 values(3); +connection a; +# +# Here checksum should not see insert +# +checksum table t1; +connection a; +commit; +checksum table t1; +commit; +drop table t1; +# +# autocommit = 1 +# +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=1; +checksum table t1; +connection b; +set autocommit=1; +insert into t1 values(3); +connection a; +# +# Here checksum sees insert +# +checksum table t1; +drop table t1; + +connection default; +disconnect a; +disconnect b; + +# tests for bugs #9802 and #13778 + +# test that FKs between invalid types are not accepted + +set foreign_key_checks=0; +create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; +--error ER_CANT_CREATE_TABLE +create table t1(a char(10) primary key, b varchar(20)) engine = innodb; +set foreign_key_checks=1; +drop table t2; + +# test that FKs between different charsets are not accepted in CREATE even +# when f_k_c is 0 + +set foreign_key_checks=0; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +--error ER_CANT_CREATE_TABLE +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; +set foreign_key_checks=1; +drop table t1; + +# test that invalid datatype conversions with ALTER are not allowed + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; +create table t1(a varchar(10) primary key) engine = innodb; +-- error 1025,1025 +alter table t1 modify column a int; +set foreign_key_checks=1; +drop table t2,t1; + +# test that charset conversions with ALTER are allowed when f_k_c is 0 + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +alter table t1 convert to character set utf8; +set foreign_key_checks=1; +drop table t2,t1; + +# test that RENAME does not allow invalid charsets when f_k_c is 0 + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLD_DATADIR ./ master-data/ '' +-- error 1025 +rename table t3 to t1; +set foreign_key_checks=1; +drop table t2,t3; + +# test that foreign key errors are reported correctly (Bug #15550) + +create table t1(a int primary key) row_format=redundant engine=innodb; +create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; +create table t3(a int primary key) row_format=compact engine=innodb; +create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; + +insert into t1 values(1); +insert into t3 values(1); +-- error 1452 +insert into t2 values(2); +-- error 1452 +insert into t4 values(2); +insert into t2 values(1); +insert into t4 values(1); +-- error 1451 +update t1 set a=2; +-- error 1452 +update t2 set a=2; +-- error 1451 +update t3 set a=2; +-- error 1452 +update t4 set a=2; +-- error ER_TRUNCATE_ILLEGAL_FK +truncate t1; +-- error ER_TRUNCATE_ILLEGAL_FK +truncate t3; +truncate t2; +truncate t4; +-- error ER_TRUNCATE_ILLEGAL_FK +truncate t1; +-- error ER_TRUNCATE_ILLEGAL_FK +truncate t3; + +drop table t4,t3,t2,t1; + +# +# Test that we can create a large (>1K) key +# Moved to innodb_16k, innodb_8k, and innodb_4k +# since each page size has its own maximum key length. +# + +# test the padding of BINARY types and collations (Bug #14189) + +create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; +create table t2 (s1 binary(2),primary key (s1)) engine=innodb; +create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; +create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; + +insert into t1 values (0x41),(0x4120),(0x4100); +-- error ER_DUP_ENTRY +insert into t2 values (0x41),(0x4120),(0x4100); +insert into t2 values (0x41),(0x4120); +-- error ER_DUP_ENTRY +insert into t3 values (0x41),(0x4120),(0x4100); +insert into t3 values (0x41),(0x4100); +-- error ER_DUP_ENTRY +insert into t4 values (0x41),(0x4120),(0x4100); +insert into t4 values (0x41),(0x4100); +select hex(s1) from t1; +select hex(s1) from t2; +select hex(s1) from t3; +select hex(s1) from t4; +drop table t1,t2,t3,t4; + +create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; +create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; + +insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); +-- error 1452 +insert into t2 values(0x42); +insert into t2 values(0x41); +select hex(s1) from t2; +update t1 set s1=0x123456 where a=2; +select hex(s1) from t2; +-- error 1451 +update t1 set s1=0x12 where a=1; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +-- error 1451 +update t1 set s1=0x12345678 where a=1; +SET sql_mode = default; +-- error 1451 +update t1 set s1=0x123457 where a=1; +update t1 set s1=0x1220 where a=1; +select hex(s1) from t2; +update t1 set s1=0x1200 where a=1; +select hex(s1) from t2; +update t1 set s1=0x4200 where a=1; +select hex(s1) from t2; +-- error 1451 +delete from t1 where a=1; +delete from t1 where a=2; +update t2 set s1=0x4120; +-- error 1451 +delete from t1; +delete from t1 where a!=3; +select a,hex(s1) from t1; +select hex(s1) from t2; + +drop table t2,t1; + +create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; +create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; + +insert into t1 values(1,0x4100),(2,0x41); +insert into t2 values(0x41); +select hex(s1) from t2; +update t1 set s1=0x1234 where a=1; +select hex(s1) from t2; +update t1 set s1=0x12 where a=2; +select hex(s1) from t2; +delete from t1 where a=1; +-- error 1451 +delete from t1 where a=2; +select a,hex(s1) from t1; +select hex(s1) from t2; + +drop table t2,t1; +# Ensure that _ibfk_0 is not mistreated as a +# generated foreign key identifier. (Bug #16387) + +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; +ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; +SHOW CREATE TABLE t2; +DROP TABLE t2,t1; + +# +# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing +# +## the following cannot be tested after the introduction of metadata locks +## because the create trigger command blocks and waits for connection b to +## commit +## begin disabled_mdl +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#insert into t1(a) values (1),(2),(3); +#commit; +#delimiter |; +## in 5.5+, this needs to be created before the UPDATE due to meta-data locking +#create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end | +#delimiter ;| +#connection b; +#set autocommit = 0; +#update t1 set b = 5 where a = 2; +#connection a; +#set autocommit = 0; +#connection a; +#insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100), +#(11),(21),(31),(41),(51),(61),(71),(81),(91),(101), +#(12),(22),(32),(42),(52),(62),(72),(82),(92),(102), +#(13),(23),(33),(43),(53),(63),(73),(83),(93),(103), +#(14),(24),(34),(44),(54),(64),(74),(84),(94),(104); +#connection b; +#commit; +#connection a; +#commit; +#drop trigger t1t; +#drop table t1; +#disconnect a; +#disconnect b; +## +## Another trigger test +## +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#insert into t1(a) values (1),(2),(3); +#insert into t2(a) values (1),(2),(3); +#insert into t3(a) values (1),(2),(3); +#insert into t4(a) values (1),(2),(3); +#insert into t3(a) values (5),(7),(8); +#insert into t4(a) values (5),(7),(8); +#insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); +# +#delimiter |; +#create trigger t1t before insert on t1 for each row begin +# INSERT INTO t2 SET a = NEW.a; +#end | +# +#create trigger t2t before insert on t2 for each row begin +# DELETE FROM t3 WHERE a = NEW.a; +#end | +# +#create trigger t3t before delete on t3 for each row begin +# UPDATE t4 SET b = b + 1 WHERE a = OLD.a; +#end | +# +#create trigger t4t before update on t4 for each row begin +# UPDATE t5 SET b = b + 1 where a = NEW.a; +#end | +#delimiter ;| +#commit; +#set autocommit = 0; +#update t1 set b = b + 5 where a = 1; +#update t2 set b = b + 5 where a = 1; +#update t3 set b = b + 5 where a = 1; +#update t4 set b = b + 5 where a = 1; +#insert into t5(a) values(20); +#connection b; +#set autocommit = 0; +#insert into t1(a) values(7); +#insert into t2(a) values(8); +#delete from t2 where a = 3; +#update t4 set b = b + 1 where a = 3; +#commit; +#connection a; +#drop trigger t1t; +#drop trigger t2t; +#drop trigger t3t; +#drop trigger t4t; +#drop table t1, t2, t3, t4, t5; +#connection default; +#disconnect a; +#disconnect b; +## end disabled_mdl + +# +# Test that cascading updates leading to duplicate keys give the correct +# error message (bug #9680) +# + +CREATE TABLE t1 ( + field1 varchar(8) NOT NULL DEFAULT '', + field2 varchar(8) NOT NULL DEFAULT '', + PRIMARY KEY (field1, field2) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, + FOREIGN KEY (field1) REFERENCES t1 (field1) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES ('old', 'somevalu'); +INSERT INTO t1 VALUES ('other', 'anyvalue'); + +INSERT INTO t2 VALUES ('old'); +INSERT INTO t2 VALUES ('other'); + +--error ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO +UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; + +DROP TABLE t2; +DROP TABLE t1; + +# +# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE +# +create table t1 ( + c1 bigint not null, + c2 bigint not null, + primary key (c1), + unique key (c2) +) engine=innodb; +# +create table t2 ( + c1 bigint not null, + primary key (c1) +) engine=innodb; +# +alter table t1 add constraint c2_fk foreign key (c2) + references t2(c1) on delete cascade; +show create table t1; +# +alter table t1 drop foreign key c2_fk; +show create table t1; +# +drop table t1, t2; + +# +# Bug #14360: problem with intervals +# + +create table t1(a date) engine=innodb; +create table t2(a date, key(a)) engine=innodb; +insert into t1 values('2005-10-01'); +insert into t2 values('2005-10-01'); +select * from t1, t2 + where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; +drop table t1, t2; + +create table t1 (id int not null, f_id int not null, f int not null, +primary key(f_id, id)) engine=innodb; +create table t2 (id int not null,s_id int not null,s varchar(200), +primary key(id)) engine=innodb; +INSERT INTO t1 VALUES (8, 1, 3); +INSERT INTO t1 VALUES (1, 2, 1); +INSERT INTO t2 VALUES (1, 0, ''); +INSERT INTO t2 VALUES (8, 1, ''); +commit; +DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) +WHERE mm.id IS NULL; +select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) +where mm.id is null lock in share mode; +drop table t1,t2; + +# +# Test case where X-locks on unused rows should be released in a +# update (because READ COMMITTED isolation level) +# + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); +commit; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t1 set b = 5 where b = 1; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +# +# X-lock to record (7,3) should be released in a update +# +select * from t1 where a = 7 and b = 3 for update; +connection a; +commit; +connection b; +commit; +drop table t1; +connection default; +disconnect a; +disconnect b; + +# +# Test case where no locks should be released (because we are not +# using READ COMMITTED isolation level) +# + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); +commit; +set autocommit = 0; +select * from t1 lock in share mode; +update t1 set b = 5 where b = 1; +connection b; +set autocommit = 0; +# +# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update +# +--error ER_LOCK_WAIT_TIMEOUT +select * from t1 where a = 2 and b = 2 for update; +# +# X-lock to record (1,1),(3,1),(5,1) should not be released in a update +# +--error ER_LOCK_WAIT_TIMEOUT +connection a; +commit; +connection b; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1; + +# +# Consistent read should be used in following selects +# +# 1) INSERT INTO ... SELECT +# 2) UPDATE ... = ( SELECT ...) +# 3) CREATE ... SELECT + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(d int not null, e int, primary key(d)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t1 select * from t2; +update t1 set b = (select e from t2 where a = d); +create table t3(d int not null, e int, primary key(d)) engine=innodb +select * from t2; +commit; +connection a; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1, t2, t3; + +# +# Consistent read should not be used if +# +# (a) isolation level is serializable OR +# (b) select ... lock in share mode OR +# (c) select ... for update +# +# in following queries: +# +# 1) INSERT INTO ... SELECT +# 2) UPDATE ... = ( SELECT ...) +# 3) CREATE ... SELECT + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connect (c,localhost,root,,); +connect (d,localhost,root,,); +connect (e,localhost,root,,); +connect (f,localhost,root,,); +connect (g,localhost,root,,); +connect (h,localhost,root,,); +connect (i,localhost,root,,); +connect (j,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(a int not null, b int, primary key(a)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +create table t3(d int not null, b int, primary key(d)) engine=innodb; +insert into t3 values (8,6),(12,1),(3,1); +create table t5(a int not null, b int, primary key(a)) engine=innodb; +insert into t5 values (1,2),(5,3),(4,2); +create table t6(d int not null, e int, primary key(d)) engine=innodb; +insert into t6 values (8,6),(12,1),(3,1); +create table t8(a int not null, b int, primary key(a)) engine=innodb; +insert into t8 values (1,2),(5,3),(4,2); +create table t9(d int not null, e int, primary key(d)) engine=innodb; +insert into t9 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +insert into t1 select * from t2; +connection c; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +update t3 set b = (select b from t2 where a = d); +connection d; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; +connection e; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +insert into t5 (select * from t2 lock in share mode); +connection f; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +update t6 set e = (select b from t2 where a = d lock in share mode); +connection g; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; +connection h; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +insert into t8 (select * from t2 for update); +connection i; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +update t9 set e = (select b from t2 where a = d for update); +connection j; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; + +connection b; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection c; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection d; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection e; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection f; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection g; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection h; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection i; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection j; +--error ER_LOCK_WAIT_TIMEOUT +reap; + +connection a; +commit; + +connection default; +disconnect a; +disconnect b; +disconnect c; +disconnect d; +disconnect e; +disconnect f; +disconnect g; +disconnect h; +disconnect i; +disconnect j; +drop table t1, t2, t3, t5, t6, t8, t9; + +# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID" +--error ER_WRONG_COLUMN_NAME +CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; + +# +# Bug #17152: Wrong result with BINARY comparison on aliased column +# + +CREATE TABLE t1 ( + a BIGINT(20) NOT NULL, + PRIMARY KEY (a) + ) ENGINE=INNODB DEFAULT CHARSET=UTF8; + +CREATE TABLE t2 ( + a BIGINT(20) NOT NULL, + b VARCHAR(128) NOT NULL, + c TEXT NOT NULL, + PRIMARY KEY (a,b), + KEY idx_t2_b_c (b,c(100)), + CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) + ON DELETE CASCADE + ) ENGINE=INNODB DEFAULT CHARSET=UTF8; + +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1, 'bar', 'vbar'); +INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); +INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); +INSERT INTO t2 VALUES (1, 'customer_over', '1'); + +SELECT * FROM t2 WHERE b = 'customer_over'; +SELECT * FROM t2 WHERE BINARY b = 'customer_over'; +SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; +/* Bang: Empty result set, above was expected: */ +SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; + +drop table t2, t1; + +# +# Test optimize on table with open transaction +# + +CREATE TABLE t1 ( a int ) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +DROP TABLE t1; + +# +# Bug #24741 (existing cascade clauses disappear when adding foreign keys) +# + +CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; + +CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, + CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) + ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; + +ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON +DELETE CASCADE ON UPDATE CASCADE; + +SHOW CREATE TABLE t2; +DROP TABLE t2, t1; + +# +# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns +# for which there is a foreign key constraint ON ... SET NULL. +# + +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on. +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY a INT NOT NULL; +DELETE FROM t1; +DROP TABLE t2,t1; + +# +# Bug #26835: table corruption after delete+insert +# + +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables) +# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?)) +# + +CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB +AUTO_INCREMENT=42; + +INSERT INTO t1 VALUES (0),(347),(0); +SELECT * FROM t1; + +SHOW CREATE TABLE t1; + +CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 VALUES(42),(347),(348); +ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); +SHOW CREATE TABLE t1; + +DROP TABLE t1,t2; + +# +# Bug #21101 (Prints wrong error message if max row size is too large) +# +SET innodb_strict_mode=ON; +--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid} +--error ER_TOO_BIG_ROWSIZE +CREATE TABLE t1 ( + c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), + c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), + c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), + c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), + c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), + c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), + c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), + c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) + ) ENGINE = InnoDB; +SET innodb_strict_mode=OFF; + +# +# Bug #31860 InnoDB assumes AUTOINC values can only be positive. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1( + id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY + ) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +# +# NOTE: The server really needs to be restarted at this point +# for the test to be useful. +# +# Without the fix InnoDB would trip over an assertion here. +INSERT INTO t1 VALUES(NULL); +# The next value should be 1 and not -9 or a -ve number +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #21409 Incorrect result returned when in READ-COMMITTED with +# query_cache ON +# +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +CONNECTION c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +CONNECTION c1; +SELECT * FROM t1 WHERE a=1; +DISCONNECT c1; +DISCONNECT c2; +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +CONNECTION c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +CONNECTION c1; +# The result set below should be the same for both selects +SELECT * FROM t1 WHERE a=2; +SELECT * FROM t1 WHERE a=2; +DROP TABLE t1; +DROP TABLE t2; +DISCONNECT c1; +DISCONNECT c2; +CONNECTION default; + +# +# Bug #29157 UPDATE, changed rows incorrect +# +create table t1 (i int, j int) engine=innodb; +insert into t1 (i, j) values (1, 1), (2, 2); +--enable_info +update t1 set j = 2; +--disable_info +drop table t1; + +# +# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or +# I_S +# +set @save_innodb_file_per_table= @@global.innodb_file_per_table; +set @@global.innodb_file_per_table=0; +create table t1 (id int) comment='this is a comment' engine=innodb; +ANALYZE TABLE t1; +select table_comment, data_free > 0 as data_free_is_set + from information_schema.tables + where table_schema='test' and table_name = 't1'; +drop table t1; +set @@global.innodb_file_per_table= @save_innodb_file_per_table; + +# +# Bug 34920 test +# +CONNECTION default; +CREATE TABLE t1 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 VARCHAR(128) NOT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; + +CREATE TABLE t2 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 INT(10) UNSIGNED DEFAULT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; + +ANALYZE TABLE t2; +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +DROP TABLE t2; +DROP TABLE t1; +# End 34920 test +# +# Bug #29507 TRUNCATE shows to many rows effected +# +CONNECTION default; +CREATE TABLE t1 (c1 int default NULL, + c2 int default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +--enable_info +TRUNCATE TABLE t1; + +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +TRUNCATE TABLE t1; + +--disable_info +DROP TABLE t1; +# +# Bug#35537 Innodb doesn't increment handler_update and handler_delete. +# +-- disable_query_log +-- disable_result_log + +CONNECT (c1,localhost,root,,); + +DROP TABLE IF EXISTS bug35537; +CREATE TABLE bug35537 ( + c1 int +) ENGINE=InnoDB; + +INSERT INTO bug35537 VALUES (1); + +-- enable_result_log + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +UPDATE bug35537 SET c1 = 2 WHERE c1 = 1; +DELETE FROM bug35537 WHERE c1 = 2; + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +DROP TABLE bug35537; + +DISCONNECT c1; +CONNECTION default; + +SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig; From b0266b6a606479f183315248e10eb1624200c06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 9 Dec 2016 12:03:24 +0200 Subject: [PATCH 013/135] Use mtr_memo_contains_flagged() instead of mtr_memo_contains(). This was originally part of MDEV-11487. --- storage/innobase/btr/btr0pcur.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index a5da1b9fb0c..540bb0aa1f4 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -127,12 +127,14 @@ btr_pcur_store_position( ut_ad((mtr_memo_contains_flagged( mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX) - || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)) + || mtr_memo_contains_flagged(mtr, block, + MTR_MEMO_PAGE_S_FIX + | MTR_MEMO_PAGE_X_FIX)) && (block->page.buf_fix_count > 0)); } else { - ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX) - || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX) + ut_ad(mtr_memo_contains_flagged(mtr, block, + MTR_MEMO_PAGE_S_FIX + | MTR_MEMO_PAGE_X_FIX) || dict_table_is_intrinsic(index->table)); } #endif /* UNIV_DEBUG */ From c868acdf656213cdc081c4c965a1bcf3d22558bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 5 Dec 2016 21:04:30 +0200 Subject: [PATCH 014/135] MDEV-11487 Revert InnoDB internal temporary tables from WL#7682 WL#7682 in MySQL 5.7 introduced the possibility to create light-weight temporary tables in InnoDB. These are called 'intrinsic temporary tables' in InnoDB, and in MySQL 5.7, they can be created by the optimizer for sorting or buffering data in query processing. In MariaDB 10.2, the optimizer temporary tables cannot be created in InnoDB, so we should remove the dead code and related data structures. --- storage/innobase/btr/btr0btr.cc | 64 +- storage/innobase/btr/btr0cur.cc | 448 ++------------ storage/innobase/btr/btr0pcur.cc | 54 +- storage/innobase/btr/btr0sea.cc | 34 +- storage/innobase/buf/buf0buf.cc | 40 +- storage/innobase/dict/dict0crea.cc | 44 +- storage/innobase/dict/dict0dict.cc | 89 +-- storage/innobase/dict/dict0load.cc | 2 +- storage/innobase/dict/dict0mem.cc | 2 - storage/innobase/fil/fil0fil.cc | 3 +- storage/innobase/fts/fts0fts.cc | 6 +- storage/innobase/gis/gis0sea.cc | 2 - storage/innobase/handler/ha_innodb.cc | 597 ++----------------- storage/innobase/handler/ha_innodb.h | 14 - storage/innobase/include/btr0cur.h | 60 -- storage/innobase/include/btr0pcur.ic | 44 +- storage/innobase/include/buf0buf.h | 12 +- storage/innobase/include/buf0buf.ic | 4 +- storage/innobase/include/data0type.h | 9 +- storage/innobase/include/dict0dict.h | 65 --- storage/innobase/include/dict0dict.ic | 90 +-- storage/innobase/include/dict0mem.h | 137 +---- storage/innobase/include/dict0mem.ic | 29 +- storage/innobase/include/dict0stats.ic | 2 +- storage/innobase/include/mtr0mtr.h | 14 +- storage/innobase/include/mtr0mtr.ic | 7 - storage/innobase/include/page0cur.h | 17 - storage/innobase/include/page0cur.ic | 29 - storage/innobase/include/row0mysql.h | 22 +- storage/innobase/include/row0sel.h | 38 +- storage/innobase/include/row0sel.ic | 9 +- storage/innobase/include/sync0types.h | 27 +- storage/innobase/mtr/mtr0mtr.cc | 10 - storage/innobase/page/page0cur.cc | 326 +---------- storage/innobase/page/page0zip.cc | 6 +- storage/innobase/row/row0ins.cc | 300 ++-------- storage/innobase/row/row0mysql.cc | 778 ++----------------------- storage/innobase/row/row0sel.cc | 317 +--------- storage/innobase/row/row0upd.cc | 41 +- storage/innobase/srv/srv0srv.cc | 7 +- storage/innobase/srv/srv0start.cc | 88 +-- 41 files changed, 410 insertions(+), 3477 deletions(-) diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 255788229e4..e5284ee802a 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -242,8 +242,7 @@ btr_height_get( || mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_S_LOCK | MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_SX_LOCK)); /* S latches the page */ root_block = btr_root_block_get(index, RW_S_LATCH, mtr); @@ -560,8 +559,7 @@ btr_get_size( ut_ad(srv_read_only_mode || mtr_memo_contains(mtr, dict_index_get_lock(index), - MTR_MEMO_S_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_S_LOCK)); if (index->page == FIL_NULL || dict_index_is_online_ddl(index) @@ -917,8 +915,7 @@ btr_page_get_father_node_ptr_func( ut_ad(srv_read_only_mode || mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_SX_LOCK)); ut_ad(dict_index_get_page(index) != page_no); @@ -929,17 +926,11 @@ btr_page_get_father_node_ptr_func( tuple = dict_index_build_node_ptr(index, user_rec, 0, heap, level); dberr_t err = DB_SUCCESS; - - if (dict_table_is_intrinsic(index->table)) { - err = btr_cur_search_to_nth_level_with_no_latch( - index, level + 1, tuple, PAGE_CUR_LE, cursor, - file, line, mtr); - } else { - err = btr_cur_search_to_nth_level( - index, level + 1, tuple, - PAGE_CUR_LE, latch_mode, cursor, 0, - file, line, mtr); - } + + err = btr_cur_search_to_nth_level( + index, level + 1, tuple, + PAGE_CUR_LE, latch_mode, cursor, 0, + file, line, mtr); if (err != DB_SUCCESS) { ib::warn() << " Error code: " << err @@ -1560,7 +1551,6 @@ btr_page_reorganize_low( } #ifndef UNIV_HOTBACKUP - /* No locks are acquried for intrinsic tables. */ if (!recovery && !dict_table_is_locking_disabled(index->table)) { /* Update the record lock bitmaps */ lock_move_reorganize_page(block, temp_block); @@ -1824,8 +1814,7 @@ btr_root_raise_and_insert( #endif /* UNIV_BTR_DEBUG */ ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix( mtr, root_block, MTR_MEMO_PAGE_X_FIX, index->table)); @@ -2311,17 +2300,10 @@ btr_insert_on_non_leaf_level_func( ut_ad(level > 0); if (!dict_index_is_spatial(index)) { - dberr_t err = DB_SUCCESS; - if (dict_table_is_intrinsic(index->table)) { - err = btr_cur_search_to_nth_level_with_no_latch( - index, level, tuple, PAGE_CUR_LE, &cursor, - __FILE__, __LINE__, mtr); - } else { - err = btr_cur_search_to_nth_level( - index, level, tuple, PAGE_CUR_LE, - BTR_CONT_MODIFY_TREE, - &cursor, 0, file, line, mtr); - } + dberr_t err = btr_cur_search_to_nth_level( + index, level, tuple, PAGE_CUR_LE, + BTR_CONT_MODIFY_TREE, + &cursor, 0, file, line, mtr); if (err != DB_SUCCESS) { ib::warn() << " Error code: " << err @@ -2593,10 +2575,9 @@ btr_insert_into_right_sibling( page_t* page = buf_block_get_frame(block); ulint next_page_no = btr_page_get_next(page, mtr); - ut_ad(dict_table_is_intrinsic(cursor->index->table) - || mtr_memo_contains_flagged( - mtr, dict_index_get_lock(cursor->index), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); + ut_ad(mtr_memo_contains_flagged( + mtr, dict_index_get_lock(cursor->index), + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix( mtr, block, MTR_MEMO_PAGE_X_FIX, cursor->index->table)); ut_ad(heap); @@ -2769,14 +2750,12 @@ func_start: ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(cursor->index), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(cursor->index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(!dict_index_is_online_ddl(cursor->index) || (flags & BTR_CREATE_FLAG) || dict_index_is_clust(cursor->index)); ut_ad(rw_lock_own_flagged(dict_index_get_lock(cursor->index), - RW_LOCK_FLAG_X | RW_LOCK_FLAG_SX) - || dict_table_is_intrinsic(cursor->index->table)); + RW_LOCK_FLAG_X | RW_LOCK_FLAG_SX)); block = btr_cur_get_block(cursor); page = buf_block_get_frame(block); @@ -2930,7 +2909,6 @@ insert_empty: } if (!srv_read_only_mode - && !dict_table_is_intrinsic(cursor->index->table) && insert_will_fit && page_is_leaf(page) && !dict_index_is_online_ddl(cursor->index)) { @@ -3559,8 +3537,7 @@ btr_compress( } else { ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_SX_LOCK)); } #endif /* UNIV_DEBUG */ @@ -4152,8 +4129,7 @@ btr_discard_page( ut_ad(dict_index_get_page(index) != block->page.id.page_no()); ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 7daec068f78..0d72b9d2b92 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -280,10 +280,10 @@ btr_cur_latch_leaves( case BTR_MODIFY_TREE: /* It is exclusive for other operations which calls btr_page_set_prev() */ - ut_ad(mtr_memo_contains_flagged(mtr, - dict_index_get_lock(cursor->index), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(cursor->index->table)); + ut_ad(mtr_memo_contains_flagged( + mtr, + dict_index_get_lock(cursor->index), + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); /* x-latch also siblings from left to right */ left_page_no = btr_page_get_prev(page, mtr); mode = latch_mode; @@ -583,9 +583,7 @@ btr_cur_will_modify_tree( { ut_ad(!page_is_leaf(page)); ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), - MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); /* Pessimistic delete of the first record causes delete & insert of node_ptr at upper level. And a subsequent page shrink is @@ -909,13 +907,13 @@ btr_cur_search_to_nth_level( # ifdef UNIV_SEARCH_PERF_STAT info->n_searches++; # endif - /* Use of AHI is disabled for intrinsic table as these tables re-use - the index-id and AHI validation is based on index-id. */ if (rw_lock_get_writer(btr_get_search_latch(index)) == RW_LOCK_NOT_LOCKED && latch_mode <= BTR_MODIFY_LEAF && info->last_hash_succ +# ifdef MYSQL_INDEX_DISABLE_AHI && !index->disable_ahi +# endif && !estimate # ifdef PAGE_CUR_LE_OR_EXTENDS && mode != PAGE_CUR_LE_OR_EXTENDS @@ -1958,7 +1956,11 @@ need_opposite_intention: will properly check btr_search_enabled again in btr_search_build_page_hash_index() before building a page hash index, while holding search latch. */ - if (btr_search_enabled && !index->disable_ahi) { + if (btr_search_enabled +# ifdef MYSQL_INDEX_DISABLE_AHI + && !index->disable_ahi +# endif + ) { btr_search_info_update(index, cursor); } #endif @@ -2009,179 +2011,6 @@ func_exit: DBUG_RETURN(err); } -/** Searches an index tree and positions a tree cursor on a given level. -This function will avoid latching the traversal path and so should be -used only for cases where-in latching is not needed. - -@param[in,out] index index -@param[in] level the tree level of search -@param[in] tuple data tuple; Note: n_fields_cmp in compared - to the node ptr page node field -@param[in] mode PAGE_CUR_L, .... - Insert should always be made using PAGE_CUR_LE - to search the position. -@param[in,out] cursor tree cursor; points to record of interest. -@param[in] file file name -@param[in[ line line where called from -@param[in,out] mtr mtr -@param[in] mark_dirty - if true then mark the block as dirty */ -dberr_t -btr_cur_search_to_nth_level_with_no_latch( - dict_index_t* index, - ulint level, - const dtuple_t* tuple, - page_cur_mode_t mode, - btr_cur_t* cursor, - const char* file, - ulint line, - mtr_t* mtr, - bool mark_dirty) -{ - page_t* page = NULL; /* remove warning */ - buf_block_t* block; - ulint height; - ulint up_match; - ulint low_match; - ulint rw_latch; - page_cur_mode_t page_mode; - ulint buf_mode; - page_cur_t* page_cursor; - ulint root_height = 0; /* remove warning */ - ulint n_blocks = 0; - dberr_t err = DB_SUCCESS; - mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; - rec_offs_init(offsets_); - - DBUG_ENTER("btr_cur_search_to_nth_level_with_no_latch"); - - ut_ad(dict_table_is_intrinsic(index->table)); - ut_ad(level == 0 || mode == PAGE_CUR_LE); - ut_ad(dict_index_check_search_tuple(index, tuple)); - ut_ad(dtuple_check_typed(tuple)); - ut_ad(index->page != FIL_NULL); - - UNIV_MEM_INVALID(&cursor->up_match, sizeof cursor->up_match); - UNIV_MEM_INVALID(&cursor->low_match, sizeof cursor->low_match); -#ifdef UNIV_DEBUG - cursor->up_match = ULINT_UNDEFINED; - cursor->low_match = ULINT_UNDEFINED; -#endif /* UNIV_DEBUG */ - - cursor->flag = BTR_CUR_BINARY; - cursor->index = index; - - page_cursor = btr_cur_get_page_cur(cursor); - - const ulint space = dict_index_get_space(index); - const page_size_t page_size(dict_table_page_size(index->table)); - /* Start with the root page. */ - page_id_t page_id(space, dict_index_get_page(index)); - - up_match = 0; - low_match = 0; - - height = ULINT_UNDEFINED; - - /* We use these modified search modes on non-leaf levels of the - B-tree. These let us end up in the right B-tree leaf. In that leaf - we use the original search mode. */ - - switch (mode) { - case PAGE_CUR_GE: - page_mode = PAGE_CUR_L; - break; - case PAGE_CUR_G: - page_mode = PAGE_CUR_LE; - break; - default: - page_mode = mode; - break; - } - - /* Loop and search until we arrive at the desired level */ - bool at_desired_level = false; - while (!at_desired_level) { - buf_mode = BUF_GET; - rw_latch = RW_NO_LATCH; - - ut_ad(n_blocks < BTR_MAX_LEVELS); - - block = buf_page_get_gen(page_id, page_size, rw_latch, NULL, - buf_mode, file, line, mtr, &err, mark_dirty); - - if (err != DB_SUCCESS) { - if (err == DB_DECRYPTION_FAILED) { - ib_push_warning((void *)NULL, - DB_DECRYPTION_FAILED, - "Table %s is encrypted but encryption service or" - " used key_id is not available. " - " Can't continue reading table.", - index->table->name); - index->table->is_encrypted = true; - } - - DBUG_RETURN(err); - } - - page = buf_block_get_frame(block); - - if (height == ULINT_UNDEFINED) { - /* We are in the root node */ - - height = btr_page_get_level(page, mtr); - root_height = height; - cursor->tree_height = root_height + 1; - } - - if (height == 0) { - /* On leaf level. Switch back to original search mode.*/ - page_mode = mode; - } - - page_cur_search_with_match( - block, index, tuple, page_mode, &up_match, - &low_match, page_cursor, NULL); - - ut_ad(height == btr_page_get_level( - page_cur_get_page(page_cursor), mtr)); - - if (level != height) { - - const rec_t* node_ptr; - ut_ad(height > 0); - - height--; - - node_ptr = page_cur_get_rec(page_cursor); - - offsets = rec_get_offsets( - node_ptr, index, offsets, - ULINT_UNDEFINED, &heap); - - /* Go to the child node */ - page_id.reset(space, btr_node_ptr_get_child_page_no( - node_ptr, offsets)); - - n_blocks++; - } else { - /* If this is the desired level, leave the loop */ - at_desired_level = true; - } - } - - cursor->low_match = low_match; - cursor->up_match = up_match; - - if (heap != NULL) { - mem_heap_free(heap); - } - - DBUG_RETURN(err); -} - /*****************************************************************//** Opens a cursor at either end of an index. */ dberr_t @@ -2556,125 +2385,6 @@ btr_cur_open_at_index_side_func( return err; } -/** Opens a cursor at either end of an index. -Avoid taking latches on buffer, just pin (by incrementing fix_count) -to keep them in buffer pool. This mode is used by intrinsic table -as they are not shared and so there is no need of latching. -@param[in] from_left true if open to low end, false if open - to high end. -@param[in] index index -@param[in,out] cursor cursor -@param[in] file file name -@param[in] line line where called -@param[in,out] mtr mini transaction -*/ -dberr_t -btr_cur_open_at_index_side_with_no_latch_func( - bool from_left, - dict_index_t* index, - btr_cur_t* cursor, - ulint level, - const char* file, - ulint line, - mtr_t* mtr) -{ - page_cur_t* page_cursor; - ulint height; - rec_t* node_ptr; - ulint n_blocks = 0; - mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; - dberr_t err = DB_SUCCESS; - rec_offs_init(offsets_); - - ut_ad(level != ULINT_UNDEFINED); - - page_cursor = btr_cur_get_page_cur(cursor); - cursor->index = index; - page_id_t page_id(dict_index_get_space(index), - dict_index_get_page(index)); - const page_size_t& page_size = dict_table_page_size(index->table); - - height = ULINT_UNDEFINED; - - for (;;) { - buf_block_t* block; - page_t* page; - ulint rw_latch = RW_NO_LATCH; - - ut_ad(n_blocks < BTR_MAX_LEVELS); - - block = buf_page_get_gen(page_id, page_size, rw_latch, NULL, - BUF_GET, file, line, mtr, &err); - - if (err != DB_SUCCESS) { - if (err == DB_DECRYPTION_FAILED) { - ib_push_warning((void *)NULL, - DB_DECRYPTION_FAILED, - "Table %s is encrypted but encryption service or" - " used key_id is not available. " - " Can't continue reading table.", - index->table->name); - index->table->is_encrypted = true; - } - - return (err); - } - - page = buf_block_get_frame(block); - - ut_ad(fil_page_index_page_check(page)); - ut_ad(index->id == btr_page_get_index_id(page)); - - if (height == ULINT_UNDEFINED) { - /* We are in the root node */ - - height = btr_page_get_level(page, mtr); - ut_a(height >= level); - } else { - /* TODO: flag the index corrupted if this fails */ - ut_ad(height == btr_page_get_level(page, mtr)); - } - - if (from_left) { - page_cur_set_before_first(block, page_cursor); - } else { - page_cur_set_after_last(block, page_cursor); - } - - if (height == level) { - break; - } - - ut_ad(height > 0); - - if (from_left) { - page_cur_move_to_next(page_cursor); - } else { - page_cur_move_to_prev(page_cursor); - } - - height--; - - node_ptr = page_cur_get_rec(page_cursor); - offsets = rec_get_offsets(node_ptr, cursor->index, offsets, - ULINT_UNDEFINED, &heap); - - /* Go to the child node */ - page_id.set_page_no( - btr_node_ptr_get_child_page_no(node_ptr, offsets)); - - n_blocks++; - } - - if (heap != NULL) { - mem_heap_free(heap); - } - - return(err); -} - /**********************************************************************//** Positions a cursor at a randomly chosen position within a B-tree. @return true if the index is available and we have put the cursor, false @@ -3097,11 +2807,8 @@ btr_cur_ins_lock_and_undo( return(err); } - /* Now we can fill in the roll ptr field in entry - (except if table is intrinsic) */ - - if (!(flags & BTR_KEEP_SYS_FLAG) - && !dict_table_is_intrinsic(index->table)) { + /* Now we can fill in the roll ptr field in entry */ + if (!(flags & BTR_KEEP_SYS_FLAG)) { row_upd_index_entry_sys_field(entry, index, DATA_ROLL_PTR, roll_ptr); @@ -3191,8 +2898,6 @@ btr_cur_optimistic_insert( page = buf_block_get_frame(block); index = cursor->index; - /* Block are not latched for insert if table is intrinsic - and index is auto-generated clustered index. */ ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); ut_ad(!dict_index_is_online_ddl(index) || dict_index_is_clust(index) @@ -3311,26 +3016,18 @@ fail_err: { const rec_t* page_cursor_rec = page_cur_get_rec(page_cursor); - if (dict_table_is_intrinsic(index->table)) { - - index->rec_cache.rec_size = rec_size; - - *rec = page_cur_tuple_direct_insert( - page_cursor, entry, index, n_ext, mtr); - } else { - /* Check locks and write to the undo log, - if specified */ - err = btr_cur_ins_lock_and_undo(flags, cursor, entry, - thr, mtr, &inherit); - if (err != DB_SUCCESS) { - goto fail_err; - } - - *rec = page_cur_tuple_insert( - page_cursor, entry, index, offsets, heap, - n_ext, mtr); + /* Check locks and write to the undo log, + if specified */ + err = btr_cur_ins_lock_and_undo(flags, cursor, entry, + thr, mtr, &inherit); + if (err != DB_SUCCESS) { + goto fail_err; } + *rec = page_cur_tuple_insert( + page_cursor, entry, index, offsets, heap, + n_ext, mtr); + reorg = page_cursor_rec != page_cur_get_rec(page_cursor); } @@ -3347,13 +3044,6 @@ fail_err: goto fail; } else { - - /* For intrinsic table we take a consistent path - to re-organize using pessimistic path. */ - if (dict_table_is_intrinsic(index->table)) { - goto fail; - } - ut_ad(!reorg); /* If the record did not fit, reorganize */ @@ -3378,12 +3068,13 @@ fail_err: } #ifdef BTR_CUR_HASH_ADAPT - if (!index->disable_ahi) { - if (!reorg && leaf && (cursor->flag == BTR_CUR_HASH)) { - btr_search_update_hash_node_on_insert(cursor); - } else { - btr_search_update_hash_on_insert(cursor); - } +# ifdef MYSQL_INDEX_DISABLE_AHI + if (index->disable_ahi); else +# endif + if (!reorg && leaf && (cursor->flag == BTR_CUR_HASH)) { + btr_search_update_hash_node_on_insert(cursor); + } else { + btr_search_update_hash_on_insert(cursor); } #endif /* BTR_CUR_HASH_ADAPT */ @@ -3467,9 +3158,8 @@ btr_cur_pessimistic_insert( *big_rec = NULL; ut_ad(mtr_memo_contains_flagged( - mtr, dict_index_get_lock(btr_cur_get_index(cursor)), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(cursor->index->table)); + mtr, dict_index_get_lock(btr_cur_get_index(cursor)), + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix( mtr, btr_cur_get_block(cursor), MTR_MEMO_PAGE_X_FIX, cursor->index->table)); @@ -3489,8 +3179,7 @@ btr_cur_pessimistic_insert( return(err); } - if (!(flags & BTR_NO_UNDO_LOG_FLAG) - || dict_table_is_intrinsic(index->table)) { + if (!(flags & BTR_NO_UNDO_LOG_FLAG)) { /* First reserve enough free space for the file segments of the index tree, so that the insert will not fail because of lack of space */ @@ -3577,9 +3266,10 @@ btr_cur_pessimistic_insert( } #ifdef BTR_CUR_ADAPT - if (!index->disable_ahi) { - btr_search_update_hash_on_insert(cursor); - } +# ifdef MYSQL_INDEX_DISABLE_AHI + if (index->disable_ahi); else +# endif + btr_search_update_hash_on_insert(cursor); #endif if (inherit && !(flags & BTR_NO_LOCKING_FLAG)) { @@ -3921,9 +3611,7 @@ btr_cur_update_in_place( index = cursor->index; ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); - ut_ad(trx_id > 0 - || (flags & BTR_KEEP_SYS_FLAG) - || dict_table_is_intrinsic(index->table)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) @@ -3970,8 +3658,7 @@ btr_cur_update_in_place( goto func_exit; } - if (!(flags & BTR_KEEP_SYS_FLAG) - && !dict_table_is_intrinsic(index->table)) { + if (!(flags & BTR_KEEP_SYS_FLAG)) { row_upd_rec_sys_fields(rec, NULL, index, offsets, thr_get_trx(thr), roll_ptr); } @@ -4087,9 +3774,7 @@ btr_cur_optimistic_update( page = buf_block_get_frame(block); rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(trx_id > 0 - || (flags & BTR_KEEP_SYS_FLAG) - || dict_table_is_intrinsic(index->table)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); /* This is intended only for leaf page updates */ @@ -4275,8 +3960,7 @@ any_extern: page_cur_move_to_prev(page_cursor); - if (!(flags & BTR_KEEP_SYS_FLAG) - && !dict_table_is_intrinsic(index->table)) { + if (!(flags & BTR_KEEP_SYS_FLAG)) { row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR, roll_ptr); row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID, @@ -4422,8 +4106,7 @@ btr_cur_pessimistic_update( ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK | - MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); #ifdef UNIV_ZIP_DEBUG ut_a(!page_zip || page_zip_validate(page_zip, page, index)); @@ -4431,8 +4114,7 @@ btr_cur_pessimistic_update( /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); ut_ad(trx_id > 0 - || (flags & BTR_KEEP_SYS_FLAG) - || dict_table_is_intrinsic(index->table)); + || (flags & BTR_KEEP_SYS_FLAG)); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id @@ -4495,11 +4177,8 @@ btr_cur_pessimistic_update( ut_ad(rec_offs_validate(rec, index, *offsets)); n_ext += btr_push_update_extern_fields(new_entry, update, entry_heap); - /* UNDO logging is also turned-off during normal operation on intrinsic - table so condition needs to ensure that table is not intrinsic. */ if ((flags & BTR_NO_UNDO_LOG_FLAG) - && rec_offs_any_extern(*offsets) - && !dict_table_is_intrinsic(index->table)) { + && rec_offs_any_extern(*offsets)) { /* We are in a transaction rollback undoing a row update: we must free possible externally stored fields which got new values in the update, if they are not @@ -4575,8 +4254,7 @@ btr_cur_pessimistic_update( } } - if (!(flags & BTR_KEEP_SYS_FLAG) - && !dict_table_is_intrinsic(index->table)) { + if (!(flags & BTR_KEEP_SYS_FLAG)) { row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR, roll_ptr); row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID, @@ -4682,7 +4360,7 @@ btr_cur_pessimistic_update( } } - if (big_rec_vec != NULL && !dict_table_is_intrinsic(index->table)) { + if (big_rec_vec != NULL) { ut_ad(page_is_leaf(page)); ut_ad(dict_index_is_clust(index)); ut_ad(flags & BTR_KEEP_POS_FLAG); @@ -4971,12 +4649,6 @@ btr_cur_del_mark_set_clust_rec( btr_rec_set_deleted_flag(rec, page_zip, TRUE); - /* For intrinsic table, roll-ptr is not maintained as there is no UNDO - logging. Skip updating it. */ - if (dict_table_is_intrinsic(index->table)) { - return(err); - } - trx = thr_get_trx(thr); /* This function must not be invoked during rollback (of a TRX_STATE_PREPARE transaction or otherwise). */ @@ -5175,16 +4847,9 @@ btr_cur_compress_if_useful( cursor position even if compression occurs */ mtr_t* mtr) /*!< in/out: mini-transaction */ { - /* Avoid applying compression as we don't accept lot of page garbage - given the workload of intrinsic table. */ - if (dict_table_is_intrinsic(cursor->index->table)) { - return(FALSE); - } - ut_ad(mtr_memo_contains_flagged( mtr, dict_index_get_lock(btr_cur_get_index(cursor)), - MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(cursor->index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix( mtr, btr_cur_get_block(cursor), MTR_MEMO_PAGE_X_FIX, cursor->index->table)); @@ -5368,8 +5033,7 @@ btr_cur_pessimistic_delete( || (flags & BTR_CREATE_FLAG)); ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); ut_ad(mtr->is_named_space(index->space)); @@ -6914,13 +6578,11 @@ struct btr_blob_log_check_t { ut_ad(m_mtr->memo_contains_page_flagged( *m_rec, - MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX)); ut_ad(mtr_memo_contains_flagged(m_mtr, dict_index_get_lock(index), - MTR_MEMO_SX_LOCK | MTR_MEMO_X_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_SX_LOCK | MTR_MEMO_X_LOCK)); } }; @@ -6978,9 +6640,7 @@ btr_store_big_rec_extern_fields( ut_ad(rec_offs_any_extern(offsets)); ut_ad(btr_mtr); ut_ad(mtr_memo_contains_flagged(btr_mtr, dict_index_get_lock(index), - MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_block_fix( btr_mtr, rec_block, MTR_MEMO_PAGE_X_FIX, index->table)); ut_ad(buf_block_get_frame(rec_block) == page_align(rec)); @@ -7479,9 +7139,7 @@ btr_free_externally_stored_field( ut_ad(dict_index_is_clust(index)); ut_ad(mtr_memo_contains_flagged(local_mtr, dict_index_get_lock(index), - MTR_MEMO_X_LOCK - | MTR_MEMO_SX_LOCK) - || dict_table_is_intrinsic(index->table)); + MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); ut_ad(mtr_is_page_fix( local_mtr, field_ref, MTR_MEMO_PAGE_X_FIX, index->table)); ut_ad(!rec || rec_offs_validate(rec, index, offsets)); diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index 540bb0aa1f4..73399f14081 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -134,8 +134,7 @@ btr_pcur_store_position( } else { ut_ad(mtr_memo_contains_flagged(mtr, block, MTR_MEMO_PAGE_S_FIX - | MTR_MEMO_PAGE_X_FIX) - || dict_table_is_intrinsic(index->table)); + | MTR_MEMO_PAGE_X_FIX)); } #endif /* UNIV_DEBUG */ @@ -285,13 +284,11 @@ btr_pcur_restore_position_func( ut_a(cursor->old_rec); ut_a(cursor->old_n_fields); - /* Optimistic latching involves S/X latch not required for - intrinsic table instead we would prefer to search fresh. */ - if ((latch_mode == BTR_SEARCH_LEAF - || latch_mode == BTR_MODIFY_LEAF - || latch_mode == BTR_SEARCH_PREV - || latch_mode == BTR_MODIFY_PREV) - && !dict_table_is_intrinsic(cursor->btr_cur.index->table)) { + switch (latch_mode) { + case BTR_SEARCH_LEAF: + case BTR_MODIFY_LEAF: + case BTR_SEARCH_PREV: + case BTR_MODIFY_PREV: /* Try optimistic restoration. */ if (!buf_pool_is_obsolete(cursor->withdraw_clock) @@ -424,7 +421,6 @@ btr_pcur_move_to_next_page( buf_block_t* next_block; page_t* next_page; ulint mode; - dict_table_t* table = btr_pcur_get_btr_cur(cursor)->index->table; ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); @@ -446,12 +442,6 @@ btr_pcur_move_to_next_page( mode = BTR_MODIFY_LEAF; } - /* For intrinsic tables we avoid taking any latches as table is - accessed by only one thread at any given time. */ - if (dict_table_is_intrinsic(table)) { - mode = BTR_NO_LATCHES; - } - buf_block_t* block = btr_pcur_get_block(cursor); next_block = btr_block_get( @@ -525,32 +515,26 @@ btr_pcur_move_backward_from_page( prev_page_no = btr_page_get_prev(page, mtr); - /* For intrinsic table we don't do optimistic restore and so there is - no left block that is pinned that needs to be released. */ - if (!dict_table_is_intrinsic( - btr_cur_get_index(btr_pcur_get_btr_cur(cursor))->table)) { + if (prev_page_no == FIL_NULL) { + } else if (btr_pcur_is_before_first_on_page(cursor)) { - if (prev_page_no == FIL_NULL) { - } else if (btr_pcur_is_before_first_on_page(cursor)) { + prev_block = btr_pcur_get_btr_cur(cursor)->left_block; - prev_block = btr_pcur_get_btr_cur(cursor)->left_block; + btr_leaf_page_release(btr_pcur_get_block(cursor), + latch_mode, mtr); - btr_leaf_page_release(btr_pcur_get_block(cursor), - latch_mode, mtr); - - page_cur_set_after_last(prev_block, + page_cur_set_after_last(prev_block, btr_pcur_get_page_cur(cursor)); - } else { + } else { - /* The repositioned cursor did not end on an infimum - record on a page. Cursor repositioning acquired a latch - also on the previous page, but we do not need the latch: - release it. */ + /* The repositioned cursor did not end on an infimum + record on a page. Cursor repositioning acquired a latch + also on the previous page, but we do not need the latch: + release it. */ - prev_block = btr_pcur_get_btr_cur(cursor)->left_block; + prev_block = btr_pcur_get_btr_cur(cursor)->left_block; - btr_leaf_page_release(prev_block, latch_mode, mtr); - } + btr_leaf_page_release(prev_block, latch_mode, mtr); } cursor->latch_mode = latch_mode; diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index 4489775d46c..0af2a8b637c 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -1214,7 +1214,9 @@ retry: (buf_fix_count == 0 when DROP TABLE or similar is executing buf_LRU_drop_page_hash_for_tablespace()). */ ut_a(index == block->index); +#ifdef MYSQL_INDEX_DISABLE_AHI ut_ad(!index->disable_ahi); +#endif ut_ad(block->page.id.space() == index->space); ut_a(index_id == index->id); @@ -1437,7 +1439,10 @@ btr_search_build_page_hash_index( ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; - if (index->disable_ahi || !btr_search_enabled) { +#ifdef MYSQL_INDEX_DISABLE_AHI + if (index->disable_ahi) return; +#endif + if (!btr_search_enabled) { return; } @@ -1614,15 +1619,13 @@ btr_search_move_or_delete_hash_entries( buf_block_t* block, dict_index_t* index) { - /* AHI is disabled for intrinsic table as it depends on index-id - which is dynamically assigned for intrinsic table indexes and not - through a centralized index generator. */ - if (index->disable_ahi || !btr_search_enabled) { +#ifdef MYSQL_INDEX_DISABLE_AHI + if (index->disable_ahi) return; +#endif + if (!btr_search_enabled) { return; } - ut_ad(!dict_table_is_intrinsic(index->table)); - ut_ad(rw_lock_own(&(block->lock), RW_LOCK_X)); ut_ad(rw_lock_own(&(new_block->lock), RW_LOCK_X)); @@ -1681,7 +1684,10 @@ btr_search_update_hash_on_delete(btr_cur_t* cursor) mem_heap_t* heap = NULL; rec_offs_init(offsets_); - if (cursor->index->disable_ahi || !btr_search_enabled) { +#ifdef MYSQL_INDEX_DISABLE_AHI + if (cursor->index->disable_ahi) return; +#endif + if (!btr_search_enabled) { return; } @@ -1740,7 +1746,10 @@ btr_search_update_hash_node_on_insert(btr_cur_t* cursor) dict_index_t* index; rec_t* rec; - if (cursor->index->disable_ahi || !btr_search_enabled) { +#ifdef MYSQL_INDEX_DISABLE_AHI + if (cursor->index->disable_ahi) return; +#endif + if (!btr_search_enabled) { return; } @@ -1817,7 +1826,10 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor) ulint* offsets = offsets_; rec_offs_init(offsets_); - if (cursor->index->disable_ahi || !btr_search_enabled) { +#ifdef MYSQL_INDEX_DISABLE_AHI + if (cursor->index->disable_ahi) return; +#endif + if (!btr_search_enabled) { return; } @@ -1839,7 +1851,9 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor) rec = btr_cur_get_rec(cursor); +#ifdef MYSQL_INDEX_DISABLE_AHI ut_a(!index->disable_ahi); +#endif ut_a(index == cursor->index); ut_a(!dict_index_is_ibuf(index)); diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index f86f3bdef40..d3b4f12e69b 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1476,7 +1476,6 @@ buf_block_init( ut_d(block->page.file_page_was_freed = FALSE); block->index = NULL; - block->made_dirty_with_no_latch = false; block->skip_flush_check = false; ut_d(block->page.in_page_hash = FALSE); @@ -1714,12 +1713,25 @@ buf_chunk_not_freed( file pages. */ break; case BUF_BLOCK_FILE_PAGE: + if (srv_read_only_mode) { + /* The page cleaner is disabled in + read-only mode. No pages can be + dirtied, so all of them must be clean. */ + ut_ad(block->page.oldest_modification + == block->page.newest_modification); + ut_ad(block->page.oldest_modification == 0 + || block->page.oldest_modification + == recv_sys->recovered_lsn); + ut_ad(block->page.buf_fix_count == 0); + ut_ad(block->page.io_fix == BUF_IO_NONE); + break; + } + buf_page_mutex_enter(block); ready = buf_flush_ready_for_replace(&block->page); buf_page_mutex_exit(block); if (!ready) { - return(block); } @@ -3848,7 +3860,6 @@ buf_block_init_low( buf_block_t* block) /*!< in: block to init */ { block->index = NULL; - block->made_dirty_with_no_latch = false; block->skip_flush_check = false; block->n_hash_helps = 0; @@ -4117,9 +4128,6 @@ BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or BUF_GET_IF_IN_POOL_OR_WATCH @param[in] file file name @param[in] line line where called @param[in] mtr mini-transaction -@param[in] dirty_with_no_latch - mark page as dirty even if page - is being pinned without any latch @return pointer to the block or NULL */ buf_block_t* buf_page_get_gen( @@ -4131,8 +4139,7 @@ buf_page_get_gen( const char* file, ulint line, mtr_t* mtr, - dberr_t* err, - bool dirty_with_no_latch) + dberr_t* err) { buf_block_t* block; unsigned access_time; @@ -4415,11 +4422,9 @@ got_block: bpage = &block->page; if (fsp_is_system_temporary(page_id.space()) && buf_page_get_io_fix(bpage) != BUF_IO_NONE) { - /* This suggest that page is being flushed. + /* This suggests that the page is being flushed. Avoid returning reference to this page. - Instead wait for flush action to complete. - For normal page this sync is done using SX - lock but for intrinsic there is no latching. */ + Instead wait for the flush action to complete. */ buf_block_unfix(fix_block); os_thread_sleep(WAIT_FOR_WRITE); goto loop; @@ -4744,17 +4749,6 @@ got_block: and block->lock. */ buf_wait_for_read(fix_block); - /* Mark block as dirty if requested by caller. If not requested (false) - then we avoid updating the dirty state of the block and retain the - original one. This is reason why ? - Same block can be shared/pinned by 2 different mtrs. If first mtr - set the dirty state to true and second mtr mark it as false the last - updated dirty state is retained. Which means we can loose flushing of - a modified block. */ - if (dirty_with_no_latch) { - fix_block->made_dirty_with_no_latch = dirty_with_no_latch; - } - mtr_memo_type_t fix_type; switch (rw_latch) { diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 31952424119..a34daede626 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -461,7 +461,7 @@ dict_build_tablespace_for_table( bool needs_file_per_table; char* filepath; - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); needs_file_per_table = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_USE_FILE_PER_TABLE); @@ -920,7 +920,7 @@ dict_build_index_def( dict_index_t* index, /*!< in/out: index */ trx_t* trx) /*!< in/out: InnoDB transaction handle */ { - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); if (trx->table_id == 0) { /* Record only the first table id. */ @@ -930,18 +930,7 @@ dict_build_index_def( ut_ad((UT_LIST_GET_LEN(table->indexes) > 0) || dict_index_is_clust(index)); - if (!dict_table_is_intrinsic(table)) { - dict_hdr_get_new_id(NULL, &index->id, NULL, table, false); - } else { - /* Index are re-loaded in process of creation using id. - If same-id is used for all indexes only first index will always - be retrieved when expected is iterative return of all indexes*/ - if (UT_LIST_GET_LEN(table->indexes) > 0) { - index->id = UT_LIST_GET_LAST(table->indexes)->id + 1; - } else { - index->id = 1; - } - } + dict_hdr_get_new_id(NULL, &index->id, NULL, table, false); /* Inherit the space id from the table; we store all indexes of a table in the same tablespace */ @@ -1061,8 +1050,7 @@ dict_create_index_tree_in_mem( mtr_t mtr; ulint page_no = FIL_NULL; - ut_ad(mutex_own(&dict_sys->mutex) - || dict_table_is_intrinsic(index->table)); + ut_ad(mutex_own(&dict_sys->mutex)); if (index->type == DICT_FTS) { /* FTS index does not need an index tree */ @@ -1175,8 +1163,7 @@ dict_drop_index_tree_in_mem( const dict_index_t* index, /*!< in: index */ ulint page_no) /*!< in: index page-no */ { - ut_ad(mutex_own(&dict_sys->mutex) - || dict_table_is_intrinsic(index->table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(dict_table_is_temporary(index->table)); ulint root_page_no = page_no; @@ -1295,8 +1282,7 @@ dict_truncate_index_tree_in_mem( bool truncate; ulint space = index->space; - ut_ad(mutex_own(&dict_sys->mutex) - || dict_table_is_intrinsic(index->table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(dict_table_is_temporary(index->table)); ulint type = index->type; @@ -2509,12 +2495,7 @@ dict_create_add_foreigns_to_dictionary( dict_foreign_t* foreign; dberr_t error; - ut_ad(mutex_own(&dict_sys->mutex) - || dict_table_is_intrinsic(table)); - - if (dict_table_is_intrinsic(table)) { - goto exit_loop; - } + ut_ad(mutex_own(&dict_sys->mutex)); if (NULL == dict_table_get_low("SYS_FOREIGN")) { @@ -2540,7 +2521,6 @@ dict_create_add_foreigns_to_dictionary( } } -exit_loop: trx->op_info = "committing foreign key definitions"; if (trx_is_started(trx)) { @@ -2796,14 +2776,6 @@ dict_table_assign_new_id( dict_table_t* table, trx_t* trx) { - if (dict_table_is_intrinsic(table)) { - /* There is no significance of this table->id (if table is - intrinsic) so assign it default instead of something meaningful - to avoid confusion.*/ - table->id = ULINT_UNDEFINED; - } else { - dict_hdr_get_new_id(&table->id, NULL, NULL, table, false); - } - + dict_hdr_get_new_id(&table->id, NULL, NULL, table, false); trx->table_id = table->id; } diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 3d527c6b017..ddb96bf252c 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -502,21 +502,15 @@ dict_table_close( indexes after an aborted online index creation */ { - if (!dict_locked && !dict_table_is_intrinsic(table)) { + if (!dict_locked) { mutex_enter(&dict_sys->mutex); } - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_a(table->get_ref_count() > 0); table->release(); - /* Intrinsic table is not added to dictionary cache so skip other - cache specific actions. */ - if (dict_table_is_intrinsic(table)) { - return; - } - /* Force persistent stats re-read upon next open of the table so that FLUSH TABLE can be used to forcibly fetch stats from disk if they have been manually modified. We reset table->stat_initialized @@ -1388,18 +1382,12 @@ dict_table_add_system_columns( (so that they can be indexed by the numerical value of DATA_ROW_ID, etc.) and as the last columns of the table memory object. The clustered index will not always physically contain all system - columns. - Intrinsic table don't need DB_ROLL_PTR as UNDO logging is turned off - for these tables. */ + columns. */ dict_mem_table_add_col(table, heap, "DB_ROW_ID", DATA_SYS, DATA_ROW_ID | DATA_NOT_NULL, DATA_ROW_ID_LEN); -#if (DATA_ITT_N_SYS_COLS != 2) -#error "DATA_ITT_N_SYS_COLS != 2" -#endif - #if DATA_ROW_ID != 0 #error "DATA_ROW_ID != 0" #endif @@ -1410,20 +1398,18 @@ dict_table_add_system_columns( #error "DATA_TRX_ID != 1" #endif - if (!dict_table_is_intrinsic(table)) { - dict_mem_table_add_col(table, heap, "DB_ROLL_PTR", DATA_SYS, - DATA_ROLL_PTR | DATA_NOT_NULL, - DATA_ROLL_PTR_LEN); + dict_mem_table_add_col(table, heap, "DB_ROLL_PTR", DATA_SYS, + DATA_ROLL_PTR | DATA_NOT_NULL, + DATA_ROLL_PTR_LEN); #if DATA_ROLL_PTR != 2 #error "DATA_ROLL_PTR != 2" #endif - /* This check reminds that if a new system column is added to - the program, it should be dealt with here */ + /* This check reminds that if a new system column is added to + the program, it should be dealt with here */ #if DATA_N_SYS_COLS != 3 #error "DATA_N_SYS_COLS != 3" #endif - } } #ifndef UNIV_HOTBACKUP @@ -2654,7 +2640,7 @@ dict_index_add_to_cache_w_vcol( ulint i; ut_ad(index); - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(index->n_def == index->n_fields); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(!dict_index_is_online_ddl(index)); @@ -2687,9 +2673,10 @@ dict_index_add_to_cache_w_vcol( new_index->n_fields = new_index->n_def; new_index->trx_id = index->trx_id; new_index->set_committed(index->is_committed()); - new_index->allow_duplicates = index->allow_duplicates; new_index->nulls_equal = index->nulls_equal; +#ifdef MYSQL_INDEX_DISABLE_AHI new_index->disable_ahi = index->disable_ahi; +#endif if (dict_index_too_big_for_tree(table, new_index, strict)) { @@ -2771,39 +2758,7 @@ dict_index_add_to_cache_w_vcol( rw_lock_create(index_tree_rw_lock_key, &new_index->lock, SYNC_INDEX_TREE); - /* Intrinsic table are not added to dictionary cache instead are - cached to session specific thread cache. */ - if (!dict_table_is_intrinsic(table)) { - dict_sys->size += mem_heap_get_size(new_index->heap); - } - - /* Check if key part of the index is unique. */ - if (dict_table_is_intrinsic(table)) { - - new_index->rec_cache.fixed_len_key = true; - for (i = 0; i < new_index->n_uniq; i++) { - - const dict_field_t* field; - field = dict_index_get_nth_field(new_index, i); - - if (!field->fixed_len) { - new_index->rec_cache.fixed_len_key = false; - break; - } - } - - new_index->rec_cache.key_has_null_cols = false; - for (i = 0; i < new_index->n_uniq; i++) { - - const dict_field_t* field; - field = dict_index_get_nth_field(new_index, i); - - if (!(field->col->prtype & DATA_NOT_NULL)) { - new_index->rec_cache.key_has_null_cols = true; - break; - } - } - } + dict_sys->size += mem_heap_get_size(new_index->heap); dict_mem_index_free(index); @@ -2926,7 +2881,6 @@ dict_index_remove_from_cache_low( size = mem_heap_get_size(index->heap); - ut_ad(!dict_table_is_intrinsic(table)); ut_ad(dict_sys->size >= size); dict_sys->size -= size; @@ -2963,7 +2917,7 @@ dict_index_find_cols( ut_ad(table != NULL && index != NULL); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); for (ulint i = 0; i < index->n_fields; i++) { ulint j; @@ -3285,7 +3239,7 @@ dict_index_build_internal_clust( ut_ad(dict_index_is_clust(index)); ut_ad(!dict_index_is_ibuf(index)); - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* Create a new index object with certainly enough fields */ @@ -3379,16 +3333,9 @@ dict_index_build_internal_clust( } } - /* UNDO logging is turned-off for intrinsic table and so - DATA_ROLL_PTR system columns are not added as default system - columns to such tables. */ - if (!dict_table_is_intrinsic(table)) { - - dict_index_add_col( - new_index, table, - dict_table_get_sys_col(table, DATA_ROLL_PTR), - 0); - } + dict_index_add_col( + new_index, table, + dict_table_get_sys_col(table, DATA_ROLL_PTR), 0); /* Remember the table columns already contained in new_index */ indexed = static_cast( @@ -3451,7 +3398,7 @@ dict_index_build_internal_non_clust( ut_ad(table && index); ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_ibuf(index)); - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* The clustered index should be the first in the list of indexes */ diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index f38ad85e903..946919097c1 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -3179,7 +3179,7 @@ err_exit: ib::error() << "Table " << table->name << " in InnoDB" " data dictionary contains invalid flags." " SYS_TABLES.MIX_LEN=" << table->flags2; - table->flags2 &= ~(DICT_TF2_TEMPORARY|DICT_TF2_INTRINSIC); + table->flags2 &= ~DICT_TF2_TEMPORARY; dict_table_remove_from_cache(table); table = NULL; err = DB_FAIL; diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index a8f8e345728..e73c6196386 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -160,8 +160,6 @@ dict_mem_table_create( dict_table_autoinc_create_lazy(table); table->autoinc = 0; - table->sess_row_id = 0; - table->sess_trx_id = 0; /* The number of transactions that are either waiting on the AUTOINC lock or have been granted the lock. */ diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index cfb4903bb7a..596c6bdfdb0 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -4934,8 +4934,7 @@ fil_space_extend( fil_space_t* space, ulint size) { - /* In read-only mode we allow write to shared temporary tablespace - as intrinsic table created by Optimizer reside in this tablespace. */ + /* In read-only mode we allow writes to temporary tables. */ ut_ad(!srv_read_only_mode || fsp_is_system_temporary(space->id)); retry: diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 7d538dbd13a..d74f8cfa5bf 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1858,7 +1858,7 @@ fts_create_one_common_table( TRX_DICT_OP_TABLE. */ trx_dict_op_t op = trx_get_dict_operation(trx); - error = row_create_index_for_mysql(index, trx, NULL, NULL); + error = row_create_index_for_mysql(index, trx, NULL); trx->dict_operation = op; } @@ -1975,7 +1975,7 @@ fts_create_common_tables( op = trx_get_dict_operation(trx); - error = row_create_index_for_mysql(index, trx, NULL, NULL); + error = row_create_index_for_mysql(index, trx, NULL); trx->dict_operation = op; @@ -2067,7 +2067,7 @@ fts_create_one_index_table( trx_dict_op_t op = trx_get_dict_operation(trx); - error = row_create_index_for_mysql(index, trx, NULL, NULL); + error = row_create_index_for_mysql(index, trx, NULL); trx->dict_operation = op; } diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc index 2c0c5b453a3..39ad4fe7d7d 100644 --- a/storage/innobase/gis/gis0sea.cc +++ b/storage/innobase/gis/gis0sea.cc @@ -1569,8 +1569,6 @@ rtr_copy_buf( matches->block.curr_n_fields = block->curr_n_fields; matches->block.curr_left_side = block->curr_left_side; matches->block.index = block->index; - matches->block.made_dirty_with_no_latch - = block->made_dirty_with_no_latch; ut_d(matches->block.debug_latch = block->debug_latch); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 7b526b7f9b2..ea6797d2229 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1790,13 +1790,6 @@ innobase_srv_conc_enter_innodb( } #endif /* WITH_WSREP */ - /* We rely on server to do external_lock(F_UNLCK) to reset the - srv_conc.n_active counter. Since there are no locks on instrinsic - tables, we should skip this for intrinsic temporary tables. */ - if (dict_table_is_intrinsic(prebuilt->table)) { - return; - } - trx_t* trx = prebuilt->trx; if (srv_thread_concurrency) { if (trx->n_tickets_to_enter_innodb > 0) { @@ -1835,13 +1828,6 @@ innobase_srv_conc_exit_innodb( } #endif /* WITH_WSREP */ - /* We rely on server to do external_lock(F_UNLCK) to reset the - srv_conc.n_active counter. Since there are no locks on instrinsic - tables, we should skip this for intrinsic temporary tab */ - if (dict_table_is_intrinsic(prebuilt->table)) { - return; - } - trx_t* trx = prebuilt->trx; #ifdef UNIV_DEBUG btrsea_sync_check check(trx->has_search_latch); @@ -1963,29 +1949,6 @@ thd_innodb_tmpdir( return(tmp_dir); } -/** Obtain the private handler of InnoDB session specific data. -@param[in,out] thd MySQL thread handler. -@return reference to private handler */ -MY_ATTRIBUTE((warn_unused_result)) -static -innodb_session_t*& -thd_to_innodb_session( - THD* thd) -{ - innodb_session_t*& innodb_session = - *(innodb_session_t**) thd_ha_data(thd, innodb_hton_ptr); - - if (innodb_session != NULL) { - return(innodb_session); - } - - innodb_session = UT_NEW_NOKEY(innodb_session_t()); - - thd_set_ha_data(thd, innodb_hton_ptr, innodb_session); - - return(innodb_session); -} - /** Obtain the InnoDB transaction of a MySQL thread. @param[in,out] thd MySQL thread handler. @return reference to transaction pointer */ @@ -1994,10 +1957,7 @@ trx_t*& thd_to_trx( THD* thd) { - innodb_session_t*& innodb_session = thd_to_innodb_session(thd); - ut_ad(innodb_session != NULL); - - return(innodb_session->m_trx); + return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr)); } #ifdef WITH_WSREP @@ -2013,47 +1973,6 @@ thd_to_trx_id( } #endif /* WITH_WSREP */ -/** Check if statement is of type INSERT .... SELECT that involves -use of intrinsic tables. -@param[in] thd thread handler -@return true if INSERT .... SELECT statement. */ -static inline -bool -thd_is_ins_sel_stmt(THD* user_thd) -{ - /* If the session involves use of intrinsic table - and it is trying to fetch the result from non-temporary tables - it indicates "insert .... select" statement. For non-temporary - table this is verifed using the locked tables count but for - intrinsic table as external_lock is not invoked this count is - not updated. - - Why is this needed ? - Use of AHI is blocked if statement is insert .... select statement. */ - innodb_session_t* innodb_priv = thd_to_innodb_session(user_thd); - return(innodb_priv->count_register_table_handler() > 0 ? true : false); -} - -/** Add the table handler to thread cache. -Obtain the InnoDB transaction of a MySQL thread. -@param[in,out] table table handler -@param[in,out] heap heap for allocating system columns. -@param[in,out] thd MySQL thread handler */ -static inline -void -add_table_to_thread_cache( - dict_table_t* table, - mem_heap_t* heap, - THD* thd) -{ - dict_table_add_system_columns(table, heap); - - dict_table_set_big_rows(table); - - innodb_session_t*& priv = thd_to_innodb_session(thd); - priv->register_table_handler(table->name.m_name, table); -} - /********************************************************************//** Call this function when mysqld passes control to the client. That is to avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more @@ -3110,16 +3029,12 @@ check_trx_exists( if (trx == NULL) { trx = innobase_trx_allocate(thd); - innodb_session_t* innodb_session = thd_to_innodb_session(thd); - innodb_session->m_trx = trx; - /* User trx can be forced to rollback, so we unset the disable flag. */ ut_ad(trx->in_innodb & TRX_FORCE_ROLLBACK_DISABLE); trx->in_innodb &= TRX_FORCE_ROLLBACK_MASK; } else { ut_a(trx->magic_n == TRX_MAGIC_N); - innobase_trx_init(thd, trx); } @@ -3362,8 +3277,7 @@ ha_innobase::update_thd( TrxInInnoDB trx_in_innodb(trx); - ut_ad(dict_table_is_intrinsic(m_prebuilt->table) - || trx_in_innodb.is_aborted() + ut_ad(trx_in_innodb.is_aborted() || (trx->dict_operation_lock_mode == 0 && trx->dict_operation == TRX_DICT_OP_NONE)); @@ -5620,10 +5534,6 @@ innobase_close_connection( trx_free_for_mysql(trx); } - UT_DELETE(thd_to_innodb_session(thd)); - - thd_to_innodb_session(thd) = NULL; - DBUG_RETURN(0); } @@ -6740,18 +6650,6 @@ ha_innobase::innobase_initialize_autoinc() col_name = field->field_name; - /* For intrinsic table, name of field has to be prefixed with - table name to maintain column-name uniqueness. */ - if (m_prebuilt->table != NULL - && dict_table_is_intrinsic(m_prebuilt->table)) { - - ulint col_no = dict_col_get_no(dict_table_get_nth_col( - m_prebuilt->table, field->field_index)); - - col_name = dict_table_get_col_name( - m_prebuilt->table, col_no); - } - index = innobase_get_index(table->s->next_number_index); /* Execute SELECT MAX(col_name) FROM TABLE; */ @@ -6863,18 +6761,7 @@ ha_innobase::open( ignore_err = DICT_ERR_IGNORE_FK_NOKEY; } - /* Get pointer to a table object in InnoDB dictionary cache. - For intrinsic table, get it from session private data */ - ib_table = thd_to_innodb_session(thd)->lookup_table_handler(norm_name); - - if (ib_table == NULL) { - - ib_table = open_dict_table(name, norm_name, is_part, - ignore_err); - } else { - ib_table->acquire(); - ut_ad(dict_table_is_intrinsic(ib_table)); - } + ib_table = open_dict_table(name, norm_name, is_part, ignore_err); if (ib_table != NULL && ((!DICT_TF2_FLAG_IS_SET(ib_table, DICT_TF2_FTS_HAS_DOC_ID) @@ -8752,18 +8639,10 @@ ha_innobase::innobase_lock_autoinc(void) { DBUG_ENTER("ha_innobase::innobase_lock_autoinc"); dberr_t error = DB_SUCCESS; - long lock_mode = innobase_autoinc_lock_mode; - ut_ad(!srv_read_only_mode - || dict_table_is_intrinsic(m_prebuilt->table)); + ut_ad(!srv_read_only_mode); - if (dict_table_is_intrinsic(m_prebuilt->table)) { - /* Intrinsic table are not shared accorss connection - so there is no need to AUTOINC lock the table. */ - lock_mode = AUTOINC_NO_LOCKING; - } - - switch (lock_mode) { + switch (innobase_autoinc_lock_mode) { case AUTOINC_NO_LOCKING: /* Acquire only the AUTOINC mutex. */ dict_table_autoinc_lock(m_prebuilt->table); @@ -8839,30 +8718,6 @@ ha_innobase::innobase_set_max_autoinc( return(error); } -/** Write Row interface optimized for intrinisc table. -@param[in] record a row in MySQL format. -@return 0 on success or error code */ -int -ha_innobase::intrinsic_table_write_row(uchar* record) -{ - dberr_t err; - - /* No auto-increment support for intrinsic table. */ - ut_ad(!(table->next_number_field && record == table->record[0])); - - if (m_prebuilt->mysql_template == NULL - || m_prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) { - /* Build the template used in converting quickly between - the two database formats */ - build_template(true); - } - - err = row_insert_for_mysql((byte*) record, m_prebuilt); - - return(convert_error_code_to_mysql( - err, m_prebuilt->table->flags, m_user_thd)); -} - /********************************************************************//** Stores a row in an InnoDB database, to the table specified in this handle. @@ -8883,15 +8738,10 @@ ha_innobase::write_row( DBUG_ENTER("ha_innobase::write_row"); - if (dict_table_is_intrinsic(m_prebuilt->table)) { - DBUG_RETURN(intrinsic_table_write_row(record)); - } - trx_t* trx = thd_to_trx(m_user_thd); TrxInInnoDB trx_in_innodb(trx); - if (!dict_table_is_intrinsic(m_prebuilt->table) - && trx_in_innodb.is_aborted()) { + if (trx_in_innodb.is_aborted()) { innobase_rollback(ht, m_user_thd, false); @@ -9338,7 +9188,7 @@ calc_row_difference( doc_id_t doc_id = FTS_NULL_DOC_ID; ulint num_v = 0; - ut_ad(!srv_read_only_mode || dict_table_is_intrinsic(prebuilt->table)); + ut_ad(!srv_read_only_mode); n_fields = table->s->fields; clust_index = dict_table_get_first_index(prebuilt->table); @@ -9812,7 +9662,7 @@ ha_innobase::update_row( ut_a(m_prebuilt->trx == trx); - if (high_level_read_only && !dict_table_is_intrinsic(m_prebuilt->table)) { + if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (!trx_is_started(trx)) { @@ -9862,8 +9712,7 @@ ha_innobase::update_row( goto func_exit; } - if (!dict_table_is_intrinsic(m_prebuilt->table) - && TrxInInnoDB::is_aborted(trx)) { + if (TrxInInnoDB::is_aborted(trx)) { innobase_rollback(ht, m_user_thd, false); @@ -9977,8 +9826,7 @@ ha_innobase::delete_row( DBUG_ENTER("ha_innobase::delete_row"); - if (!dict_table_is_intrinsic(m_prebuilt->table) - && trx_in_innodb.is_aborted()) { + if (trx_in_innodb.is_aborted()) { innobase_rollback(ht, m_user_thd, false); @@ -9988,7 +9836,7 @@ ha_innobase::delete_row( ut_a(m_prebuilt->trx == trx); - if (high_level_read_only && !dict_table_is_intrinsic(m_prebuilt->table)) { + if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (!trx_is_started(trx)) { @@ -10038,28 +9886,7 @@ int ha_innobase::delete_all_rows() { DBUG_ENTER("ha_innobase::delete_all_rows"); - - /* Currently enabled only for intrinsic tables. */ - if (!dict_table_is_intrinsic(m_prebuilt->table)) { - DBUG_RETURN(HA_ERR_WRONG_COMMAND); - } - - TrxInInnoDB trx_in_innodb(m_prebuilt->trx); - - if (!dict_table_is_intrinsic(m_prebuilt->table) - && trx_in_innodb.is_aborted()) { - - DBUG_RETURN(innobase_rollback(ht, m_user_thd, false)); - } - - dberr_t error = row_delete_all_rows(m_prebuilt->table); - - if (error == DB_SUCCESS) { - dict_stats_update(m_prebuilt->table, DICT_STATS_EMPTY_TABLE); - } - - DBUG_RETURN(convert_error_code_to_mysql( - error, m_prebuilt->table->flags, m_user_thd)); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } /**********************************************************************//** @@ -10073,11 +9900,7 @@ ha_innobase::unlock_row(void) { DBUG_ENTER("ha_innobase::unlock_row"); - /* Consistent read does not take any locks, thus there is - nothing to unlock. There is no locking for intrinsic table. */ - - if (m_prebuilt->select_lock_type == LOCK_NONE - || dict_table_is_intrinsic(m_prebuilt->table)) { + if (m_prebuilt->select_lock_type == LOCK_NONE) { DBUG_VOID_RETURN; } @@ -10087,8 +9910,6 @@ ha_innobase::unlock_row(void) DBUG_VOID_RETURN; } - ut_ad(!dict_table_is_intrinsic(m_prebuilt->table)); - /* Ideally, this assert must be in the beginning of the function. But there are some calls to this function from the SQL layer when the transaction is in state TRX_STATE_NOT_STARTED. The check on @@ -10176,8 +9997,6 @@ ha_innobase::index_end(void) { DBUG_ENTER("index_end"); - m_prebuilt->index->last_sel_cur->release(); - active_index = MAX_KEY; in_range_check_pushed_down = FALSE; @@ -10379,29 +10198,17 @@ ha_innobase::index_read( innobase_srv_conc_enter_innodb(m_prebuilt); - if (!dict_table_is_intrinsic(m_prebuilt->table)) { + if (TrxInInnoDB::is_aborted(m_prebuilt->trx)) { - if (TrxInInnoDB::is_aborted(m_prebuilt->trx)) { + innobase_rollback(ht, m_user_thd, false); - innobase_rollback(ht, m_user_thd, false); - - DBUG_RETURN(convert_error_code_to_mysql( - DB_FORCED_ABORT, 0, m_user_thd)); - } - - m_prebuilt->ins_sel_stmt = thd_is_ins_sel_stmt( - m_user_thd); - - ret = row_search_mvcc( - buf, mode, m_prebuilt, match_mode, 0); - - } else { - m_prebuilt->session = thd_to_innodb_session(m_user_thd); - - ret = row_search_no_mvcc( - buf, mode, m_prebuilt, match_mode, 0); + DBUG_RETURN(convert_error_code_to_mysql( + DB_FORCED_ABORT, 0, m_user_thd)); } + ret = row_search_mvcc( + buf, mode, m_prebuilt, match_mode, 0); + innobase_srv_conc_exit_innodb(m_prebuilt); } else { @@ -10581,8 +10388,7 @@ ha_innobase::change_active_index( TrxInInnoDB trx_in_innodb(m_prebuilt->trx); - if (!dict_table_is_intrinsic(m_prebuilt->table) - && trx_in_innodb.is_aborted()) { + if (trx_in_innodb.is_aborted()) { innobase_rollback(ht, m_user_thd, false); @@ -10709,9 +10515,7 @@ ha_innobase::general_fetch( ut_ad(trx == thd_to_trx(m_user_thd)); - bool intrinsic = dict_table_is_intrinsic(m_prebuilt->table); - - if (!intrinsic && TrxInInnoDB::is_aborted(trx)) { + if (TrxInInnoDB::is_aborted(trx)) { innobase_rollback(ht, m_user_thd, false); @@ -10721,17 +10525,8 @@ ha_innobase::general_fetch( innobase_srv_conc_enter_innodb(m_prebuilt); - if (!intrinsic) { - - ret = row_search_mvcc( - buf, PAGE_CUR_UNSUPP, m_prebuilt, match_mode, - direction); - - } else { - ret = row_search_no_mvcc( - buf, PAGE_CUR_UNSUPP, m_prebuilt, match_mode, - direction); - } + ret = row_search_mvcc( + buf, PAGE_CUR_UNSUPP, m_prebuilt, match_mode, direction); innobase_srv_conc_exit_innodb(m_prebuilt); @@ -10885,8 +10680,7 @@ ha_innobase::rnd_init( { TrxInInnoDB trx_in_innodb(m_prebuilt->trx); - if (!dict_table_is_intrinsic(m_prebuilt->table) - && trx_in_innodb.is_aborted()) { + if (trx_in_innodb.is_aborted()) { return(innobase_rollback(ht, m_user_thd, false)); } @@ -12136,25 +11930,6 @@ create_table_info_t::create_table_def() continue; } - /* Generate a unique column name by pre-pending table-name for - intrinsic tables. For other tables (including normal - temporary) column names are unique. If not, MySQL layer will - block such statement. - This is work-around fix till Optimizer can handle this issue - (probably 5.7.4+). */ - char field_name[MAX_FULL_NAME_LEN + 2 + 10]; - - if (dict_table_is_intrinsic(table) && field->orig_table) { - - ut_snprintf(field_name, sizeof(field_name), - "%s_%s_%lu", field->orig_table->alias.c_ptr(), - field->field_name, i); - - } else { - ut_snprintf(field_name, sizeof(field_name), - "%s", field->field_name); - } - col_type = get_innobase_type_from_mysql_type( &unsigned_type, field); @@ -12230,9 +12005,9 @@ create_table_info_t::create_table_def() /* First check whether the column to be added has a system reserved name. */ - if (dict_col_name_is_reserved(field_name)){ + if (dict_col_name_is_reserved(field->field_name)){ my_error(ER_WRONG_COLUMN_NAME, MYF(0), - field_name); + field->field_name); err_col: dict_mem_table_free(table); mem_heap_free(heap); @@ -12244,7 +12019,7 @@ err_col: if (!is_virtual) { dict_mem_table_add_col(table, heap, - field_name, col_type, + field->field_name, col_type, dtype_form_prtype( (ulint) field->type() | nulls_allowed | unsigned_type @@ -12254,7 +12029,7 @@ err_col: } else { #ifdef MYSQL_VIRTUAL_COLUMNS dict_mem_table_add_v_col(table, heap, - field_name, col_type, + field->field_name, col_type, dtype_form_prtype( (ulint) field->type() | nulls_allowed | unsigned_type @@ -12370,18 +12145,8 @@ err_col: temp_table_heap = mem_heap_create(256); - /* For intrinsic table (given that they are - not shared beyond session scope), add - it to session specific THD structure - instead of adding it to dictionary cache. */ - if (dict_table_is_intrinsic(table)) { - add_table_to_thread_cache( - table, temp_table_heap, m_thd); - - } else { - dict_table_add_to_cache( - table, FALSE, temp_table_heap); - } + dict_table_add_to_cache( + table, FALSE, temp_table_heap); DBUG_EXECUTE_IF("ib_ddl_crash_during_create2", DBUG_SUICIDE();); @@ -12564,7 +12329,7 @@ create_index( DBUG_RETURN(convert_error_code_to_mysql( row_create_index_for_mysql( - index, trx, NULL, NULL), + index, trx, NULL), flags, NULL)); } @@ -12595,26 +12360,6 @@ create_index( index = dict_mem_index_create(table_name, key->name, 0, ind_type, key->user_defined_key_parts); - innodb_session_t*& priv = thd_to_innodb_session(trx->mysql_thd); - dict_table_t* handler = priv->lookup_table_handler(table_name); - - if (handler != NULL) { - /* This setting will enforce SQL NULL == SQL NULL. - For now this is turned-on for intrinsic tables - only but can be turned on for other tables if needed arises. */ - index->nulls_equal = - (key->flags & HA_NULL_ARE_EQUAL) ? true : false; - - /* Disable use of AHI for intrinsic table indexes as AHI - validates the predicated entry using index-id which has to be - system-wide unique that is not the case with indexes of - intrinsic table for performance reason. - Also given the lifetime of these tables and frequent delete - and update AHI would not help on performance front as it does - with normal tables. */ - index->disable_ahi = true; - } - for (ulint i = 0; i < key->user_defined_key_parts; i++) { KEY_PART_INFO* key_part = key->key_part + i; ulint prefix_len; @@ -12638,13 +12383,6 @@ create_index( ut_error; const char* field_name = key_part->field->field_name; - if (handler != NULL && dict_table_is_intrinsic(handler)) { - - ut_ad(!innobase_is_v_fld(key_part->field)); - ulint col_no = dict_col_get_no(dict_table_get_nth_col( - handler, key_part->field->field_index)); - field_name = dict_table_get_col_name(handler, col_no); - } col_type = get_innobase_type_from_mysql_type( &is_unsigned, key_part->field); @@ -12694,13 +12432,9 @@ create_index( sure we don't create too long indexes. */ error = convert_error_code_to_mysql( - row_create_index_for_mysql(index, trx, field_lengths, handler), + row_create_index_for_mysql(index, trx, field_lengths), flags, NULL); - if (error && handler != NULL) { - priv->unregister_table_handler(table_name); - } - my_free(field_lengths); DBUG_RETURN(error); @@ -12726,26 +12460,7 @@ create_clustered_index_when_no_primary( innobase_index_reserve_name, 0, DICT_CLUSTERED, 0); - innodb_session_t*& priv = thd_to_innodb_session(trx->mysql_thd); - - dict_table_t* handler = priv->lookup_table_handler(table_name); - - if (handler != NULL) { - /* Disable use of AHI for intrinsic table indexes as AHI - validates the predicated entry using index-id which has to be - system-wide unique that is not the case with indexes of - intrinsic table for performance reason. - Also given the lifetime of these tables and frequent delete - and update AHI would not help on performance front as it does - with normal tables. */ - index->disable_ahi = true; - } - - error = row_create_index_for_mysql(index, trx, NULL, handler); - - if (error != DB_SUCCESS && handler != NULL) { - priv->unregister_table_handler(table_name); - } + error = row_create_index_for_mysql(index, trx, NULL); return(convert_error_code_to_mysql(error, flags, NULL)); } @@ -13862,22 +13577,6 @@ index_bad: if (m_create_info->options & HA_LEX_CREATE_TMP_TABLE) { m_flags2 |= DICT_TF2_TEMPORARY; - /* Intrinsic tables reside only in the shared temporary - tablespace and we will always use ROW_FORMAT=DYNAMIC. */ - -#ifdef MYSQL_COMPRESSION - if ((m_create_info->options & HA_LEX_CREATE_INTERNAL_TMP_TABLE) - && !m_use_file_per_table) { - - /* We do not allow compressed instrinsic - temporary tables. */ - - ut_ad(zip_ssize == 0); - m_flags2 |= DICT_TF2_INTRINSIC; - innodb_row_format = REC_FORMAT_DYNAMIC; - } -#endif - } /* Set the table flags */ @@ -14188,7 +13887,7 @@ create_table_info_t::prepare_create_table( DBUG_RETURN(HA_WRONG_CREATE_OPTION); } - if (high_level_read_only && !is_intrinsic_temp_table()) { + if (high_level_read_only) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -14332,17 +14031,7 @@ create_table_info_t::create_table() stmt = innobase_get_stmt_unsafe(m_thd, &stmt_len); - innodb_session_t*& priv = - thd_to_innodb_session(m_trx->mysql_thd); - dict_table_t* handler = - priv->lookup_table_handler(m_table_name); - - ut_ad(handler == NULL - || (handler != NULL && dict_table_is_intrinsic(handler))); - - /* There is no concept of foreign key for intrinsic tables. */ - if (stmt && (handler == NULL)) { - + if (stmt) { dberr_t err = row_table_add_foreign_constraints( m_trx, stmt, stmt_len, m_table_name, m_create_info->options & HA_LEX_CREATE_TMP_TABLE); @@ -14388,23 +14077,15 @@ create_table_info_t::create_table() error = convert_error_code_to_mysql(err, m_flags, NULL); if (error) { - if (handler != NULL) { - priv->unregister_table_handler(m_table_name); - } DBUG_RETURN(error); } } - if (!is_intrinsic_temp_table()) { - innobase_table = dict_table_open_on_name( - m_table_name, TRUE, FALSE, DICT_ERR_IGNORE_NONE); + innobase_table = dict_table_open_on_name( + m_table_name, TRUE, FALSE, DICT_ERR_IGNORE_NONE); - if (innobase_table != NULL) { - dict_table_close(innobase_table, TRUE, FALSE); - } - - } else { - innobase_table = NULL; + if (innobase_table != NULL) { + dict_table_close(innobase_table, TRUE, FALSE); } DBUG_RETURN(0); @@ -14419,17 +14100,8 @@ create_table_info_t::create_table_update_dict() DBUG_ENTER("create_table_update_dict"); - innobase_table = thd_to_innodb_session(m_thd)->lookup_table_handler( - m_table_name); - - - if (innobase_table == NULL) { - innobase_table = dict_table_open_on_name( - m_table_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE); - } else { - innobase_table->acquire(); - ut_ad(dict_table_is_intrinsic(innobase_table)); - } + innobase_table = dict_table_open_on_name( + m_table_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE); DBUG_ASSERT(innobase_table != 0); if (innobase_table->fts != NULL) { @@ -14563,13 +14235,8 @@ ha_innobase::create( /* Latch the InnoDB data dictionary exclusively so that no deadlocks or lock waits can happen in it during a table create operation. - Drop table etc. do this latching in row0mysql.cc. - Avoid locking dictionary if table is intrinsic. - Table Object for such table is cached in THD instead of storing it - to dictionary. */ - if (!info.is_intrinsic_temp_table()) { - row_mysql_lock_data_dictionary(trx); - } + Drop table etc. do this latching in row0mysql.cc. */ + row_mysql_lock_data_dictionary(trx); if ((error = info.create_table())) { goto cleanup; @@ -14577,14 +14244,12 @@ ha_innobase::create( innobase_commit_low(trx); - if (!info.is_intrinsic_temp_table()) { - ut_ad(!srv_read_only_mode); - row_mysql_unlock_data_dictionary(trx); - /* Flush the log to reduce probability that the .frm files and - the InnoDB data dictionary get out-of-sync if the user runs - with innodb_flush_log_at_trx_commit = 0 */ - log_buffer_flush_to_disk(); - } + ut_ad(!srv_read_only_mode); + row_mysql_unlock_data_dictionary(trx); + /* Flush the log to reduce probability that the .frm files and + the InnoDB data dictionary get out-of-sync if the user runs + with innodb_flush_log_at_trx_commit = 0 */ + log_buffer_flush_to_disk(); error = info.create_table_update_dict(); @@ -14599,38 +14264,7 @@ ha_innobase::create( cleanup: trx_rollback_for_mysql(trx); - - if (!info.is_intrinsic_temp_table()) { - row_mysql_unlock_data_dictionary(trx); - } else { - THD* thd = info.thd(); - - dict_table_t* intrinsic_table = - thd_to_innodb_session(thd)->lookup_table_handler( - info.table_name()); - - if (intrinsic_table != NULL) { - thd_to_innodb_session(thd)->unregister_table_handler( - info.table_name()); - - for (;;) { - dict_index_t* index; - index = UT_LIST_GET_FIRST( - intrinsic_table->indexes); - if (index == NULL) { - break; - } - rw_lock_free(&index->lock); - UT_LIST_REMOVE(intrinsic_table->indexes, index); - dict_mem_index_free(index); - index = NULL; - } - - dict_mem_table_free(intrinsic_table); - intrinsic_table = NULL; - } - } - + row_mysql_unlock_data_dictionary(trx); trx_free_for_mysql(trx); DBUG_RETURN(error); @@ -14785,11 +14419,6 @@ ha_innobase::truncate() { DBUG_ENTER("ha_innobase::truncate"); - /* Truncate of intrinsic table is not allowed truncate for now. */ - if (dict_table_is_intrinsic(m_prebuilt->table)) { - DBUG_RETURN(HA_ERR_WRONG_COMMAND); - } - if (high_level_read_only) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -14868,17 +14497,7 @@ ha_innobase::delete_table( extension, in contrast to ::create */ normalize_table_name(norm_name, name); - innodb_session_t*& priv = thd_to_innodb_session(thd); - dict_table_t* handler = priv->lookup_table_handler(norm_name); - - if (handler != NULL) { - for (dict_index_t* index = UT_LIST_GET_FIRST(handler->indexes); - index != NULL; - index = UT_LIST_GET_NEXT(indexes, index)) { - index->last_ins_cur->release(); - index->last_sel_cur->release(); - } - } else if (srv_read_only_mode) { + if (srv_read_only_mode) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -14924,7 +14543,7 @@ ha_innobase::delete_table( err = row_drop_table_for_mysql( norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB, - false, handler); + false); if (err == DB_TABLE_NOT_FOUND && innobase_get_lower_case_table_names() == 1) { @@ -15024,20 +14643,16 @@ ha_innobase::delete_table( err = row_drop_table_for_mysql( par_case_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB, - true, handler); + true); } } - if (handler == NULL) { - ut_ad(!srv_read_only_mode); - /* Flush the log to reduce probability that the .frm files and - the InnoDB data dictionary get out-of-sync if the user runs - with innodb_flush_log_at_trx_commit = 0 */ + ut_ad(!srv_read_only_mode); + /* Flush the log to reduce probability that the .frm files and + the InnoDB data dictionary get out-of-sync if the user runs + with innodb_flush_log_at_trx_commit = 0 */ - log_buffer_flush_to_disk(); - } else if (err == DB_SUCCESS) { - priv->unregister_table_handler(norm_name); - } + log_buffer_flush_to_disk(); innobase_commit_low(trx); @@ -16656,9 +16271,8 @@ ha_innobase::info_low( nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ if (os_file_get_status( - path, &stat_info, false, - (dict_table_is_intrinsic(ib_table) - ? false : srv_read_only_mode)) == DB_SUCCESS) { + path, &stat_info, false, + srv_read_only_mode) == DB_SUCCESS) { stats.create_time = (ulong) stat_info.ctime; } } @@ -16721,72 +16335,6 @@ ha_innobase::info( return(info_low(flag, false /* not ANALYZE */)); } -/** Enable indexes. -@param[in] mode enable index mode. -@return HA_ERR_* error code or 0 */ -int -ha_innobase::enable_indexes( - uint mode) -{ - int error = HA_ERR_WRONG_COMMAND; - - /* Enable index only for intrinsic table. Behavior for all other - table continue to remain same. */ - - if (dict_table_is_intrinsic(m_prebuilt->table)) { - ut_ad(mode == HA_KEY_SWITCH_ALL); - for (dict_index_t* index - = UT_LIST_GET_FIRST(m_prebuilt->table->indexes); - index != NULL; - index = UT_LIST_GET_NEXT(indexes, index)) { - - /* InnoDB being clustered index we can't disable/enable - clustered index itself. */ - if (dict_index_is_clust(index)) { - continue; - } - - index->allow_duplicates = false; - } - error = 0; - } - - return(error); -} - -/** Disable indexes. -@param[in] mode disable index mode. -@return HA_ERR_* error code or 0 */ -int -ha_innobase::disable_indexes( - uint mode) -{ - int error = HA_ERR_WRONG_COMMAND; - - /* Disable index only for intrinsic table. Behavior for all other - table continue to remain same. */ - - if (dict_table_is_intrinsic(m_prebuilt->table)) { - ut_ad(mode == HA_KEY_SWITCH_ALL); - for (dict_index_t* index - = UT_LIST_GET_FIRST(m_prebuilt->table->indexes); - index != NULL; - index = UT_LIST_GET_NEXT(indexes, index)) { - - /* InnoDB being clustered index we can't disable/enable - clustered index itself. */ - if (dict_index_is_clust(index)) { - continue; - } - - index->allow_duplicates = true; - } - error = 0; - } - - return(error); -} - /* Updates index cardinalities of the table, based on random dives into each index tree. This does NOT calculate exact statistics on the table. @@ -17910,16 +17458,6 @@ ha_innobase::start_stmt( TrxInInnoDB trx_in_innodb(trx); - if (dict_table_is_intrinsic(m_prebuilt->table)) { - - if (thd_sql_command(thd) == SQLCOM_ALTER_TABLE) { - - DBUG_RETURN(HA_ERR_WRONG_COMMAND); - } - - DBUG_RETURN(0); - } - trx = m_prebuilt->trx; innobase_srv_conc_force_exit_innodb(trx); @@ -18049,18 +17587,6 @@ ha_innobase::external_lock( ut_ad(m_prebuilt->table); - if (dict_table_is_intrinsic(m_prebuilt->table)) { - - if (thd_sql_command(thd) == SQLCOM_ALTER_TABLE) { - - DBUG_RETURN(HA_ERR_WRONG_COMMAND); - } - - TrxInInnoDB::begin_stmt(trx); - - DBUG_RETURN(0); - } - /* Statement based binlogging does not work in isolation level READ UNCOMMITTED and READ COMMITTED since the necessary locks cannot be taken. In this case, we print an @@ -18983,7 +18509,6 @@ ha_innobase::store_lock( const uint sql_command = thd_sql_command(thd); if (srv_read_only_mode - && !dict_table_is_intrinsic(m_prebuilt->table) && (sql_command == SQLCOM_UPDATE || sql_command == SQLCOM_INSERT || sql_command == SQLCOM_REPLACE diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 84feea119c1..1c71735d716 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -203,9 +203,6 @@ public: int ft_read(uchar* buf); - int enable_indexes(uint mode); - int disable_indexes(uint mode); - void position(const uchar *record); int info(uint); @@ -468,9 +465,6 @@ protected: @see build_template() */ void reset_template(); - /** Write Row Interface optimized for Intrinsic table. */ - int intrinsic_table_write_row(uchar* record); - protected: inline void update_thd(THD* thd); void update_thd(); @@ -833,14 +827,6 @@ public: THD* thd() const { return(m_thd); } - inline bool is_intrinsic_temp_table() const - { - /* DICT_TF2_INTRINSIC implies DICT_TF2_TEMPORARY */ - ut_ad(!(m_flags2 & DICT_TF2_INTRINSIC) - || (m_flags2 & DICT_TF2_TEMPORARY)); - return((m_flags2 & DICT_TF2_INTRINSIC) != 0); - } - /** Normalizes a table name string. A normalized name consists of the database name catenated to '/' and table name. An example: test/mytable. On Windows normalization puts diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index f582f04733c..e445331b60c 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -192,37 +192,6 @@ btr_cur_search_to_nth_level( ulint line, /*!< in: line where called */ mtr_t* mtr); /*!< in: mtr */ -/** Searches an index tree and positions a tree cursor on a given level. -This function will avoid placing latches the travesal path and so -should be used only for cases where-in latching is not needed. - -@param[in] index index -@param[in] level the tree level of search -@param[in] tuple data tuple; Note: n_fields_cmp in compared - to the node ptr page node field -@param[in] mode PAGE_CUR_L, .... - Insert should always be made using PAGE_CUR_LE - to search the position. -@param[in,out] cursor tree cursor; points to record of interest. -@param[in] file file name -@param[in[ line line where called from -@param[in,out] mtr mtr -@param[in] mark_dirty - if true then mark the block as dirty -@return DB_SUCCESS or error code */ -dberr_t -btr_cur_search_to_nth_level_with_no_latch( - dict_index_t* index, - ulint level, - const dtuple_t* tuple, - page_cur_mode_t mode, - btr_cur_t* cursor, - const char* file, - ulint line, - mtr_t* mtr, - bool mark_dirty = true) - __attribute__((warn_unused_result)); - /*****************************************************************//** Opens a cursor at either end of an index. @return DB_SUCCESS or error code */ @@ -244,35 +213,6 @@ btr_cur_open_at_index_side_func( #define btr_cur_open_at_index_side(f,i,l,c,lv,m) \ btr_cur_open_at_index_side_func(f,i,l,c,lv,__FILE__,__LINE__,m) -/** Opens a cursor at either end of an index. -Avoid taking latches on buffer, just pin (by incrementing fix_count) -to keep them in buffer pool. This mode is used by intrinsic table -as they are not shared and so there is no need of latching. -@param[in] from_left true if open to low end, false if open - to high end. -@param[in] index index -@param[in] latch_mode latch mode -@param[in,out] cursor cursor -@param[in] file file name -@param[in] line line where called -@param[in,out] mtr mini transaction -@return DB_SUCCESS or error code -*/ -dberr_t -btr_cur_open_at_index_side_with_no_latch_func( - bool from_left, - dict_index_t* index, - btr_cur_t* cursor, - ulint level, - const char* file, - ulint line, - mtr_t* mtr) - __attribute__((warn_unused_result)); - -#define btr_cur_open_at_index_side_with_no_latch(f,i,c,lv,m) \ - btr_cur_open_at_index_side_with_no_latch_func( \ - f,i,c,lv,__FILE__,__LINE__,m) - /**********************************************************************//** Positions a cursor at a randomly chosen position within a B-tree. @return true if the index is available and we have put the cursor, false diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 6cd968b4682..e7ae85dd730 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -452,20 +452,9 @@ btr_pcur_open_low( ut_ad(!dict_index_is_spatial(index)); - if (dict_table_is_intrinsic(index->table)) { - ut_ad((latch_mode & BTR_MODIFY_LEAF) - || (latch_mode & BTR_SEARCH_LEAF) - || (latch_mode & BTR_MODIFY_TREE)); - err = btr_cur_search_to_nth_level_with_no_latch( - index, level, tuple, mode, btr_cursor, - file, line, mtr, - (((latch_mode & BTR_MODIFY_LEAF) - || (latch_mode & BTR_MODIFY_TREE)) ? true : false)); - } else { - err = btr_cur_search_to_nth_level( - index, level, tuple, mode, latch_mode, - btr_cursor, 0, file, line, mtr); - } + err = btr_cur_search_to_nth_level( + index, level, tuple, mode, latch_mode, + btr_cursor, 0, file, line, mtr); if (err != DB_SUCCESS) { ib::warn() << " Error code: " << err @@ -521,18 +510,9 @@ btr_pcur_open_with_no_init_func( btr_cursor = btr_pcur_get_btr_cur(cursor); - if (dict_table_is_intrinsic(index->table)) { - ut_ad((latch_mode & BTR_MODIFY_LEAF) - || (latch_mode & BTR_SEARCH_LEAF)); - err = btr_cur_search_to_nth_level_with_no_latch( - index, 0, tuple, mode, btr_cursor, - file, line, mtr, - ((latch_mode & BTR_MODIFY_LEAF) ? true : false)); - } else { - err = btr_cur_search_to_nth_level( - index, 0, tuple, mode, latch_mode, btr_cursor, - has_search_latch, file, line, mtr); - } + err = btr_cur_search_to_nth_level( + index, 0, tuple, mode, latch_mode, btr_cursor, + has_search_latch, file, line, mtr); cursor->pos_state = BTR_PCUR_IS_POSITIONED; @@ -568,15 +548,9 @@ btr_pcur_open_at_index_side( btr_pcur_init(pcur); } - if (dict_table_is_intrinsic(index->table)) { - err = btr_cur_open_at_index_side_with_no_latch( - from_left, index, - btr_pcur_get_btr_cur(pcur), level, mtr); - } else { - err = btr_cur_open_at_index_side( - from_left, index, latch_mode, - btr_pcur_get_btr_cur(pcur), level, mtr); - } + err = btr_cur_open_at_index_side( + from_left, index, latch_mode, + btr_pcur_get_btr_cur(pcur), level, mtr); pcur->pos_state = BTR_PCUR_IS_POSITIONED; pcur->old_stored = false; diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index c4bc107044d..617bb2b9b5d 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -570,9 +570,6 @@ BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or BUF_GET_IF_IN_POOL_OR_WATCH @param[in] line line where called @param[in] mtr mini-transaction @param[out] err DB_SUCCESS or error code -@param[in] dirty_with_no_latch - mark page as dirty even if page - is being pinned without any latch @return pointer to the block or NULL */ buf_block_t* buf_page_get_gen( @@ -584,8 +581,7 @@ buf_page_get_gen( const char* file, ulint line, mtr_t* mtr, - dberr_t* err, - bool dirty_with_no_latch = false); + dberr_t* err); /** Initializes a page to the buffer buf_pool. The page is usually not read from a file even if it cannot be found in the buffer buf_pool. This is one @@ -1901,12 +1897,6 @@ struct buf_block_t{ complete, though: there may have been hash collisions, record deletions, etc. */ - bool made_dirty_with_no_latch; - /*!< true if block has been made dirty - without acquiring X/SX latch as the - block belongs to temporary tablespace - and block is always accessed by a - single thread. */ bool skip_flush_check; /*!< Skip check in buf_dblwr_check_block during bulk load, protected by lock.*/ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 6d602120e70..9ff2a1bfab5 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -926,7 +926,7 @@ buf_block_modify_clock_inc( #ifdef UNIV_DEBUG buf_pool_t* buf_pool = buf_pool_from_bpage((buf_page_t*) block); - /* No latch is acquired if block belongs to intrinsic table. */ + /* No latch is acquired for the shared temporary tablespace. */ if (!fsp_is_system_temporary(block->page.id.space())) { ut_ad((buf_pool_mutex_own(buf_pool) && (block->page.buf_fix_count == 0)) @@ -949,7 +949,7 @@ buf_block_get_modify_clock( buf_block_t* block) /*!< in: block */ { #ifdef UNIV_DEBUG - /* No latch is acquired if block belongs to intrinsic table. */ + /* No latch is acquired for the shared temporary tablespace. */ if (!fsp_is_system_temporary(block->page.id.space())) { ut_ad(rw_lock_own(&(block->lock), RW_LOCK_S) || rw_lock_own(&(block->lock), RW_LOCK_X) diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 00073dfca2c..27310963ec5 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -166,10 +166,6 @@ be less than 256 */ #define DATA_N_SYS_COLS 3 /* number of system columns defined above */ -#define DATA_ITT_N_SYS_COLS 2 - /* number of system columns for intrinsic - temporary table */ - #define DATA_FTS_DOC_ID 3 /* Used as FTS DOC ID column */ #define DATA_SYS_PRTYPE_MASK 0xF /* mask to extract the above from prtype */ @@ -196,6 +192,11 @@ be less than 256 */ for shorter VARCHARs MySQL uses only 1 byte */ #define DATA_VIRTUAL 8192 /* Virtual column */ +/** Get the number of system columns in a table. */ +#define dict_table_get_n_sys_cols(table) DATA_N_SYS_COLS +/** Check whether locking is disabled (never). */ +#define dict_table_is_locking_disabled(table) false + /*-------------------------------------------*/ /* This many bytes we need to store the type information affecting the diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index ccef08ff73f..e7eb558d6fd 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -843,17 +843,6 @@ ulint dict_table_get_n_tot_u_cols( const dict_table_t* table); /********************************************************************//** -Gets the number of system columns in a table. -For intrinsic table on ROW_ID column is added for all other -tables TRX_ID and ROLL_PTR are all also appeneded. -@return number of system (e.g., ROW_ID) columns of a table */ -UNIV_INLINE -ulint -dict_table_get_n_sys_cols( -/*======================*/ - const dict_table_t* table) /*!< in: table */ - MY_ATTRIBUTE((warn_unused_result)); -/********************************************************************//** Gets the number of all non-virtual columns (also system) in a table in the dictionary cache. @return number of columns of a table */ @@ -2016,24 +2005,6 @@ dict_table_is_encrypted( const dict_table_t* table) /*!< in: table to check */ MY_ATTRIBUTE((warn_unused_result)); -/** Check whether the table is intrinsic. -An intrinsic table is a special kind of temporary table that -is invisible to the end user. It is created internally by the MySQL server -layer or other module connected to InnoDB in order to gather and use data -as part of a larger task. Since access to it must be as fast as possible, -it does not need UNDO semantics, system fields DB_TRX_ID & DB_ROLL_PTR, -doublewrite, checksum, insert buffer, use of the shared data dictionary, -locking, or even a transaction. In short, these are not ACID tables at all, -just temporary - -@param[in] table table to check -@return true if intrinsic table flag is set. */ -UNIV_INLINE -bool -dict_table_is_intrinsic( - const dict_table_t* table) - MY_ATTRIBUTE((warn_unused_result)); - /** Check if the table is in a shared tablespace (System or General). @param[in] id Space ID to check @return true if id is a shared tablespace, false if not. */ @@ -2043,18 +2014,6 @@ dict_table_in_shared_tablespace( const dict_table_t* table) MY_ATTRIBUTE((warn_unused_result)); -/** Check whether locking is disabled for this table. -Currently this is done for intrinsic table as their visibility is limited -to the connection only. - -@param[in] table table to check -@return true if locking is disabled. */ -UNIV_INLINE -bool -dict_table_is_locking_disabled( - const dict_table_t* table) - MY_ATTRIBUTE((warn_unused_result)); - /********************************************************************//** Turn-off redo-logging if temporary table. */ UNIV_INLINE @@ -2064,30 +2023,6 @@ dict_disable_redo_if_temporary( const dict_table_t* table, /*!< in: table to check */ mtr_t* mtr); /*!< out: mini-transaction */ -/** Get table session row-id and increment the row-id counter for next use. -@param[in,out] table table handler -@return next table local row-id. */ -UNIV_INLINE -row_id_t -dict_table_get_next_table_sess_row_id( - dict_table_t* table); - -/** Get table session trx-id and increment the trx-id counter for next use. -@param[in,out] table table handler -@return next table local trx-id. */ -UNIV_INLINE -trx_id_t -dict_table_get_next_table_sess_trx_id( - dict_table_t* table); - -/** Get current session trx-id. -@param[in] table table handler -@return table local trx-id. */ -UNIV_INLINE -trx_id_t -dict_table_get_curr_table_sess_trx_id( - const dict_table_t* table); - #ifndef UNIV_HOTBACKUP /*********************************************************************//** This function should be called whenever a page is successfully diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 8165263c95c..5e5fbae9081 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -447,23 +447,6 @@ dict_table_get_n_tot_u_cols( return(dict_table_get_n_user_cols(table) + dict_table_get_n_v_cols(table)); } -/********************************************************************//** -Gets the number of system columns in a table. -For intrinsic table on ROW_ID column is added for all other -tables TRX_ID and ROLL_PTR are all also appeneded. -@return number of system (e.g., ROW_ID) columns of a table */ -UNIV_INLINE -ulint -dict_table_get_n_sys_cols( -/*======================*/ - const dict_table_t* table MY_ATTRIBUTE((unused))) /*!< in: table */ -{ - ut_ad(table); - ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - - return(dict_table_is_intrinsic(table) - ? DATA_ITT_N_SYS_COLS : DATA_N_SYS_COLS); -} /********************************************************************//** Gets the number of all non-virtual columns (also system) in a table @@ -1816,26 +1799,6 @@ dict_table_is_encrypted( return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_ENCRYPTION)); } -/** Check whether the table is intrinsic. -An intrinsic table is a special kind of temporary table that -is invisible to the end user. It can be created internally by InnoDB, the MySQL -server layer or other modules connected to InnoDB in order to gather and use -data as part of a larger task. Since access to it must be as fast as possible, -it does not need UNDO semantics, system fields DB_TRX_ID & DB_ROLL_PTR, -doublewrite, checksum, insert buffer, use of the shared data dictionary, -locking, or even a transaction. In short, these are not ACID tables at all, -just temporary data stored and manipulated during a larger process. - -@param[in] table table to check -@return true if intrinsic table flag is set. */ -UNIV_INLINE -bool -dict_table_is_intrinsic( - const dict_table_t* table) -{ - return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_INTRINSIC)); -} - /** Check if the table is in a shared tablespace (System or General). @param[in] id Space ID to check @return true if id is a shared tablespace, false if not. */ @@ -1848,20 +1811,6 @@ dict_table_in_shared_tablespace( || DICT_TF_HAS_SHARED_SPACE(table->flags)); } -/** Check whether locking is disabled for this table. -Currently this is done for intrinsic table as their visibility is limited -to the connection only. - -@param[in] table table to check -@return true if locking is disabled. */ -UNIV_INLINE -bool -dict_table_is_locking_disabled( - const dict_table_t* table) -{ - return(dict_table_is_intrinsic(table)); -} - /********************************************************************//** Turn-off redo-logging if temporary table. */ UNIV_INLINE @@ -1946,46 +1895,13 @@ dict_table_get_index_on_first_col( return(0); } -/** Get table session row-id and increment the row-id counter for next use. -@param[in,out] table table handler -@return next table session row-id. */ -UNIV_INLINE -row_id_t -dict_table_get_next_table_sess_row_id( - dict_table_t* table) -{ - return(++table->sess_row_id); -} - -/** Get table session trx-id and increment the trx-id counter for next use. -@param[in,out] table table handler -@return next table session trx-id. */ -UNIV_INLINE -trx_id_t -dict_table_get_next_table_sess_trx_id( - dict_table_t* table) -{ - return(++table->sess_trx_id); -} - -/** Get current session trx-id. -@param[in] table table handler -@return table session trx-id. */ -UNIV_INLINE -trx_id_t -dict_table_get_curr_table_sess_trx_id( - const dict_table_t* table) -{ - return(table->sess_trx_id); -} - /** Get reference count. @return current value of n_ref_count */ inline ulint dict_table_t::get_ref_count() const { - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this)); + ut_ad(mutex_own(&dict_sys->mutex)); return(n_ref_count); } @@ -1994,7 +1910,7 @@ inline void dict_table_t::acquire() { - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this)); + ut_ad(mutex_own(&dict_sys->mutex)); ++n_ref_count; } @@ -2003,7 +1919,7 @@ inline void dict_table_t::release() { - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(n_ref_count > 0); --n_ref_count; } diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 4ee19f96008..019e20680e5 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -337,12 +337,6 @@ use its own tablespace instead of the system tablespace. */ index tables) of a FTS table are in HEX format. */ #define DICT_TF2_FTS_AUX_HEX_NAME 64 -/** Intrinsic table bit -Intrinsic table is table created internally by MySQL modules viz. Optimizer, -FTS, etc.... Intrinsic table has all the properties of the normal table except -it is not created by user and so not visible to end-user. */ -#define DICT_TF2_INTRINSIC 128 - /** Encryption table bit. */ #define DICT_TF2_ENCRYPTION 256 @@ -859,95 +853,6 @@ struct zip_pad_info_t { a certain index.*/ #define STAT_DEFRAG_DATA_SIZE_N_SAMPLE 10 -/** If key is fixed length key then cache the record offsets on first -computation. This will help save computation cycle that generate same -redundant data. */ -class rec_cache_t -{ -public: - /** Constructor */ - rec_cache_t() - : - rec_size(), - offsets(), - sz_of_offsets(), - fixed_len_key(), - offsets_cached(), - key_has_null_cols() - { - /* Do Nothing. */ - } - -public: - /** Record size. (for fixed length key record size is constant) */ - ulint rec_size; - - /** Holds reference to cached offsets for record. */ - ulint* offsets; - - /** Size of offset array */ - uint32_t sz_of_offsets; - - /** If true, then key is fixed length key. */ - bool fixed_len_key; - - /** If true, then offset has been cached for re-use. */ - bool offsets_cached; - - /** If true, then key part can have columns that can take - NULL values. */ - bool key_has_null_cols; -}; - -/** Cache position of last inserted or selected record by caching record -and holding reference to the block where record resides. -Note: We don't commit mtr and hold it beyond a transaction lifetime as this is -a special case (intrinsic table) that are not shared accross connection. */ -class last_ops_cur_t -{ -public: - /** Constructor */ - last_ops_cur_t() - : - rec(), - block(), - mtr(), - disable_caching(), - invalid() - { - /* Do Nothing. */ - } - - /* Commit mtr and re-initialize cache record and block to NULL. */ - void release() - { - if (mtr.is_active()) { - mtr_commit(&mtr); - } - rec = NULL; - block = NULL; - invalid = false; - } - -public: - /** last inserted/selected record. */ - rec_t* rec; - - /** block where record reside. */ - buf_block_t* block; - - /** active mtr that will be re-used for next insert/select. */ - mtr_t mtr; - - /** disable caching. (disabled when table involves blob/text.) */ - bool disable_caching; - - /** If index structure is undergoing structural change viz. - split then invalidate the cached position as it would be no more - remain valid. Will be re-cached on post-split insert. */ - bool invalid; -}; - /** "GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key. */ const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX"; @@ -990,18 +895,15 @@ struct dict_index_t{ /*!< number of columns the user defined to be in the index: in the internal representation we add more columns */ - unsigned allow_duplicates:1; - /*!< if true, allow duplicate values - even if index is created with unique - constraint */ unsigned nulls_equal:1; /*!< if true, SQL NULL == SQL NULL */ - unsigned disable_ahi:1; - /*!< in true, then disable AHI. - Currently limited to intrinsic - temporary table as index id is not - unqiue for such table which is one of the - validation criterion for ahi. */ +#ifdef MYSQL_INDEX_DISABLE_AHI + unsigned disable_ahi:1; + /*!< whether to disable the + adaptive hash index. + Maybe this could be disabled for + temporary tables? */ +#endif unsigned n_uniq:10;/*!< number of fields from the beginning which are enough to determine an index entry uniquely */ @@ -1098,19 +1000,6 @@ struct dict_index_t{ /* in which slot the next sample should be saved. */ /* @} */ - last_ops_cur_t* last_ins_cur; - /*!< cache the last insert position. - Currently limited to auto-generated - clustered index on intrinsic table only. */ - last_ops_cur_t* last_sel_cur; - /*!< cache the last selected position - Currently limited to intrinsic table only. */ - rec_cache_t rec_cache; - /*!< cache the field that needs to be - re-computed on each insert. - Limited to intrinsic table as this is common - share and can't be used without protection - if table is accessible to multiple-threads. */ rtr_ssn_t rtr_ssn;/*!< Node sequence number for RTree */ rtr_info_track_t* rtr_track;/*!< tracking all R-Tree search cursors */ @@ -1874,18 +1763,6 @@ public: /** Timestamp of the last modification of this table. */ time_t update_time; - /** row-id counter for use by intrinsic table for getting row-id. - Given intrinsic table semantics, row-id can be locally maintained - instead of getting it from central generator which involves mutex - locking. */ - ib_uint64_t sess_row_id; - - /** trx_id counter for use by intrinsic table for getting trx-id. - Intrinsic table are not shared so don't need a central trx-id - but just need a increased counter to track consistent view while - proceeding SELECT as part of UPDATE. */ - ib_uint64_t sess_trx_id; - #endif /* !UNIV_HOTBACKUP */ bool is_encrypted; diff --git a/storage/innobase/include/dict0mem.ic b/storage/innobase/include/dict0mem.ic index 3269596feb7..a50fb615a09 100644 --- a/storage/innobase/include/dict0mem.ic +++ b/storage/innobase/include/dict0mem.ic @@ -69,35 +69,10 @@ dict_mem_fill_index_struct( index->n_fields = (unsigned int) n_fields; /* The '1 +' above prevents allocation of an empty mem block */ - index->allow_duplicates = false; index->nulls_equal = false; +#ifdef MYSQL_INDEX_DISABLE_AHI index->disable_ahi = false; - - new (&index->rec_cache) rec_cache_t(); - - if (heap != NULL) { - index->last_ins_cur = - static_cast(mem_heap_alloc( - heap, sizeof(last_ops_cur_t))); - - new (index->last_ins_cur) last_ops_cur_t(); - - index->last_sel_cur = - static_cast(mem_heap_alloc( - heap, sizeof(last_ops_cur_t))); - - new (index->last_sel_cur) last_ops_cur_t(); - - index->rec_cache.offsets = - static_cast(mem_heap_alloc( - heap, sizeof(ulint) * OFFS_IN_REC_NORMAL_SIZE)); - - index->rec_cache.sz_of_offsets = OFFS_IN_REC_NORMAL_SIZE; - } else { - index->last_ins_cur = NULL; - index->last_sel_cur = NULL; - index->rec_cache.offsets = NULL; - } +#endif #ifdef UNIV_DEBUG index->magic_n = DICT_INDEX_MAGIC_N; diff --git a/storage/innobase/include/dict0stats.ic b/storage/innobase/include/dict0stats.ic index 80709091734..61c88773912 100644 --- a/storage/innobase/include/dict0stats.ic +++ b/storage/innobase/include/dict0stats.ic @@ -182,7 +182,7 @@ dict_stats_deinit( /*==============*/ dict_table_t* table) /*!< in/out: table */ { - ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table)); + ut_ad(mutex_own(&dict_sys->mutex)); ut_a(table->get_ref_count() == 0); diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 4a1d867015d..3526436f042 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -84,17 +84,11 @@ savepoint. */ #ifdef UNIV_DEBUG -/** Check if memo contains the given item ignore if table is intrinsic -@return TRUE if contains or table is intrinsic. */ -#define mtr_is_block_fix(m, o, t, table) \ - (mtr_memo_contains(m, o, t) \ - || dict_table_is_intrinsic(table)) +/** Check if memo contains the given item. */ +#define mtr_is_block_fix(m, o, t, table) mtr_memo_contains(m, o, t) -/** Check if memo contains the given page ignore if table is intrinsic -@return TRUE if contains or table is intrinsic. */ -#define mtr_is_page_fix(m, p, t, table) \ - (mtr_memo_contains_page(m, p, t) \ - || dict_table_is_intrinsic(table)) +/** Check if memo contains the given page. */ +#define mtr_is_page_fix(m, p, t, table) mtr_memo_contains_page(m, p, t) /** Check if memo contains the given item. @return TRUE if contains */ diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic index b3d9b052d52..f0354756b23 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.ic @@ -47,13 +47,6 @@ mtr_t::memo_push(void* object, mtr_memo_type_t type) m_impl.m_made_dirty = is_block_dirtied( reinterpret_cast(object)); - } else if (type == MTR_MEMO_BUF_FIX && !m_impl.m_made_dirty) { - - if (reinterpret_cast( - object)->made_dirty_with_no_latch) { - - m_impl.m_made_dirty = true; - } } mtr_memo_slot_t* slot; diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index c111717d868..94b5896d3ad 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -201,23 +201,6 @@ page_cur_insert_rec_low( mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); -/** Inserts a record next to page cursor on an uncompressed page. -@param[in] current_rec pointer to current record after which - the new record is inserted. -@param[in] index record descriptor -@param[in] tuple pointer to a data tuple -@param[in] n_ext number of externally stored columns -@param[in] mtr mini-transaction handle, or NULL - -@return pointer to record if succeed, NULL otherwise */ -rec_t* -page_cur_direct_insert_rec_low( - rec_t* current_rec, - dict_index_t* index, - const dtuple_t* tuple, - ulint n_ext, - mtr_t* mtr); - /***********************************************************//** Inserts a record next to page cursor on a compressed and uncompressed page. Returns pointer to inserted record if succeed, i.e., diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.ic index 8f580ef2d43..bfd9da47803 100644 --- a/storage/innobase/include/page0cur.ic +++ b/storage/innobase/include/page0cur.ic @@ -294,35 +294,6 @@ page_cur_tuple_insert( ut_ad(!rec || !cmp_dtuple_rec(tuple, rec, *offsets)); return(rec); } - -/** Insert a record next to page cursor. Record is directly copied to -the page from tuple without creating intermediate copy of the record. - -@param[in,out] cursor a page cursor -@param[in] tuple pointer to a data tuple -@param[in] index record descriptor -@param[in] n_ext number of externally stored columns -@param[in] mtr mini-transaction handle, or NULL - -@return pointer to record if succeed, NULL otherwise */ -UNIV_INLINE -rec_t* -page_cur_tuple_direct_insert( - page_cur_t* cursor, - const dtuple_t* tuple, - dict_index_t* index, - ulint n_ext, - mtr_t* mtr) -{ - rec_t* rec; - - ut_ad(dict_table_is_intrinsic(index->table)); - - rec = page_cur_direct_insert_rec_low( - cursor->rec, index, tuple, n_ext, mtr); - - return(rec); -} #endif /* !UNIV_HOTBACKUP */ /***********************************************************//** diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 2d508c1a7df..f010e717103 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -37,7 +37,6 @@ Created 9/17/2000 Heikki Tuuri #include "btr0pcur.h" #include "trx0types.h" #include "fil0crypt.h" -#include "sess0sess.h" // Forward declaration struct SysIndexCallback; @@ -292,14 +291,6 @@ row_update_for_mysql( row_prebuilt_t* prebuilt) MY_ATTRIBUTE((warn_unused_result)); -/** Delete all rows for the given table by freeing/truncating indexes. -@param[in,out] table table handler -@return error code or DB_SUCCESS */ -dberr_t -row_delete_all_rows( - dict_table_t* table) - MY_ATTRIBUTE((warn_unused_result)); - /** This can only be used when srv_locks_unsafe_for_binlog is TRUE or this session is using a READ COMMITTED or READ UNCOMMITTED isolation level. Before calling this function row_search_for_mysql() must have @@ -402,13 +393,12 @@ row_create_index_for_mysql( dict_index_t* index, /*!< in, own: index definition (will be freed) */ trx_t* trx, /*!< in: transaction handle */ - const ulint* field_lengths, /*!< in: if not NULL, must contain + const ulint* field_lengths) /*!< in: if not NULL, must contain dict_index_get_n_fields(index) actual field lengths for the index columns, which are then checked for not being too large. */ - dict_table_t* handler) /* ! in/out: table handler. */ MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Scans a table create SQL string and adds to the data dictionary @@ -427,8 +417,6 @@ fields than mentioned in the constraint. database id the database of parameter name @param[in] sql_length length of sql_string @param[in] name table full name in normalized form -@param[in] is_temp_table true if table is temporary -@param[in,out] handler table handler if table is intrinsic @param[in] reject_fks if TRUE, fail with error code DB_CANNOT_ADD_CONSTRAINT if any foreign keys are found. @@ -493,11 +481,9 @@ row_drop_table_for_mysql( ibool create_failed,/*!mysql_n_tables_locked > 0 - condition. For intrinsic table - external_lock is not invoked and so condition - above will not stand valid instead this is - traced using alternative condition - at caller level. @return DB_SUCCESS or error code */ dberr_t row_search_mvcc( diff --git a/storage/innobase/include/row0sel.ic b/storage/innobase/include/row0sel.ic index a816e4440e2..d14b41e3f5f 100644 --- a/storage/innobase/include/row0sel.ic +++ b/storage/innobase/include/row0sel.ic @@ -134,12 +134,5 @@ row_search_for_mysql( ulint match_mode, ulint direction) { - if (!dict_table_is_intrinsic(prebuilt->table)) { - return(row_search_mvcc( - buf, mode, prebuilt, match_mode, direction)); - } else { - return(row_search_no_mvcc( - buf, mode, prebuilt, match_mode, direction)); - } + return(row_search_mvcc(buf, mode, prebuilt, match_mode, direction)); } - diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h index 5fdb916c54c..bd49e034384 100644 --- a/storage/innobase/include/sync0types.h +++ b/storage/innobase/include/sync0types.h @@ -1033,10 +1033,10 @@ struct latch_t { return(m_temp_fsp); } - /** Set the temporary tablespace flag. The latch order constraints - are different for intrinsic tables. We don't always acquire the - index->lock. We need to figure out the context and add some special - rules during the checks. */ + /** Set the temporary tablespace flag. (For internal temporary + tables, MySQL 5.7 does not always acquire the index->lock. We + need to figure out the context and add some special rules + during the checks.) */ void set_temp_fsp() UNIV_NOTHROW { @@ -1090,26 +1090,11 @@ struct btrsea_sync_check : public sync_check_functor_t { virtual bool operator()(const latch_level_t level) { /* If calling thread doesn't hold search latch then - check if there are latch level exception provided. - - Note: Optimizer has added InnoDB intrinsic table as an - alternative to MyISAM intrinsic table. With this a new - control flow comes into existence, it is: - - Server -> Plugin -> SE - - Plugin in this case is I_S which is sharing the latch vector - of InnoDB and so there could be lock conflicts. Ideally - the Plugin should use a difference namespace latch vector - as it doesn't have any depedency with SE latching protocol. - - Added check that will allow thread to hold I_S latches */ + check if there are latch level exception provided. */ if (!m_has_search_latch && (level != SYNC_SEARCH_SYS - && level != SYNC_FTS_CACHE - && level != SYNC_TRX_I_S_RWLOCK - && level != SYNC_TRX_I_S_LAST_READ)) { + && level != SYNC_FTS_CACHE)) { m_result = true; diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index e8ed8adb483..736933bdaed 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -358,16 +358,6 @@ struct ReleaseBlocks { || slot->type == MTR_MEMO_PAGE_SX_FIX) { add_dirty_page_to_flush_list(slot); - - } else if (slot->type == MTR_MEMO_BUF_FIX) { - - buf_block_t* block; - block = reinterpret_cast( - slot->object); - if (block->made_dirty_with_no_latch) { - add_dirty_page_to_flush_list(slot); - block->made_dirty_with_no_latch = false; - } } } diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index b0412009b80..87c28872462 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -301,96 +301,6 @@ page_cur_rec_field_extends( } #endif /* PAGE_CUR_LE_OR_EXTENDS */ -/** If key is fixed length then populate offset directly from -cached version. -@param[in] rec B-Tree record for which offset needs to be - populated. -@param[in,out] index index handler -@param[in] tuple data tuple -@param[in,out] offsets default offsets array -@param[in,out] heap heap -@return reference to populate offsets. */ -static -ulint* -populate_offsets( - const rec_t* rec, - const dtuple_t* tuple, - dict_index_t* index, - ulint* offsets, - mem_heap_t** heap) -{ - ut_ad(dict_table_is_intrinsic(index->table)); - - bool rec_has_null_values = false; - - if (index->rec_cache.key_has_null_cols) { - /* Check if record has null value. */ - const byte* nulls = rec - (1 + REC_N_NEW_EXTRA_BYTES); - ulint n_bytes_to_scan - = UT_BITS_IN_BYTES(index->n_nullable); - byte null_mask = 0xff; - ulint bits_examined = 0; - - for (ulint i = 0; i < n_bytes_to_scan - 1; i++) { - if (*nulls & null_mask) { - rec_has_null_values = true; - break; - } - --nulls; - bits_examined += 8; - } - - if (!rec_has_null_values) { - null_mask >>= (8 - (index->n_nullable - bits_examined)); - rec_has_null_values = *nulls & null_mask; - } - - if (rec_has_null_values) { - - offsets = rec_get_offsets( - rec, index, offsets, - dtuple_get_n_fields_cmp(tuple), heap); - - return(offsets); - } - } - - /* Check if offsets are cached else cache them first. - There are queries that will first verify if key is present using index - search and then initiate insert. If offsets are cached during index - search it would be based on key part only but during insert that looks - out for exact location to insert key + db_row_id both columns would - be used and so re-compute offsets in such case. */ - if (!index->rec_cache.offsets_cached - || (rec_offs_n_fields(index->rec_cache.offsets) - < dtuple_get_n_fields_cmp(tuple))) { - - offsets = rec_get_offsets( - rec, index, offsets, - dtuple_get_n_fields_cmp(tuple), heap); - - /* Reallocate if our offset array is not big - enough to hold the needed size. */ - ulint sz1 = index->rec_cache.sz_of_offsets; - ulint sz2 = offsets[0]; - if (sz1 < sz2) { - index->rec_cache.offsets = static_cast( - mem_heap_alloc( - index->heap, sizeof(ulint) * sz2)); - index->rec_cache.sz_of_offsets = - static_cast(sz2); - } - - memcpy(index->rec_cache.offsets, - offsets, (sizeof(ulint) * sz2)); - index->rec_cache.offsets_cached = true; - } - - ut_ad(index->rec_cache.offsets[2] = (ulint) rec); - - return(index->rec_cache.offsets); -} - /****************************************************************//** Searches the right position for a page cursor. */ void @@ -522,17 +432,9 @@ page_cur_search_with_match( up_matched_fields); offsets = offsets_; - if (index->rec_cache.fixed_len_key) { - offsets = populate_offsets( - mid_rec, tuple, - const_cast(index), - offsets, &heap); - } else { - offsets = rec_get_offsets( - mid_rec, index, offsets, - dtuple_get_n_fields_cmp(tuple), &heap); - - } + offsets = rec_get_offsets( + mid_rec, index, offsets, + dtuple_get_n_fields_cmp(tuple), &heap); cmp = cmp_dtuple_rec_with_match( tuple, mid_rec, offsets, &cur_matched_fields); @@ -584,17 +486,9 @@ up_slot_match: up_matched_fields); offsets = offsets_; - if (index->rec_cache.fixed_len_key) { - offsets = populate_offsets( - mid_rec, tuple, - const_cast(index), - offsets, &heap); - } else { - offsets = rec_get_offsets( - mid_rec, index, offsets, - dtuple_get_n_fields_cmp(tuple), &heap); - - } + offsets = rec_get_offsets( + mid_rec, index, offsets, + dtuple_get_n_fields_cmp(tuple), &heap); cmp = cmp_dtuple_rec_with_match( tuple, mid_rec, offsets, &cur_matched_fields); @@ -1554,214 +1448,6 @@ use_heap: return(insert_rec); } -/** Inserts a record next to page cursor on an uncompressed page. -@param[in] current_rec pointer to current record after which - the new record is inserted. -@param[in] index record descriptor -@param[in] tuple pointer to a data tuple -@param[in] n_ext number of externally stored columns -@param[in] mtr mini-transaction handle, or NULL - -@return pointer to record if succeed, NULL otherwise */ -rec_t* -page_cur_direct_insert_rec_low( - rec_t* current_rec, - dict_index_t* index, - const dtuple_t* tuple, - ulint n_ext, - mtr_t* mtr) -{ - byte* insert_buf; - ulint rec_size; - page_t* page; /*!< the relevant page */ - rec_t* last_insert; /*!< cursor position at previous - insert */ - rec_t* free_rec; /*!< a free record that was reused, - or NULL */ - rec_t* insert_rec; /*!< inserted record */ - ulint heap_no; /*!< heap number of the inserted - record */ - - page = page_align(current_rec); - - ut_ad(dict_table_is_comp(index->table) - == (ibool) !!page_is_comp(page)); - - ut_ad(fil_page_index_page_check(page)); - - ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID) - == index->id); - - ut_ad(!page_rec_is_supremum(current_rec)); - - /* 1. Get the size of the physical record in the page */ - rec_size = index->rec_cache.rec_size; - - /* 2. Try to find suitable space from page memory management */ - free_rec = page_header_get_ptr(page, PAGE_FREE); - if (free_rec) { - /* Try to allocate from the head of the free list. */ - ulint foffsets_[REC_OFFS_NORMAL_SIZE]; - ulint* foffsets = foffsets_; - mem_heap_t* heap = NULL; - - rec_offs_init(foffsets_); - - foffsets = rec_get_offsets( - free_rec, index, foffsets, ULINT_UNDEFINED, &heap); - if (rec_offs_size(foffsets) < rec_size) { - if (heap != NULL) { - mem_heap_free(heap); - heap = NULL; - } - - free_rec = NULL; - insert_buf = page_mem_alloc_heap( - page, NULL, rec_size, &heap_no); - - if (insert_buf == NULL) { - return(NULL); - } - } else { - insert_buf = free_rec - rec_offs_extra_size(foffsets); - - if (page_is_comp(page)) { - heap_no = rec_get_heap_no_new(free_rec); - page_mem_alloc_free( - page, NULL, - rec_get_next_ptr(free_rec, TRUE), - rec_size); - } else { - heap_no = rec_get_heap_no_old(free_rec); - page_mem_alloc_free( - page, NULL, - rec_get_next_ptr(free_rec, FALSE), - rec_size); - } - - if (heap != NULL) { - mem_heap_free(heap); - heap = NULL; - } - } - } else { - free_rec = NULL; - insert_buf = page_mem_alloc_heap(page, NULL, - rec_size, &heap_no); - - if (insert_buf == NULL) { - return(NULL); - } - } - - /* 3. Create the record */ - insert_rec = rec_convert_dtuple_to_rec(insert_buf, index, tuple, n_ext); - - /* 4. Insert the record in the linked list of records */ - ut_ad(current_rec != insert_rec); - - { - /* next record after current before the insertion */ - rec_t* next_rec = page_rec_get_next(current_rec); -#ifdef UNIV_DEBUG - if (page_is_comp(page)) { - ut_ad(rec_get_status(current_rec) - <= REC_STATUS_INFIMUM); - ut_ad(rec_get_status(insert_rec) < REC_STATUS_INFIMUM); - ut_ad(rec_get_status(next_rec) != REC_STATUS_INFIMUM); - } -#endif - page_rec_set_next(insert_rec, next_rec); - page_rec_set_next(current_rec, insert_rec); - } - - page_header_set_field(page, NULL, PAGE_N_RECS, - 1 + page_get_n_recs(page)); - - /* 5. Set the n_owned field in the inserted record to zero, - and set the heap_no field */ - if (page_is_comp(page)) { - rec_set_n_owned_new(insert_rec, NULL, 0); - rec_set_heap_no_new(insert_rec, heap_no); - } else { - rec_set_n_owned_old(insert_rec, 0); - rec_set_heap_no_old(insert_rec, heap_no); - } - - /* 6. Update the last insertion info in page header */ - - last_insert = page_header_get_ptr(page, PAGE_LAST_INSERT); - ut_ad(!last_insert || !page_is_comp(page) - || rec_get_node_ptr_flag(last_insert) - == rec_get_node_ptr_flag(insert_rec)); - - if (last_insert == NULL) { - page_header_set_field(page, NULL, PAGE_DIRECTION, - PAGE_NO_DIRECTION); - page_header_set_field(page, NULL, PAGE_N_DIRECTION, 0); - - } else if ((last_insert == current_rec) - && (page_header_get_field(page, PAGE_DIRECTION) - != PAGE_LEFT)) { - - page_header_set_field(page, NULL, PAGE_DIRECTION, - PAGE_RIGHT); - page_header_set_field(page, NULL, PAGE_N_DIRECTION, - page_header_get_field( - page, PAGE_N_DIRECTION) + 1); - - } else if ((page_rec_get_next(insert_rec) == last_insert) - && (page_header_get_field(page, PAGE_DIRECTION) - != PAGE_RIGHT)) { - - page_header_set_field(page, NULL, PAGE_DIRECTION, - PAGE_LEFT); - page_header_set_field(page, NULL, PAGE_N_DIRECTION, - page_header_get_field( - page, PAGE_N_DIRECTION) + 1); - } else { - page_header_set_field(page, NULL, PAGE_DIRECTION, - PAGE_NO_DIRECTION); - page_header_set_field(page, NULL, PAGE_N_DIRECTION, 0); - } - - page_header_set_ptr(page, NULL, PAGE_LAST_INSERT, insert_rec); - - /* 7. It remains to update the owner record. */ - { - rec_t* owner_rec = page_rec_find_owner_rec(insert_rec); - ulint n_owned; - if (page_is_comp(page)) { - n_owned = rec_get_n_owned_new(owner_rec); - rec_set_n_owned_new(owner_rec, NULL, n_owned + 1); - } else { - n_owned = rec_get_n_owned_old(owner_rec); - rec_set_n_owned_old(owner_rec, n_owned + 1); - } - - /* 8. Now we have incremented the n_owned field of the owner - record. If the number exceeds PAGE_DIR_SLOT_MAX_N_OWNED, - we have to split the corresponding directory slot in two. */ - - if (n_owned == PAGE_DIR_SLOT_MAX_N_OWNED) { - page_dir_split_slot( - page, NULL, - page_dir_find_owner_slot(owner_rec)); - } - } - - /* 8. Open the mtr for name sake to set the modification flag - to true failing which no flush would be done. */ - byte* log_ptr = mlog_open(mtr, 0); - ut_ad(log_ptr == NULL); - if (log_ptr != NULL) { - /* To keep complier happy. */ - mlog_close(mtr, log_ptr); - } - - return(insert_rec); -} - /***********************************************************//** Inserts a record next to page cursor on a compressed and uncompressed page. Returns pointer to inserted record if succeed, i.e., diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index a73d383ccce..277a47bbad5 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4805,10 +4805,8 @@ page_zip_copy_recs( dict_index_t* index, /*!< in: index of the B-tree */ mtr_t* mtr) /*!< in: mini-transaction */ { - ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX) - || dict_table_is_intrinsic(index->table)); - ut_ad(mtr_memo_contains_page(mtr, src, MTR_MEMO_PAGE_X_FIX) - || dict_table_is_intrinsic(index->table)); + ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX)); + ut_ad(mtr_memo_contains_page(mtr, src, MTR_MEMO_PAGE_X_FIX)); ut_ad(!dict_index_is_ibuf(index)); #ifdef UNIV_ZIP_DEBUG /* The B-tree operations that call this function may set diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 720ad44b4b8..20c64a4288c 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -155,10 +155,7 @@ row_ins_alloc_sys_fields( ut_ad(dtuple_get_n_fields(row) == dict_table_get_n_cols(table)); /* allocate buffer to hold the needed system created hidden columns. */ - uint len = DATA_ROW_ID_LEN + DATA_TRX_ID_LEN; - if (!dict_table_is_intrinsic(table)) { - len += DATA_ROLL_PTR_LEN; - } + const uint len = DATA_ROW_ID_LEN + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN; ptr = static_cast(mem_heap_zalloc(heap, len)); /* 1. Populate row-id */ @@ -183,13 +180,11 @@ row_ins_alloc_sys_fields( ptr += DATA_TRX_ID_LEN; - if (!dict_table_is_intrinsic(table)) { - col = dict_table_get_sys_col(table, DATA_ROLL_PTR); + col = dict_table_get_sys_col(table, DATA_ROLL_PTR); - dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); + dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); - dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN); - } + dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN); } /*********************************************************************//** @@ -2152,7 +2147,7 @@ row_ins_scan_sec_index_for_duplicate( cmp = cmp_dtuple_rec(entry, rec, offsets); - if (cmp == 0 && !index->allow_duplicates) { + if (cmp == 0) { if (row_ins_dupl_error_with_rec(rec, entry, index, offsets)) { err = DB_DUPLICATE_KEY; @@ -2174,7 +2169,7 @@ row_ins_scan_sec_index_for_duplicate( goto end_scan; } } else { - ut_a(cmp < 0 || index->allow_duplicates); + ut_a(cmp < 0); goto end_scan; } } while (btr_pcur_move_to_next(&pcur, mtr)); @@ -2507,9 +2502,6 @@ row_ins_clust_index_entry_low( Disable locking as temp-tables are local to a connection. */ ut_ad(flags & BTR_NO_LOCKING_FLAG); - ut_ad(!dict_table_is_intrinsic(index->table) - || (flags & BTR_NO_UNDO_LOG_FLAG)); - mtr.set_log_mode(MTR_LOG_NO_REDO); } @@ -2528,9 +2520,6 @@ row_ins_clust_index_entry_low( cursor->thr = thr; } - ut_ad(!dict_table_is_intrinsic(index->table) - || cursor->page_cur.block->made_dirty_with_no_latch); - #ifdef UNIV_DEBUG { page_t* page = btr_cur_get_page(cursor); @@ -2542,15 +2531,7 @@ row_ins_clust_index_entry_low( } #endif /* UNIV_DEBUG */ - /* Allowing duplicates in clustered index is currently enabled - only for intrinsic table and caller understand the limited - operation that can be done in this case. */ - ut_ad(!index->allow_duplicates - || (index->allow_duplicates - && dict_table_is_intrinsic(index->table))); - - if (!index->allow_duplicates - && n_uniq + if (n_uniq && (cursor->up_match >= n_uniq || cursor->low_match >= n_uniq)) { if (flags @@ -2593,20 +2574,13 @@ err_exit: } /* Note: Allowing duplicates would qualify for modification of - an existing record as the new entry is exactly same as old entry. - Avoid this check if allow duplicates is enabled. */ - if (!index->allow_duplicates && row_ins_must_modify_rec(cursor)) { + an existing record as the new entry is exactly same as old entry. */ + if (row_ins_must_modify_rec(cursor)) { /* There is already an index entry with a long enough common prefix, we must convert the insert into a modify of an existing record */ mem_heap_t* entry_heap = mem_heap_create(1024); - /* If the existing record is being modified and the new record - doesn't fit the provided slot then existing record is added - to free list and new record is inserted. This also means - cursor that we have cached for SELECT is now invalid. */ - index->last_sel_cur->invalid = true; - err = row_ins_clust_index_entry_by_modify( &pcur, flags, mode, &offsets, &offsets_heap, entry_heap, entry, thr, &mtr); @@ -2690,147 +2664,6 @@ func_exit: DBUG_RETURN(err); } -/** This is a specialized function meant for direct insertion to -auto-generated clustered index based on cached position from -last successful insert. To be used when data is sorted. - -@param[in] mode BTR_MODIFY_LEAF or BTR_MODIFY_TREE. - depending on whether we wish optimistic or - pessimistic descent down the index tree -@param[in,out] index clustered index -@param[in,out] entry index entry to insert -@param[in] thr query thread - -@return error code */ -static -dberr_t -row_ins_sorted_clust_index_entry( - ulint mode, - dict_index_t* index, - dtuple_t* entry, - ulint n_ext, - que_thr_t* thr) -{ - dberr_t err = DB_SUCCESS; - mtr_t* mtr; - const bool commit_mtr = mode == BTR_MODIFY_TREE; - - mem_heap_t* offsets_heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; - rec_offs_init(offsets_); - - DBUG_ENTER("row_ins_sorted_clust_index_entry"); - - ut_ad(index->last_ins_cur != NULL); - ut_ad(dict_index_is_clust(index)); - ut_ad(dict_table_is_intrinsic(index->table)); - ut_ad(dict_index_is_auto_gen_clust(index)); - - btr_cur_t cursor; - cursor.thr = thr; - mtr = &index->last_ins_cur->mtr; - - /* Search for position if tree needs to be split or if last position - is not cached. */ - if (mode == BTR_MODIFY_TREE - || index->last_ins_cur->rec == NULL - || index->last_ins_cur->disable_caching) { - - /* Commit the previous mtr. */ - index->last_ins_cur->release(); - - mtr_start(mtr); - mtr_set_log_mode(mtr, MTR_LOG_NO_REDO); - - err = btr_cur_search_to_nth_level_with_no_latch( - index, 0, entry, PAGE_CUR_LE, &cursor, - __FILE__, __LINE__, mtr); - ut_ad(cursor.page_cur.block != NULL); - ut_ad(cursor.page_cur.block->made_dirty_with_no_latch); - } else { - cursor.index = index; - - cursor.page_cur.index = index; - - cursor.page_cur.rec = index->last_ins_cur->rec; - - cursor.page_cur.block = index->last_ins_cur->block; - } - - const ulint flags = BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG; - - for (;;) { - rec_t* insert_rec; - big_rec_t* big_rec = NULL; - - if (mode != BTR_MODIFY_TREE) { - ut_ad((mode & ~BTR_ALREADY_S_LATCHED) - == BTR_MODIFY_LEAF); - - err = btr_cur_optimistic_insert( - flags, &cursor, &offsets, &offsets_heap, entry, - &insert_rec, &big_rec, n_ext, thr, mtr); - if (err != DB_SUCCESS) { - break; - } - } else { - /* TODO: Check if this is needed for intrinsic table. */ - if (buf_LRU_buf_pool_running_out()) { - err = DB_LOCK_TABLE_FULL; - break; - } - - err = btr_cur_optimistic_insert( - flags, &cursor, &offsets, &offsets_heap, entry, - &insert_rec, &big_rec, n_ext, thr, mtr); - - if (err == DB_FAIL) { - err = btr_cur_pessimistic_insert( - flags, &cursor, &offsets, &offsets_heap, - entry, &insert_rec, &big_rec, n_ext, - thr, mtr); - } - } - - if (big_rec != NULL) { - /* If index involves big-record optimization is - turned-off. */ - index->last_ins_cur->release(); - index->last_ins_cur->disable_caching = true; - - err = row_ins_index_entry_big_rec( - entry, big_rec, offsets, &offsets_heap, index, - thr_get_trx(thr)->mysql_thd, __FILE__, __LINE__); - - dtuple_convert_back_big_rec(index, entry, big_rec); - - } else if (err == DB_SUCCESS ) { - if (!commit_mtr - && !index->last_ins_cur->disable_caching) { - index->last_ins_cur->rec = insert_rec; - - index->last_ins_cur->block - = cursor.page_cur.block; - } else { - index->last_ins_cur->release(); - } - } - - break; - } - - if (err != DB_SUCCESS) { - index->last_ins_cur->release(); - } - - if (offsets_heap != NULL) { - mem_heap_free(offsets_heap); - } - - DBUG_RETURN(err); -} - /** Start a mini-transaction and check if the index will be dropped. @param[in,out] mtr mini-transaction @param[in,out] index secondary index @@ -2923,8 +2756,7 @@ row_ins_sec_index_entry_low( cursor.thr = thr; cursor.rtr_info = NULL; - ut_ad(thr_get_trx(thr)->id != 0 - || dict_table_is_intrinsic(index->table)); + ut_ad(thr_get_trx(thr)->id != 0); mtr_start(&mtr); mtr.set_named_space(index->space); @@ -2936,9 +2768,6 @@ row_ins_sec_index_entry_low( Disable locking as temp-tables are local to a connection. */ ut_ad(flags & BTR_NO_LOCKING_FLAG); - ut_ad(!dict_table_is_intrinsic(index->table) - || (flags & BTR_NO_UNDO_LOG_FLAG)); - mtr.set_log_mode(MTR_LOG_NO_REDO); } else if (!dict_index_is_spatial(index)) { /* Enable insert buffering if it's neither temp-table @@ -3008,18 +2837,10 @@ row_ins_sec_index_entry_low( goto func_exit;}); } else { - if (dict_table_is_intrinsic(index->table)) { - err = btr_cur_search_to_nth_level_with_no_latch( - index, 0, entry, PAGE_CUR_LE, &cursor, - __FILE__, __LINE__, &mtr); - ut_ad(cursor.page_cur.block != NULL); - ut_ad(cursor.page_cur.block->made_dirty_with_no_latch); - } else { - err = btr_cur_search_to_nth_level( - index, 0, entry, PAGE_CUR_LE, - search_mode, - &cursor, 0, __FILE__, __LINE__, &mtr); - } + err = btr_cur_search_to_nth_level( + index, 0, entry, PAGE_CUR_LE, + search_mode, + &cursor, 0, __FILE__, __LINE__, &mtr); } if (err != DB_SUCCESS) { @@ -3111,19 +2932,11 @@ row_ins_sec_index_entry_low( prevent any insertion of a duplicate by another transaction. Let us now reposition the cursor and continue the insertion. */ - if (dict_table_is_intrinsic(index->table)) { - err = btr_cur_search_to_nth_level_with_no_latch( - index, 0, entry, PAGE_CUR_LE, &cursor, - __FILE__, __LINE__, &mtr); - ut_ad(cursor.page_cur.block != NULL); - ut_ad(cursor.page_cur.block->made_dirty_with_no_latch); - } else { - btr_cur_search_to_nth_level( - index, 0, entry, PAGE_CUR_LE, - (search_mode - & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)), - &cursor, 0, __FILE__, __LINE__, &mtr); - } + btr_cur_search_to_nth_level( + index, 0, entry, PAGE_CUR_LE, + (search_mode + & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)), + &cursor, 0, __FILE__, __LINE__, &mtr); } if (!(flags & BTR_NO_LOCKING_FLAG) @@ -3169,12 +2982,6 @@ row_ins_sec_index_entry_low( } if (row_ins_must_modify_rec(&cursor)) { - /* If the existing record is being modified and the new record - is doesn't fit the provided slot then existing record is added - to free list and new record is inserted. This also means - cursor that we have cached for SELECT is now invalid. */ - index->last_sel_cur->invalid = true; - /* There is already an index entry with a long enough common prefix, we must convert the insert into a modify of an existing record */ @@ -3339,26 +3146,14 @@ row_ins_clust_index_entry( n_uniq = dict_index_is_unique(index) ? index->n_uniq : 0; /* Try first optimistic descent to the B-tree */ - ulint flags; + log_free_check(); + const ulint flags = dict_table_is_temporary(index->table) + ? BTR_NO_LOCKING_FLAG + : 0; - if (!dict_table_is_intrinsic(index->table)) { - log_free_check(); - flags = dict_table_is_temporary(index->table) - ? BTR_NO_LOCKING_FLAG - : 0; - } else { - flags = BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG; - } - - if (dict_table_is_intrinsic(index->table) - && dict_index_is_auto_gen_clust(index)) { - err = row_ins_sorted_clust_index_entry( - BTR_MODIFY_LEAF, index, entry, n_ext, thr); - } else { - err = row_ins_clust_index_entry_low( - flags, BTR_MODIFY_LEAF, index, n_uniq, entry, - n_ext, thr, dup_chk_only); - } + err = row_ins_clust_index_entry_low( + flags, BTR_MODIFY_LEAF, index, n_uniq, entry, + n_ext, thr, dup_chk_only); DEBUG_SYNC_C_IF_THD(thr_get_trx(thr)->mysql_thd, @@ -3370,21 +3165,11 @@ row_ins_clust_index_entry( } /* Try then pessimistic descent to the B-tree */ - if (!dict_table_is_intrinsic(index->table)) { - log_free_check(); - } else { - index->last_sel_cur->invalid = true; - } + log_free_check(); - if (dict_table_is_intrinsic(index->table) - && dict_index_is_auto_gen_clust(index)) { - err = row_ins_sorted_clust_index_entry( - BTR_MODIFY_TREE, index, entry, n_ext, thr); - } else { - err = row_ins_clust_index_entry_low( - flags, BTR_MODIFY_TREE, index, n_uniq, entry, - n_ext, thr, dup_chk_only); - } + err = row_ins_clust_index_entry_low( + flags, BTR_MODIFY_TREE, index, n_uniq, entry, + n_ext, thr, dup_chk_only); DBUG_RETURN(err); } @@ -3422,24 +3207,17 @@ row_ins_sec_index_entry( } } - ut_ad(thr_get_trx(thr)->id != 0 - || dict_table_is_intrinsic(index->table)); + ut_ad(thr_get_trx(thr)->id != 0); offsets_heap = mem_heap_create(1024); heap = mem_heap_create(1024); /* Try first optimistic descent to the B-tree */ - ulint flags; - - if (!dict_table_is_intrinsic(index->table)) { - log_free_check(); - flags = dict_table_is_temporary(index->table) - ? BTR_NO_LOCKING_FLAG - : 0; - } else { - flags = BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG; - } + log_free_check(); + const ulint flags = dict_table_is_temporary(index->table) + ? BTR_NO_LOCKING_FLAG + : 0; err = row_ins_sec_index_entry_low( flags, BTR_MODIFY_LEAF, index, offsets_heap, heap, entry, @@ -3448,12 +3226,7 @@ row_ins_sec_index_entry( mem_heap_empty(heap); /* Try then pessimistic descent to the B-tree */ - - if (!dict_table_is_intrinsic(index->table)) { - log_free_check(); - } else { - index->last_sel_cur->invalid = true; - } + log_free_check(); err = row_ins_sec_index_entry_low( flags, BTR_MODIFY_TREE, index, @@ -3892,7 +3665,6 @@ row_ins_step( node = static_cast(thr->run_node); ut_ad(que_node_get_type(node) == QUE_NODE_INSERT); - ut_ad(!dict_table_is_intrinsic(node->table)); parent = que_node_get_parent(node); sel_node = node->select; diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 4a063c9af83..5b38b7c6c01 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1015,9 +1015,6 @@ row_create_prebuilt( prebuilt->mysql_row_len = mysql_row_len; - prebuilt->ins_sel_stmt = false; - prebuilt->session = NULL; - prebuilt->fts_doc_id_in_read_set = 0; prebuilt->blob_heap = NULL; @@ -1407,282 +1404,12 @@ run_again: return(err); } -/** Perform explicit rollback in absence of UNDO logs. -@param[in] index apply rollback action on this index -@param[in] entry entry to remove/rollback. -@param[in,out] thr thread handler. -@param[in,out] mtr mini transaction. -@return error code or DB_SUCCESS */ -static -dberr_t -row_explicit_rollback( - dict_index_t* index, - const dtuple_t* entry, - que_thr_t* thr, - mtr_t* mtr) -{ - btr_cur_t cursor; - ulint flags; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets; - mem_heap_t* heap = NULL; - dberr_t err = DB_SUCCESS; - - rec_offs_init(offsets_); - flags = BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG; - - err = btr_cur_search_to_nth_level_with_no_latch( - index, 0, entry, PAGE_CUR_LE, - &cursor, __FILE__, __LINE__, mtr); - - offsets = rec_get_offsets( - btr_cur_get_rec(&cursor), index, offsets_, - ULINT_UNDEFINED, &heap); - - if (dict_index_is_clust(index)) { - err = btr_cur_del_mark_set_clust_rec( - flags, btr_cur_get_block(&cursor), - btr_cur_get_rec(&cursor), index, - offsets, thr, entry, mtr); - } else { - err = btr_cur_del_mark_set_sec_rec( - flags, &cursor, TRUE, thr, mtr); - } - ut_ad(err == DB_SUCCESS); - - /* Void call just to set mtr modification flag - to true failing which block is not scheduled for flush*/ - byte* log_ptr = mlog_open(mtr, 0); - ut_ad(log_ptr == NULL); - if (log_ptr != NULL) { - /* To keep complier happy. */ - mlog_close(mtr, log_ptr); - } - - if (heap != NULL) { - mem_heap_free(heap); - } - - return(err); -} - -/** Convert a row in the MySQL format to a row in the Innobase format. -This is specialized function used for intrinsic table with reduce branching. -@param[in,out] row row where field values are copied. -@param[in] prebuilt prebuilt handler -@param[in] mysql_rec row in mysql format. */ -static -void -row_mysql_to_innobase( - dtuple_t* row, - row_prebuilt_t* prebuilt, - const byte* mysql_rec) -{ - ut_ad(dict_table_is_intrinsic(prebuilt->table)); - - const byte* ptr = mysql_rec; - - for (ulint i = 0; i < prebuilt->n_template; i++) { - const mysql_row_templ_t* templ; - dfield_t* dfield; - - templ = prebuilt->mysql_template + i; - dfield = dtuple_get_nth_field(row, i); - - /* Check if column has null value. */ - if (templ->mysql_null_bit_mask != 0) { - if (mysql_rec[templ->mysql_null_byte_offset] - & (byte) (templ->mysql_null_bit_mask)) { - dfield_set_null(dfield); - continue; - } - } - - /* Extract the column value. */ - ptr = mysql_rec + templ->mysql_col_offset; - const dtype_t* dtype = dfield_get_type(dfield); - ulint col_len = templ->mysql_col_len; - - ut_ad(dtype->mtype == DATA_INT - || dtype->mtype == DATA_CHAR - || dtype->mtype == DATA_MYSQL - || dtype->mtype == DATA_VARCHAR - || dtype->mtype == DATA_VARMYSQL - || dtype->mtype == DATA_BINARY - || dtype->mtype == DATA_FIXBINARY - || dtype->mtype == DATA_FLOAT - || dtype->mtype == DATA_DOUBLE - || dtype->mtype == DATA_DECIMAL - || dtype->mtype == DATA_BLOB - || dtype->mtype == DATA_GEOMETRY - || dtype->mtype == DATA_POINT - || dtype->mtype == DATA_VAR_POINT); - -#ifdef UNIV_DEBUG - if (dtype_get_mysql_type(dtype) == DATA_MYSQL_TRUE_VARCHAR) { - ut_ad(templ->mysql_length_bytes > 0); - } -#endif /* UNIV_DEBUG */ - - /* For now varchar field this has to be always 0 so - memcpy of 0 bytes shouldn't affect the original col_len. */ - if (dtype->mtype == DATA_INT) { - /* Convert and Store in big-endian. */ - byte* buf = prebuilt->ins_upd_rec_buff - + templ->mysql_col_offset; - byte* copy_to = buf + col_len; - for (;;) { - copy_to--; - *copy_to = *ptr; - if (copy_to == buf) { - break; - } - ptr++; - } - - if (!(dtype->prtype & DATA_UNSIGNED)) { - *buf ^= 128; - } - - ptr = buf; - buf += col_len; - } else if (dtype_get_mysql_type(dtype) == - DATA_MYSQL_TRUE_VARCHAR) { - - ut_ad(dtype->mtype == DATA_VARCHAR - || dtype->mtype == DATA_VARMYSQL - || dtype->mtype == DATA_BINARY); - - col_len = 0; - row_mysql_read_true_varchar( - &col_len, ptr, templ->mysql_length_bytes); - ptr += templ->mysql_length_bytes; - } else if (dtype->mtype == DATA_BLOB) { - ptr = row_mysql_read_blob_ref(&col_len, ptr, col_len); - } else if (DATA_GEOMETRY_MTYPE(dtype->mtype)) { - /* Point, Var-Point, Geometry */ - ptr = row_mysql_read_geometry(&col_len, ptr, col_len); - } - - dfield_set_data(dfield, ptr, col_len); - } -} - -/** Does an insert for MySQL using cursor interface. -Cursor interface is low level interface that directly interacts at -Storage Level by-passing all the locking and transaction semantics. -For InnoDB case, this will also by-pass hidden column generation. +/** Does an insert for MySQL. @param[in] mysql_rec row in the MySQL format @param[in,out] prebuilt prebuilt struct in MySQL handle @return error code or DB_SUCCESS */ -static dberr_t -row_insert_for_mysql_using_cursor( - const byte* mysql_rec, - row_prebuilt_t* prebuilt) -{ - dberr_t err = DB_SUCCESS; - ins_node_t* node = NULL; - que_thr_t* thr = NULL; - mtr_t mtr; - - /* Step-1: Get the reference of row to insert. */ - row_get_prebuilt_insert_row(prebuilt); - node = prebuilt->ins_node; - thr = que_fork_get_first_thr(prebuilt->ins_graph); - - /* Step-2: Convert row from MySQL row format to InnoDB row format. */ - row_mysql_to_innobase(node->row, prebuilt, mysql_rec); - - /* Step-3: Append row-id index is not unique. */ - dict_index_t* clust_index = dict_table_get_first_index(node->table); - - if (!dict_index_is_unique(clust_index)) { - dict_sys_write_row_id( - node->row_id_buf, - dict_table_get_next_table_sess_row_id(node->table)); - } - - trx_write_trx_id(node->trx_id_buf, - dict_table_get_next_table_sess_trx_id(node->table)); - - /* Step-4: Iterate over all the indexes and insert entries. */ - dict_index_t* inserted_upto = NULL; - node->entry = UT_LIST_GET_FIRST(node->entry_list); - for (dict_index_t* index = UT_LIST_GET_FIRST(node->table->indexes); - index != NULL; - index = UT_LIST_GET_NEXT(indexes, index), - node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry)) { - - node->index = index; - err = row_ins_index_entry_set_vals( - node->index, node->entry, node->row); - if (err != DB_SUCCESS) { - break; - } - - if (dict_index_is_clust(index)) { - err = row_ins_clust_index_entry( - node->index, node->entry, thr, 0, false); - } else { - err = row_ins_sec_index_entry( - node->index, node->entry, thr, false); - } - - if (err == DB_SUCCESS) { - inserted_upto = index; - } else { - break; - } - } - - /* Step-5: If error is encountered while inserting entries to any - of the index then entries inserted to previous indexes are removed - explicity. Automatic rollback is not in action as UNDO logs are - turned-off. */ - if (err != DB_SUCCESS) { - - node->entry = UT_LIST_GET_FIRST(node->entry_list); - - mtr_start(&mtr); - dict_disable_redo_if_temporary(node->table, &mtr); - - for (dict_index_t* index = - UT_LIST_GET_FIRST(node->table->indexes); - inserted_upto != NULL; - index = UT_LIST_GET_NEXT(indexes, index), - node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry)) { - - row_explicit_rollback(index, node->entry, thr, &mtr); - - if (index == inserted_upto) { - break; - } - } - - mtr_commit(&mtr); - } else { - /* Not protected by dict_table_stats_lock() for performance - reasons, we would rather get garbage in stat_n_rows (which is - just an estimate anyway) than protecting the following code - , with a latch. */ - dict_table_n_rows_inc(node->table); - - srv_stats.n_rows_inserted.inc(); - } - - thr_get_trx(thr)->error_state = DB_SUCCESS; - return(err); -} - -/** Does an insert for MySQL using INSERT graph. This function will run/execute -INSERT graph. -@param[in] mysql_rec row in the MySQL format -@param[in,out] prebuilt prebuilt struct in MySQL handle -@return error code or DB_SUCCESS */ -static -dberr_t -row_insert_for_mysql_using_ins_graph( +row_insert_for_mysql( const byte* mysql_rec, row_prebuilt_t* prebuilt) { @@ -1896,26 +1623,6 @@ error_exit: return(err); } -/** Does an insert for MySQL. -@param[in] mysql_rec row in the MySQL format -@param[in,out] prebuilt prebuilt struct in MySQL handle -@return error code or DB_SUCCESS*/ -dberr_t -row_insert_for_mysql( - const byte* mysql_rec, - row_prebuilt_t* prebuilt) -{ - /* For intrinsic tables there a lot of restrictions that can be - relaxed including locking of table, transaction handling, etc. - Use direct cursor interface for inserting to intrinsic tables. */ - if (dict_table_is_intrinsic(prebuilt->table)) { - return(row_insert_for_mysql_using_cursor(mysql_rec, prebuilt)); - } else { - return(row_insert_for_mysql_using_ins_graph( - mysql_rec, prebuilt)); - } -} - /*********************************************************************//** Builds a dummy query graph used in selects. */ void @@ -2129,314 +1836,6 @@ public: }; -typedef std::vector > cursors_t; - -/** Delete row from table (corresponding entries from all the indexes). -Function will maintain cursor to the entries to invoke explicity rollback -just incase update action following delete fails. - -@param[in] node update node carrying information to delete. -@param[out] delete_entries vector of cursor to deleted entries. -@param[in] restore_delete if true, then restore DELETE records by - unmarking delete. -@return error code or DB_SUCCESS */ -static -dberr_t -row_delete_for_mysql_using_cursor( - const upd_node_t* node, - cursors_t& delete_entries, - bool restore_delete) -{ - mtr_t mtr; - dict_table_t* table = node->table; - mem_heap_t* heap = mem_heap_create(1000); - dberr_t err = DB_SUCCESS; - dtuple_t* entry; - - mtr_start(&mtr); - dict_disable_redo_if_temporary(table, &mtr); - - for (dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); - index != NULL && err == DB_SUCCESS && !restore_delete; - index = UT_LIST_GET_NEXT(indexes, index)) { - - entry = row_build_index_entry( - node->row, node->ext, index, heap); - - btr_pcur_t pcur; - - btr_pcur_open(index, entry, PAGE_CUR_LE, - BTR_MODIFY_LEAF, &pcur, &mtr); - -#ifdef UNIV_DEBUG - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; - rec_offs_init(offsets_); - - offsets = rec_get_offsets( - btr_cur_get_rec(btr_pcur_get_btr_cur(&pcur)), - index, offsets, ULINT_UNDEFINED, &heap); - - ut_ad(!cmp_dtuple_rec( - entry, btr_cur_get_rec(btr_pcur_get_btr_cur(&pcur)), - offsets)); -#endif /* UNIV_DEBUG */ - - ut_ad(!rec_get_deleted_flag( - btr_cur_get_rec(btr_pcur_get_btr_cur(&pcur)), - dict_table_is_comp(index->table))); - - ut_ad(btr_pcur_get_block(&pcur)->made_dirty_with_no_latch); - - if (page_rec_is_infimum(btr_pcur_get_rec(&pcur)) - || page_rec_is_supremum(btr_pcur_get_rec(&pcur))) { - err = DB_ERROR; - } else { - btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur); - - btr_rec_set_deleted_flag( - btr_cur_get_rec(btr_cur), - buf_block_get_page_zip( - btr_cur_get_block(btr_cur)), - TRUE); - - /* Void call just to set mtr modification flag - to true failing which block is not scheduled for flush*/ - byte* log_ptr = mlog_open(&mtr, 0); - ut_ad(log_ptr == NULL); - if (log_ptr != NULL) { - /* To keep complier happy. */ - mlog_close(&mtr, log_ptr); - } - - btr_pcur_store_position(&pcur, &mtr); - - delete_entries.push_back(pcur); - } - } - - if (err != DB_SUCCESS || restore_delete) { - - /* Rollback half-way delete action that might have been - applied to few of the indexes. */ - cursors_t::iterator end = delete_entries.end(); - for (cursors_t::iterator it = delete_entries.begin(); - it != end; - ++it) { - - ibool success = btr_pcur_restore_position( - BTR_MODIFY_LEAF, &(*it), &mtr); - - if (!success) { - ut_a(success); - } else { - btr_cur_t* btr_cur = btr_pcur_get_btr_cur( - &(*it)); - - ut_ad(btr_cur_get_block( - btr_cur)->made_dirty_with_no_latch); - - btr_rec_set_deleted_flag( - btr_cur_get_rec(btr_cur), - buf_block_get_page_zip( - btr_cur_get_block(btr_cur)), - FALSE); - - /* Void call just to set mtr modification flag - to true failing which block is not scheduled for - flush. */ - byte* log_ptr = mlog_open(&mtr, 0); - ut_ad(log_ptr == NULL); - if (log_ptr != NULL) { - /* To keep complier happy. */ - mlog_close(&mtr, log_ptr); - } - } - } - } - - mtr_commit(&mtr); - - mem_heap_free(heap); - - return(err); -} - -/** Does an update of a row for MySQL by inserting new entry with update values. -@param[in] node update node carrying information to delete. -@param[out] delete_entries vector of cursor to deleted entries. -@param[in] thr thread handler -@return error code or DB_SUCCESS */ -static -dberr_t -row_update_for_mysql_using_cursor( - const upd_node_t* node, - cursors_t& delete_entries, - que_thr_t* thr) -{ - dberr_t err = DB_SUCCESS; - dict_table_t* table = node->table; - mem_heap_t* heap = mem_heap_create(1000); - dtuple_t* entry; - dfield_t* trx_id_field; - - /* Step-1: Update row-id column if table doesn't have unique index. */ - if (!dict_index_is_unique(dict_table_get_first_index(table))) { - /* Update the row_id column. */ - dfield_t* row_id_field; - - row_id_field = dtuple_get_nth_field( - node->upd_row, dict_table_get_n_cols(table) - 2); - - dict_sys_write_row_id( - static_cast(row_id_field->data), - dict_table_get_next_table_sess_row_id(node->table)); - } - - /* Step-2: Update the trx_id column. */ - trx_id_field = dtuple_get_nth_field( - node->upd_row, dict_table_get_n_cols(table) - 1); - trx_write_trx_id(static_cast(trx_id_field->data), - dict_table_get_next_table_sess_trx_id(node->table)); - - - /* Step-3: Check if UPDATE can lead to DUPLICATE key violation. - If yes, then avoid executing it and return error. Only after ensuring - that UPDATE is safe execute it as we can't rollback. */ - for (dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); - index != NULL && err == DB_SUCCESS; - index = UT_LIST_GET_NEXT(indexes, index)) { - - entry = row_build_index_entry( - node->upd_row, node->upd_ext, index, heap); - - if (dict_index_is_clust(index)) { - if (!dict_index_is_auto_gen_clust(index)) { - err = row_ins_clust_index_entry( - index, entry, thr, - node->upd_ext - ? node->upd_ext->n_ext : 0, - true); - } - } else { - err = row_ins_sec_index_entry(index, entry, thr, true); - } - } - - if (err != DB_SUCCESS) { - /* This suggest update can't be executed safely. - Avoid executing update. Rollback DELETE action. */ - row_delete_for_mysql_using_cursor(node, delete_entries, true); - } - - /* Step-4: It is now safe to execute update if there is no error */ - for (dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); - index != NULL && err == DB_SUCCESS; - index = UT_LIST_GET_NEXT(indexes, index)) { - - entry = row_build_index_entry( - node->upd_row, node->upd_ext, index, heap); - - if (dict_index_is_clust(index)) { - err = row_ins_clust_index_entry( - index, entry, thr, - node->upd_ext ? node->upd_ext->n_ext : 0, - false); - /* Commit the open mtr as we are processing UPDATE. */ - index->last_ins_cur->release(); - } else { - err = row_ins_sec_index_entry(index, entry, thr, false); - } - - /* Too big record is valid error and suggestion is to use - bigger page-size or different format. */ - ut_ad(err == DB_SUCCESS - || err == DB_TOO_BIG_RECORD - || err == DB_OUT_OF_FILE_SPACE); - - if (err == DB_TOO_BIG_RECORD) { - row_delete_for_mysql_using_cursor( - node, delete_entries, true); - } - } - - if (heap != NULL) { - mem_heap_free(heap); - } - return(err); -} - -/** Does an update or delete of a row for MySQL. -@param[in] mysql_rec row in the MySQL format -@param[in,out] prebuilt prebuilt struct in MySQL handle -@return error code or DB_SUCCESS */ -static -dberr_t -row_del_upd_for_mysql_using_cursor( - const byte* mysql_rec, - row_prebuilt_t* prebuilt) -{ - dberr_t err = DB_SUCCESS; - upd_node_t* node; - cursors_t delete_entries; - dict_index_t* clust_index; - que_thr_t* thr = NULL; - - /* Step-0: If there is cached insert position commit it before - starting delete/update action as this can result in btree structure - to change. */ - thr = que_fork_get_first_thr(prebuilt->upd_graph); - clust_index = dict_table_get_first_index(prebuilt->table); - clust_index->last_ins_cur->release(); - - /* Step-1: Select the appropriate cursor that will help build - the original row and updated row. */ - node = prebuilt->upd_node; - if (prebuilt->pcur->btr_cur.index == clust_index) { - btr_pcur_copy_stored_position(node->pcur, prebuilt->pcur); - } else { - btr_pcur_copy_stored_position(node->pcur, - prebuilt->clust_pcur); - } - - ut_ad(dict_table_is_intrinsic(prebuilt->table)); - ut_ad(!prebuilt->table->n_v_cols); - - /* Internal table is created by optimiser. So there - should not be any virtual columns. */ - row_upd_store_row(node, NULL, NULL); - - /* Step-2: Execute DELETE operation. */ - err = row_delete_for_mysql_using_cursor(node, delete_entries, false); - - /* Step-3: If only DELETE operation then exit immediately. */ - if (node->is_delete) { - if (err == DB_SUCCESS) { - dict_table_n_rows_dec(prebuilt->table); - srv_stats.n_rows_deleted.inc(); - } - } - - if (err == DB_SUCCESS && !node->is_delete) { - /* Step-4: Complete UPDATE operation by inserting new row with - updated data. */ - err = row_update_for_mysql_using_cursor( - node, delete_entries, thr); - - if (err == DB_SUCCESS) { - srv_stats.n_rows_updated.inc(); - } - } - - thr_get_trx(thr)->error_state = DB_SUCCESS; - cursors_t::iterator end = delete_entries.end(); - for (cursors_t::iterator it = delete_entries.begin(); it != end; ++it) { - btr_pcur_close(&(*it)); - } - - return(err); -} - /** Does an update or delete of a row for MySQL. @param[in] mysql_rec row in the MySQL format @param[in,out] prebuilt prebuilt struct in MySQL handle @@ -2794,41 +2193,8 @@ row_update_for_mysql( const byte* mysql_rec, row_prebuilt_t* prebuilt) { - if (dict_table_is_intrinsic(prebuilt->table)) { - return(row_del_upd_for_mysql_using_cursor(mysql_rec, prebuilt)); - } else { - ut_a(prebuilt->template_type == ROW_MYSQL_WHOLE_ROW); - return(row_update_for_mysql_using_upd_graph( - mysql_rec, prebuilt)); - } -} - -/** Delete all rows for the given table by freeing/truncating indexes. -@param[in,out] table table handler -@return error code or DB_SUCCESS */ -dberr_t -row_delete_all_rows( - dict_table_t* table) -{ - dberr_t err = DB_SUCCESS; - - /* Step-0: If there is cached insert position along with mtr - commit it before starting delete/update action. */ - dict_table_get_first_index(table)->last_ins_cur->release(); - - /* Step-1: Now truncate all the indexes and re-create them. - Note: This is ddl action even though delete all rows is - DML action. Any error during this action is ir-reversible. */ - for (dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); - index != NULL && err == DB_SUCCESS; - index = UT_LIST_GET_NEXT(indexes, index)) { - - err = dict_truncate_index_tree_in_mem(index); - // TODO: what happen if get an error - ut_ad(err == DB_SUCCESS); - } - - return(err); + ut_a(prebuilt->template_type == ROW_MYSQL_WHOLE_ROW); + return(row_update_for_mysql_using_upd_graph(mysql_rec, prebuilt)); } /** This can only be used when srv_locks_unsafe_for_binlog is TRUE or this @@ -3258,13 +2624,12 @@ row_create_index_for_mysql( dict_index_t* index, /*!< in, own: index definition (will be freed) */ trx_t* trx, /*!< in: transaction handle */ - const ulint* field_lengths, /*!< in: if not NULL, must contain + const ulint* field_lengths) /*!< in: if not NULL, must contain dict_index_get_n_fields(index) actual field lengths for the index columns, which are then checked for not being too large. */ - dict_table_t* handler) /*!< in/out: table handler. */ { ind_node_t* node; mem_heap_t* heap; @@ -3287,22 +2652,11 @@ row_create_index_for_mysql( is_fts = (index->type == DICT_FTS); - if (handler != NULL && dict_table_is_intrinsic(handler)) { - table = handler; - } + ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); + ut_ad(mutex_own(&dict_sys->mutex)); - if (table == NULL) { - - ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); - ut_ad(mutex_own(&dict_sys->mutex)); - - table = dict_table_open_on_name(table_name, TRUE, TRUE, - DICT_ERR_IGNORE_NONE); - - } else { - table->acquire(); - ut_ad(dict_table_is_intrinsic(table)); - } + table = dict_table_open_on_name(table_name, TRUE, TRUE, + DICT_ERR_IGNORE_NONE); if (!dict_table_is_temporary(table)) { trx_start_if_not_started_xa(trx, true); @@ -3361,13 +2715,9 @@ row_create_index_for_mysql( index_id_t index_id = index->id; - /* add index to dictionary cache and also free index object. - We allow instrinsic table to violate the size limits because - they are used by optimizer for all record formats. */ + /* add index to dictionary cache and also free index object. */ err = dict_index_add_to_cache( - table, index, FIL_NULL, - !dict_table_is_intrinsic(table) - && trx_is_strict(trx)); + table, index, FIL_NULL, trx_is_strict(trx)); if (err != DB_SUCCESS) { goto error_handling; @@ -3375,23 +2725,13 @@ row_create_index_for_mysql( /* as above function has freed index object re-load it now from dictionary cache using index_id */ - if (!dict_table_is_intrinsic(table)) { - index = dict_index_get_if_in_cache_low(index_id); - } else { - index = dict_table_find_index_on_id(table, index_id); - - /* trx_id field is used for tracking which transaction - created the index. For intrinsic table this is - ir-relevant and so re-use it for tracking consistent - view while processing SELECT as part of UPDATE. */ - index->trx_id = ULINT_UNDEFINED; - } + index = dict_index_get_if_in_cache_low(index_id); ut_a(index != NULL); index->table = table; err = dict_create_index_tree_in_mem(index, trx); - if (err != DB_SUCCESS && !dict_table_is_intrinsic(table)) { + if (err != DB_SUCCESS) { dict_index_remove_from_cache(table, index); } } @@ -3420,7 +2760,7 @@ error_handling: trx_rollback_to_savepoint(trx, NULL); } - row_drop_table_for_mysql(table_name, trx, FALSE, true, handler); + row_drop_table_for_mysql(table_name, trx, FALSE, true); if (trx_is_started(trx)) { @@ -3489,9 +2829,6 @@ row_table_add_foreign_constraints( DEBUG_SYNC_C("table_add_foreign_constraints"); - /* Check like this shouldn't be done for table that doesn't - have foreign keys but code still continues to run with void action. - Disable it for intrinsic table at-least */ if (err == DB_SUCCESS) { /* Check that also referencing constraints are ok */ dict_names_t fk_tables; @@ -4263,23 +3600,7 @@ row_drop_table_from_cache( is going to be destroyed below. */ trx->mod_tables.erase(table); - if (!dict_table_is_intrinsic(table)) { - dict_table_remove_from_cache(table); - } else { - for (dict_index_t* index = UT_LIST_GET_FIRST(table->indexes); - index != NULL; - index = UT_LIST_GET_FIRST(table->indexes)) { - - rw_lock_free(&index->lock); - - UT_LIST_REMOVE(table->indexes, index); - - dict_mem_index_free(index); - } - - dict_mem_table_free(table); - table = NULL; - } + dict_table_remove_from_cache(table); if (!is_temp && dict_load_table(tablename, true, @@ -4355,7 +3676,6 @@ will remain locked. because e.g. foreign key column @param[in] nonatomic Whether it is permitted to release and reacquire dict_operation_lock -@param[in,out] handler Table handler @return error code or DB_SUCCESS */ dberr_t row_drop_table_for_mysql( @@ -4363,18 +3683,16 @@ row_drop_table_for_mysql( trx_t* trx, bool drop_db, ibool create_failed, - bool nonatomic, - dict_table_t* handler) + bool nonatomic) { dberr_t err; dict_foreign_t* foreign; - dict_table_t* table = NULL; + dict_table_t* table; char* filepath = NULL; char* tablename = NULL; bool locked_dictionary = false; pars_info_t* info = NULL; mem_heap_t* heap = NULL; - bool is_intrinsic_temp_table = false; DBUG_ENTER("row_drop_table_for_mysql"); DBUG_PRINT("row_drop_table_for_mysql", ("table: '%s'", name)); @@ -4386,35 +3704,24 @@ row_drop_table_for_mysql( trx->op_info = "dropping table"; - if (handler != NULL && dict_table_is_intrinsic(handler)) { - table = handler; - is_intrinsic_temp_table = true; + if (trx->dict_operation_lock_mode != RW_X_LATCH) { + /* Prevent foreign key checks etc. while we are + dropping the table */ + + row_mysql_lock_data_dictionary(trx); + + locked_dictionary = true; + nonatomic = true; } - if (table == NULL) { + ut_ad(mutex_own(&dict_sys->mutex)); + ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); - if (trx->dict_operation_lock_mode != RW_X_LATCH) { - /* Prevent foreign key checks etc. while we are - dropping the table */ - - row_mysql_lock_data_dictionary(trx); - - locked_dictionary = true; - nonatomic = true; - } - - ut_ad(mutex_own(&dict_sys->mutex)); - ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); - - table = dict_table_open_on_name( - name, TRUE, FALSE, - static_cast( - DICT_ERR_IGNORE_INDEX_ROOT - | DICT_ERR_IGNORE_CORRUPT)); - } else { - table->acquire(); - ut_ad(dict_table_is_intrinsic(table)); - } + table = dict_table_open_on_name( + name, TRUE, FALSE, + static_cast( + DICT_ERR_IGNORE_INDEX_ROOT + | DICT_ERR_IGNORE_CORRUPT)); if (!table) { err = DB_TABLE_NOT_FOUND; @@ -4495,10 +3802,7 @@ row_drop_table_for_mysql( } } - if (!dict_table_is_intrinsic(table)) { - dict_table_prevent_eviction(table); - } - + dict_table_prevent_eviction(table); dict_table_close(table, TRUE, FALSE); /* Check if the table is referenced by foreign key constraints from @@ -4600,16 +3904,11 @@ row_drop_table_for_mysql( fil_wait_crypt_bg_threads(table); if (table->get_ref_count() == 0) { - /* We don't take lock on intrinsic table so nothing to remove.*/ - if (!dict_table_is_intrinsic(table)) { - lock_remove_all_on_table(table, TRUE); - } + lock_remove_all_on_table(table, TRUE); ut_a(table->n_rec_locks == 0); } else if (table->get_ref_count() > 0 || table->n_rec_locks > 0) { ibool added; - ut_ad(!dict_table_is_intrinsic(table)); - added = row_add_table_to_background_drop_list( table->name.m_name); @@ -4641,7 +3940,7 @@ row_drop_table_for_mysql( /* If we get this far then the table to be dropped must not have any table or record locks on it. */ - ut_a(dict_table_is_intrinsic(table) || !lock_table_has_locks(table)); + ut_a(!lock_table_has_locks(table)); switch (trx_get_dict_operation(trx)) { case TRX_DICT_OP_NONE: @@ -4974,12 +4273,7 @@ funct_exit: trx->op_info = ""; - /* No need to immediately invoke master thread as there is no work - generated by intrinsic table operation that needs master thread - attention. */ - if (!is_intrinsic_temp_table) { - srv_wake_master_thread(); - } + srv_wake_master_thread(); DBUG_RETURN(err); } diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index d23a0d8c432..62fd18d027b 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4091,320 +4091,6 @@ row_search_idx_cond_check( return(result); } -/** Traverse to next/previous record. -@param[in] moves_up if true, move to next record else previous -@param[in] match_mode 0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX -@param[in,out] pcur cursor to record -@param[in] mtr mini transaction - -@return DB_SUCCESS or error code */ -static -dberr_t -row_search_traverse( - bool moves_up, - ulint match_mode, - btr_pcur_t* pcur, - mtr_t* mtr) -{ - dberr_t err = DB_SUCCESS; - - if (moves_up) { - if (!btr_pcur_move_to_next(pcur, mtr)) { - err = (match_mode != 0) - ? DB_RECORD_NOT_FOUND : DB_END_OF_INDEX; - return(err); - } - } else { - if (!btr_pcur_move_to_prev(pcur, mtr)) { - err = (match_mode != 0) - ? DB_RECORD_NOT_FOUND : DB_END_OF_INDEX; - return(err); - } - } - - return(err); -} - -/** Searches for rows in the database using cursor. -Function is for temporary tables that are not shared accross connections -and so lot of complexity is reduced especially locking and transaction related. -The cursor is an iterator over the table/index. - -@param[out] buf buffer for the fetched row in MySQL format -@param[in] mode search mode PAGE_CUR_L -@param[in,out] prebuilt prebuilt struct for the table handler; - this contains the info to search_tuple, - index; if search tuple contains 0 field then - we position the cursor at start or the end of - index, depending on 'mode' -@param[in] match_mode 0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX -@param[in] direction 0 or ROW_SEL_NEXT or ROW_SEL_PREV; - Note: if this is != 0, then prebuilt must has a - pcur with stored position! In opening of a - cursor 'direction' should be 0. -@return DB_SUCCESS or error code */ -dberr_t -row_search_no_mvcc( - byte* buf, - page_cur_mode_t mode, - row_prebuilt_t* prebuilt, - ulint match_mode, - ulint direction) -{ - dict_index_t* index = prebuilt->index; - const dtuple_t* search_tuple = prebuilt->search_tuple; - btr_pcur_t* pcur = prebuilt->pcur; - - const rec_t* result_rec = NULL; - const rec_t* clust_rec = NULL; - - dberr_t err = DB_SUCCESS; - - mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; - rec_offs_init(offsets_); - ut_ad(index && pcur && search_tuple); - - /* Step-0: Re-use the cached mtr. */ - mtr_t* mtr = &index->last_sel_cur->mtr; - dict_index_t* clust_index = dict_table_get_first_index(index->table); - - /* Step-1: Build the select graph. */ - if (direction == 0 && prebuilt->sel_graph == NULL) { - row_prebuild_sel_graph(prebuilt); - } - - que_thr_t* thr = que_fork_get_first_thr(prebuilt->sel_graph); - - bool moves_up; - - if (direction == 0) { - - if (mode == PAGE_CUR_GE || mode == PAGE_CUR_G) { - moves_up = true; - } else { - moves_up = false; - } - - } else if (direction == ROW_SEL_NEXT) { - moves_up = true; - } else { - moves_up = false; - } - - /* Step-2: Open or Restore the cursor. - If search key is specified, cursor is open using the key else - cursor is open to return all the records. */ - if (direction != 0) { - if (index->last_sel_cur->invalid) { - - /* Index tree has changed and so active cached cursor - is no more valid. Re-set it based on the last selected - position. */ - index->last_sel_cur->release(); - - mtr_start(mtr); - dict_disable_redo_if_temporary(index->table, mtr); - - mem_heap_t* heap = mem_heap_create(256); - dtuple_t* tuple; - - tuple = dict_index_build_data_tuple( - index, pcur->old_rec, - pcur->old_n_fields, heap); - - btr_pcur_open_with_no_init( - index, tuple, pcur->search_mode, - BTR_SEARCH_LEAF, pcur, 0, mtr); - - mem_heap_free(heap); - } else { - /* Restore the cursor for reading next record from cache - information. */ - ut_ad(index->last_sel_cur->rec != NULL); - - pcur->btr_cur.page_cur.rec = index->last_sel_cur->rec; - pcur->btr_cur.page_cur.block = - index->last_sel_cur->block; - - err = row_search_traverse( - moves_up, match_mode, pcur, mtr); - if (err != DB_SUCCESS) { - return(err); - } - } - } else { - /* There could be previous uncommitted transaction if SELECT - is operation as part of SELECT (IF NOT FOUND) INSERT - (IF DUPLICATE) UPDATE plan. */ - index->last_sel_cur->release(); - - /* Capture table snapshot in form of trx-id. */ - index->trx_id = dict_table_get_curr_table_sess_trx_id( - index->table); - - /* Fresh search commences. */ - mtr_start(mtr); - dict_disable_redo_if_temporary(index->table, mtr); - - if (dtuple_get_n_fields(search_tuple) > 0) { - - btr_pcur_open_with_no_init( - index, search_tuple, mode, BTR_SEARCH_LEAF, - pcur, 0, mtr); - - } else if (mode == PAGE_CUR_G || mode == PAGE_CUR_L) { - - btr_pcur_open_at_index_side( - mode == PAGE_CUR_G, index, BTR_SEARCH_LEAF, - pcur, false, 0, mtr); - - } - } - - /* Step-3: Traverse the records filtering non-qualifiying records. */ - for (/* No op */; - err == DB_SUCCESS; - err = row_search_traverse(moves_up, match_mode, pcur, mtr)) { - - const rec_t* rec = btr_pcur_get_rec(pcur); - - if (page_rec_is_infimum(rec) - || page_rec_is_supremum(rec) - || rec_get_deleted_flag( - rec, dict_table_is_comp(index->table))) { - - /* The infimum record on a page cannot be in the - result set, and neither can a record lock be placed on - it: we skip such a record. */ - continue; - } - - offsets = rec_get_offsets( - rec, index, offsets, ULINT_UNDEFINED, &heap); - - /* Note that we cannot trust the up_match value in the cursor - at this place because we can arrive here after moving the - cursor! Thus we have to recompare rec and search_tuple to - determine if they match enough. */ - if (match_mode == ROW_SEL_EXACT) { - /* Test if the index record matches completely to - search_tuple in prebuilt: if not, then we return with - DB_RECORD_NOT_FOUND */ - if (0 != cmp_dtuple_rec(search_tuple, rec, offsets)) { - err = DB_RECORD_NOT_FOUND; - break; - } - } else if (match_mode == ROW_SEL_EXACT_PREFIX) { - if (!cmp_dtuple_is_prefix_of_rec( - search_tuple, rec, offsets)) { - err = DB_RECORD_NOT_FOUND; - break; - } - } - - /* Get the clustered index. We always need clustered index - record for snapshort verification. */ - if (index != clust_index) { - - err = row_sel_get_clust_rec_for_mysql( - prebuilt, index, rec, thr, &clust_rec, - &offsets, &heap, NULL, mtr); - - if (err != DB_SUCCESS) { - break; - } - - if (rec_get_deleted_flag( - clust_rec, dict_table_is_comp(index->table))) { - - /* The record is delete marked in clustered - index. We can skip this record. */ - continue; - } - - result_rec = clust_rec; - } else { - result_rec = rec; - } - - /* Step-4: Check if row is part of the consistent view that was - captured while SELECT statement started execution. */ - { - trx_id_t trx_id; - - ulint len; - ulint trx_id_off = rec_get_nth_field_offs( - offsets, clust_index->n_uniq, &len); - - ut_ad(len == DATA_TRX_ID_LEN); - - trx_id = trx_read_trx_id(result_rec + trx_id_off); - - if (trx_id > index->trx_id) { - /* This row was recently added skip it from - SELECT view. */ - continue; - } - } - - /* Step-5: Cache the row-id of selected row to prebuilt cache.*/ - if (prebuilt->clust_index_was_generated) { - row_sel_store_row_id_to_prebuilt( - prebuilt, result_rec, clust_index, offsets); - } - - /* Step-6: Convert selected record to MySQL format and - store it. */ - if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) { - - const rec_t* ret_rec = - (index != clust_index - && prebuilt->need_to_access_clustered) - ? result_rec : rec; - - offsets = rec_get_offsets(ret_rec, index, offsets, - ULINT_UNDEFINED, &heap); - - memcpy(buf + 4, ret_rec - rec_offs_extra_size(offsets), - rec_offs_size(offsets)); - - mach_write_to_4(buf, rec_offs_extra_size(offsets) + 4); - - } else if (!row_sel_store_mysql_rec( - buf, prebuilt, result_rec, NULL, TRUE, - clust_index, offsets)) { - err = DB_ERROR; - break; - } - - /* Step-7: Store cursor position to fetch next record. - MySQL calls this function iteratively get_next(), get_next() - fashion. */ - ut_ad(err == DB_SUCCESS); - index->last_sel_cur->rec = btr_pcur_get_rec(pcur); - index->last_sel_cur->block = btr_pcur_get_block(pcur); - - /* This is needed in order to restore the cursor if index - structure changes while SELECT is still active. */ - pcur->old_rec = dict_index_copy_rec_order_prefix( - index, rec, &pcur->old_n_fields, - &pcur->old_rec_buf, &pcur->buf_size); - - break; - } - - if (err != DB_SUCCESS) { - index->last_sel_cur->release(); - } - - if (heap != NULL) { - mem_heap_free(heap); - } - return(err); -} - /** Extract virtual column data from a virtual index record and fill a dtuple @param[in] rec the virtual (secondary) index record @param[in] index the virtual index @@ -4459,7 +4145,7 @@ row_sel_fill_vrow( } /** Searches for rows in the database using cursor. -Function is mainly used for tables that are shared accorss connection and +Function is mainly used for tables that are shared across connections and so it employs technique that can help re-construct the rows that transaction is suppose to see. It also has optimization such as pre-caching the rows, using AHI, etc. @@ -4719,7 +4405,6 @@ row_search_mvcc( mode = PAGE_CUR_GE; if (trx->mysql_n_tables_locked == 0 - && !prebuilt->ins_sel_stmt && prebuilt->select_lock_type == LOCK_NONE && trx->isolation_level > TRX_ISO_READ_UNCOMMITTED && MVCC::is_view_active(trx->read_view)) { diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 4e515bab30d..d4b8decaea7 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1032,9 +1032,8 @@ row_upd_build_difference_binary( n_diff = 0; trx_id_pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID); - ut_ad(dict_table_is_intrinsic(index->table) - || (dict_index_get_sys_col_pos(index, DATA_ROLL_PTR) - == trx_id_pos + 1)); + ut_ad(dict_index_get_sys_col_pos(index, DATA_ROLL_PTR) + == trx_id_pos + 1); if (!offsets) { offsets = rec_get_offsets(rec, index, offsets_, @@ -1058,8 +1057,7 @@ row_upd_build_difference_binary( } /* DB_ROLL_PTR */ - if (i == trx_id_pos + 1 - && !dict_table_is_intrinsic(index->table)) { + if (i == trx_id_pos + 1) { continue; } } @@ -2255,7 +2253,7 @@ row_upd_sec_index_entry( dberr_t err = DB_SUCCESS; trx_t* trx = thr_get_trx(thr); ulint mode; - ulint flags = 0; + ulint flags; enum row_search_result search_result; ut_ad(trx->id != 0); @@ -2273,9 +2271,7 @@ row_upd_sec_index_entry( entry = row_build_index_entry(node->row, node->ext, index, heap); ut_a(entry); - if (!dict_table_is_intrinsic(index->table)) { - log_free_check(); - } + log_free_check(); DEBUG_SYNC_C_IF_THD(trx->mysql_thd, "before_row_upd_sec_index_entry"); @@ -2288,12 +2284,10 @@ row_upd_sec_index_entry( on restart for recovery. Disable locking as temp-tables are not shared across connection. */ if (dict_table_is_temporary(index->table)) { - flags |= BTR_NO_LOCKING_FLAG; + flags = BTR_NO_LOCKING_FLAG; mtr.set_log_mode(MTR_LOG_NO_REDO); - - if (dict_table_is_intrinsic(index->table)) { - flags |= BTR_NO_UNDO_LOG_FLAG; - } + } else { + flags = 0; } if (!index->is_committed()) { @@ -2877,10 +2871,6 @@ row_upd_clust_rec( if (dict_table_is_temporary(index->table)) { flags |= BTR_NO_LOCKING_FLAG; mtr->set_log_mode(MTR_LOG_NO_REDO); - - if (dict_table_is_intrinsic(index->table)) { - flags |= BTR_NO_UNDO_LOG_FLAG; - } } /* NOTE: this transaction has an s-lock or x-lock on the record and @@ -3058,7 +3048,7 @@ row_upd_clust_step( ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets; ibool referenced; - ulint flags = 0; + ulint flags; ibool foreign = FALSE; trx_t* trx = thr_get_trx(thr); @@ -3085,12 +3075,10 @@ row_upd_clust_step( on restart for recovery. Disable locking as temp-tables are not shared across connection. */ if (dict_table_is_temporary(index->table)) { - flags |= BTR_NO_LOCKING_FLAG; + flags = BTR_NO_LOCKING_FLAG; mtr.set_log_mode(MTR_LOG_NO_REDO); - - if (dict_table_is_intrinsic(index->table)) { - flags |= BTR_NO_UNDO_LOG_FLAG; - } + } else { + flags = 0; } /* If the restoration does not succeed, then the same @@ -3290,9 +3278,8 @@ row_upd( switch (node->state) { case UPD_NODE_UPDATE_CLUSTERED: case UPD_NODE_INSERT_CLUSTERED: - if (!dict_table_is_intrinsic(node->table)) { - log_free_check(); - } + log_free_check(); + err = row_upd_clust_step(node, thr); if (err != DB_SUCCESS) { diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index e7ca007e73e..38f9744e2c6 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1046,10 +1046,7 @@ srv_init(void) srv_sys->n_sys_threads = n_sys_threads; - /* Even in read-only mode we flush pages related to intrinsic table - and so mutex creation is needed. */ - { - + if (!srv_read_only_mode) { mutex_create(LATCH_ID_SRV_SYS, &srv_sys->mutex); mutex_create(LATCH_ID_SRV_SYS_TASKS, &srv_sys->tasks_mutex); @@ -1119,7 +1116,7 @@ srv_free(void) mutex_free(&srv_innodb_monitor_mutex); mutex_free(&page_zip_stat_per_index_mutex); - { + if (!srv_read_only_mode) { mutex_free(&srv_sys->mutex); mutex_free(&srv_sys->tasks_mutex); diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 69d14ff5d1c..0c5007fbc13 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1247,13 +1247,12 @@ srv_shutdown_all_bg_threads() /* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM HERE OR EARLIER */ + if (srv_start_state_is_set(SRV_START_STATE_LOCK_SYS)) { + /* a. Let the lock timeout thread exit */ + os_event_set(lock_sys->timeout_event); + } + if (!srv_read_only_mode) { - - if (srv_start_state_is_set(SRV_START_STATE_LOCK_SYS)) { - /* a. Let the lock timeout thread exit */ - os_event_set(lock_sys->timeout_event); - } - /* b. srv error monitor thread exits automatically, no need to do anything here */ @@ -1270,31 +1269,31 @@ srv_shutdown_all_bg_threads() } if (srv_start_state_is_set(SRV_START_STATE_IO)) { + ut_ad(!srv_read_only_mode); + /* e. Exit the i/o threads */ - if (!srv_read_only_mode) { - if (recv_sys->flush_start != NULL) { - os_event_set(recv_sys->flush_start); - } - if (recv_sys->flush_end != NULL) { - os_event_set(recv_sys->flush_end); - } + if (recv_sys->flush_start != NULL) { + os_event_set(recv_sys->flush_start); + } + if (recv_sys->flush_end != NULL) { + os_event_set(recv_sys->flush_end); } os_event_set(buf_flush_event); - if (!buf_page_cleaner_is_active - && os_aio_all_slots_free()) { - os_aio_wake_all_threads_at_shutdown(); + /* f. dict_stats_thread is signaled from + logs_empty_and_mark_files_at_shutdown() and + should have already quit or is quitting right + now. */ + + if (srv_use_mtflush) { + /* g. Exit the multi threaded flush threads */ + buf_mtflu_io_thread_exit(); } } - /* f. dict_stats_thread is signaled from - logs_empty_and_mark_files_at_shutdown() and should have - already quit or is quitting right now. */ - - if (srv_use_mtflush) { - /* g. Exit the multi threaded flush threads */ - buf_mtflu_io_thread_exit(); + if (!buf_page_cleaner_is_active && os_aio_all_slots_free()) { + os_aio_wake_all_threads_at_shutdown(); } bool active = os_thread_active(); @@ -1465,8 +1464,9 @@ innobase_start_or_create_for_mysql(void) if (srv_read_only_mode) { ib::info() << "Started in read only mode"; - /* There is no write except to intrinsic table and so turn-off - doublewrite mechanism completely. */ + /* There is no write to InnoDB tablespaces (not even + temporary ones, because also CREATE TEMPORARY TABLE is + refused in read-only mode). */ srv_use_doublewrite_buf = FALSE; } @@ -1851,26 +1851,26 @@ innobase_start_or_create_for_mysql(void) thread_started[t] = true; } - /* Even in read-only mode there could be flush job generated by - intrinsic table operations. */ - buf_flush_page_cleaner_init(); + if (!srv_read_only_mode) { + buf_flush_page_cleaner_init(); - os_thread_create(buf_flush_page_cleaner_coordinator, - NULL, NULL); - - buf_flush_page_cleaner_thread_started = true; - - for (i = 1; i < srv_n_page_cleaners; ++i) { - os_thread_create(buf_flush_page_cleaner_worker, + os_thread_create(buf_flush_page_cleaner_coordinator, NULL, NULL); - } - /* Make sure page cleaner is active. */ - while (!buf_page_cleaner_is_active) { - os_thread_sleep(10000); - } + buf_flush_page_cleaner_thread_started = true; - srv_start_state_set(SRV_START_STATE_IO); + for (i = 1; i < srv_n_page_cleaners; ++i) { + os_thread_create(buf_flush_page_cleaner_worker, + NULL, NULL); + } + + /* Make sure page cleaner is active. */ + while (!buf_page_cleaner_is_active) { + os_thread_sleep(10000); + } + + srv_start_state_set(SRV_START_STATE_IO); + } if (srv_n_log_files * srv_log_file_size * UNIV_PAGE_SIZE >= 512ULL * 1024ULL * 1024ULL * 1024ULL) { @@ -2570,10 +2570,10 @@ files_checked: purge_sys->state = PURGE_STATE_DISABLED; } - /* wake main loop of page cleaner up */ - os_event_set(buf_flush_event); - if (!srv_read_only_mode) { + /* wake main loop of page cleaner up */ + os_event_set(buf_flush_event); + if (srv_use_mtflush) { /* Start multi-threaded flush threads */ mtflush_ctx = buf_mtflu_handler_init( From 9320d8ae30c18420bef659618175836221d363ea Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 11 Dec 2016 01:12:33 +0400 Subject: [PATCH 015/135] MDEV-11453 JSON_CONTAINS returns incorrect values. The weird logic of json_contains was implemented. --- include/json_lib.h | 1 + mysql-test/r/func_json.result | 51 +++++++ mysql-test/t/func_json.test | 17 +++ sql/item_jsonfunc.cc | 245 ++++++++++++++++++++++------------ sql/item_jsonfunc.h | 8 +- strings/json_lib.c | 7 + 6 files changed, 237 insertions(+), 92 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index b2ea39cd728..abef3e60db6 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -311,6 +311,7 @@ int json_skip_level(json_engine_t *j); */ #define json_value_scalar(je) ((je)->value_type > JSON_VALUE_ARRAY) + /* Look for the JSON PATH in the json string. Function can be called several times with same JSON/PATH to diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index bae7da495b0..c972057e37c 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -90,6 +90,57 @@ json_contains('"youth"', '"you"') 0 select json_contains('[1]', '[1]', '$', '$[0]'); ERROR 42000: Incorrect parameter count in the call to native function 'json_contains' +select json_contains('', '', '$'); +json_contains('', '', '$') +0 +select json_contains('null', 'null', '$'); +json_contains('null', 'null', '$') +1 +select json_contains('"10"', '"10"', '$'); +json_contains('"10"', '"10"', '$') +1 +select json_contains('"10"', '10', '$'); +json_contains('"10"', '10', '$') +0 +select json_contains('10.1', '10', '$'); +json_contains('10.1', '10', '$') +0 +select json_contains('10.0', '10', '$'); +json_contains('10.0', '10', '$') +1 +select json_contains('[1]', '1'); +json_contains('[1]', '1') +1 +select json_contains('[2, 1]', '1'); +json_contains('[2, 1]', '1') +1 +select json_contains('[2, [2, 3], 1]', '1'); +json_contains('[2, [2, 3], 1]', '1') +1 +select json_contains('[4, [2, 3], 1]', '2'); +json_contains('[4, [2, 3], 1]', '2') +1 +select json_contains('[2, 1]', '[1, 2]'); +json_contains('[2, 1]', '[1, 2]') +1 +select json_contains('[2, 1]', '[1, 0, 2]'); +json_contains('[2, 1]', '[1, 0, 2]') +0 +select json_contains('[2, 0, 3, 1]', '[1, 2]'); +json_contains('[2, 0, 3, 1]', '[1, 2]') +1 +select json_contains('{"b":[1,2], "a":1}', '{"a":1, "b":2}'); +json_contains('{"b":[1,2], "a":1}', '{"a":1, "b":2}') +1 +select json_contains('{"a":1}', '{}'); +json_contains('{"a":1}', '{}') +1 +select json_contains('[1, {"a":1}]', '{}'); +json_contains('[1, {"a":1}]', '{}') +1 +select json_contains('[1, {"a":1}]', '{"a":1}'); +json_contains('[1, {"a":1}]', '{"a":1}') +1 select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]"); json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]") 1 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 12e1c742a26..d3d75fa3913 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -36,6 +36,23 @@ select json_contains('"you"', '"you"'); select json_contains('"youth"', '"you"'); --error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT select json_contains('[1]', '[1]', '$', '$[0]'); +select json_contains('', '', '$'); +select json_contains('null', 'null', '$'); +select json_contains('"10"', '"10"', '$'); +select json_contains('"10"', '10', '$'); +select json_contains('10.1', '10', '$'); +select json_contains('10.0', '10', '$'); +select json_contains('[1]', '1'); +select json_contains('[2, 1]', '1'); +select json_contains('[2, [2, 3], 1]', '1'); +select json_contains('[4, [2, 3], 1]', '2'); +select json_contains('[2, 1]', '[1, 2]'); +select json_contains('[2, 1]', '[1, 0, 2]'); +select json_contains('[2, 0, 3, 1]', '[1, 2]'); +select json_contains('{"b":[1,2], "a":1}', '{"a":1, "b":2}'); +select json_contains('{"a":1}', '{}'); +select json_contains('[1, {"a":1}]', '{}'); +select json_contains('[1, {"a":1}]', '{"a":1}'); select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]"); select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[10]"); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index adb0912f1fc..e3fa34cd72c 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -596,39 +596,162 @@ error: } -bool Item_func_json_contains::fix_fields(THD *thd, Item **ref) -{ - return alloc_tmp_paths(thd, arg_count-2, &paths, &tmp_paths) || - Item_int_func::fix_fields(thd, ref); -} - - void Item_func_json_contains::fix_length_and_dec() { a2_constant= args[1]->const_item(); a2_parsed= FALSE; - mark_constant_paths(paths, args+2, arg_count-2); + if (arg_count > 2) + path.set_constant_flag(args[2]->const_item()); Item_int_func::fix_length_and_dec(); } -void Item_func_json_contains::cleanup() +static int find_key_in_object(json_engine_t *j, json_string_t *key) { - if (tmp_paths) + const uchar *c_str= key->c_str; + + while (json_scan_next(j) == 0 && j->state != JST_OBJ_END) { - for (uint i= arg_count-2; i>0; i--) - tmp_paths[i-1].free(); - tmp_paths= 0; + DBUG_ASSERT(j->state == JST_KEY); + if (json_key_matches(j, key)) + return TRUE; + if (json_skip_key(j)) + return FALSE; + key->c_str= c_str; } - Item_int_func::cleanup(); + + return FALSE; +} + + +static int check_contains(json_engine_t *js, json_engine_t *value) +{ + json_engine_t loc_js; + bool set_js; + + switch (js->value_type) + { + case JSON_VALUE_OBJECT: + { + json_string_t key_name; + + if (value->value_type != JSON_VALUE_OBJECT) + return FALSE; + + loc_js= *js; + set_js= FALSE; + json_string_set_cs(&key_name, value->s.cs); + while (json_scan_next(value) == 0 && value->state != JST_OBJ_END) + { + const uchar *k_start, *k_end; + + DBUG_ASSERT(value->state == JST_KEY); + k_start= value->s.c_str; + while (json_read_keyname_chr(value) == 0) + k_end= value->s.c_str; + + if (value->s.error || json_read_value(value)) + return FALSE; + + if (set_js) + *js= loc_js; + else + set_js= TRUE; + + json_string_set_str(&key_name, k_start, k_end); + if (!find_key_in_object(js, &key_name) || + json_read_value(js) || + !check_contains(js, value)) + return FALSE; + } + + return value->state == JST_OBJ_END && !json_skip_level(js); + } + case JSON_VALUE_ARRAY: + if (value->value_type != JSON_VALUE_ARRAY) + { + while (json_scan_next(js) == 0 && js->state != JST_ARRAY_END) + { + DBUG_ASSERT(js->state == JST_VALUE); + if (json_read_value(js)) + return FALSE; + + if (check_contains(js, value)) + { + if (json_skip_level(js)) + return FALSE; + return TRUE; + } + if (value->s.error || js->s.error) + return FALSE; + } + return FALSE; + } + /* else */ + loc_js= *js; + set_js= FALSE; + while (json_scan_next(value) == 0 && value->state != JST_ARRAY_END) + { + DBUG_ASSERT(value->state == JST_VALUE); + if (json_read_value(value)) + return FALSE; + + if (set_js) + *js= loc_js; + else + set_js= TRUE; + if (!check_contains(js, value)) + return FALSE; + } + + return value->state == JST_ARRAY_END; + + case JSON_VALUE_STRING: + if (value->value_type != JSON_VALUE_STRING) + return FALSE; + /* + TODO: make proper json-json comparison here that takes excapint + into account. + */ + return value->value_len == js->value_len && + memcmp(value->value, js->value, value->value_len) == 0; + case JSON_VALUE_NUMBER: + if (value->value_type == JSON_VALUE_NUMBER) + { + double d_j, d_v; + char *end; + int err; + + d_j= my_strntod(js->s.cs, (char *) js->value, js->value_len, + &end, &err);; + d_v= my_strntod(value->s.cs, (char *) value->value, value->value_len, + &end, &err);; + + return (fabs(d_j - d_v) < 1e-12); + } + else + return FALSE; + + default: + break; + } + + /* + We have these not mentioned in the 'switch' above: + + case JSON_VALUE_TRUE: + case JSON_VALUE_FALSE: + case JSON_VALUE_NULL: + */ + return value->value_type == js->value_type; } longlong Item_func_json_contains::val_int() { String *js= args[0]->val_str(&tmp_js); - json_engine_t je; - uint n_arg; + json_engine_t je, ve; + int result; if ((null_value= args[0]->null_value)) return 0; @@ -648,54 +771,37 @@ longlong Item_func_json_contains::val_int() json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - if (arg_count<3) /* No path specified. */ - { - if (json_read_value(&je)) - goto error; - String jv_str((const char *)je.value_begin, - je.value_end - je.value_begin, js->charset()); - return val->eq(&jv_str, js->charset()); - } - - for (n_arg=2; n_arg < arg_count; n_arg++) + if (arg_count>2) /* Path specified. */ { uint array_counters[JSON_DEPTH_LIMIT]; - json_path_with_flags *c_path= paths + n_arg - 2; - if (!c_path->parsed) + if (!path.parsed) { - String *s_p= args[n_arg]->val_str(tmp_paths+(n_arg-2)); + String *s_p= args[2]->val_str(&tmp_path); if (s_p && - json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) + json_path_setup(&path.p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->end())) goto error; - c_path->parsed= c_path->constant; + path.parsed= path.constant; } - - if (args[n_arg]->null_value) + if (args[2]->null_value) goto error; - json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), - (const uchar *) js->ptr() + js->length()); - - c_path->cur_step= c_path->p.steps; - if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) - { - /* Path wasn't found. */ - if (je.s.error) - goto error; - continue; - } - - if (json_read_value(&je)) + path.cur_step= path.p.steps; + if (json_find_path(&je, &path.p, &path.cur_step, array_counters)) goto error; - String jv_str((const char *)je.value_begin, - je.value_end - je.value_begin, js->charset()); - if (val->eq(&jv_str, js->charset())) - return 1; } + json_scan_start(&ve, val->charset(),(const uchar *) val->ptr(), + (const uchar *) val->end()); - return 0; + if (json_read_value(&je) || json_read_value(&ve)) + return FALSE; + + result= check_contains(&je, &ve); + if (je.s.error || ve.s.error) + goto error; + + return result; error: null_value= 1; @@ -2002,41 +2108,6 @@ static int append_json_path(String *str, const json_path_t *p) } -#ifdef DUMMY -static int json_path_compare(const json_path_t *a, const json_path_t *b) -{ - uint i, a_len= a->last_step - a->steps, b_len= b->last_step - b->steps; - - if (a_len > b_len) - return -2; - - for (i=0; i <= a_len; i++) - { - const json_path_step_t *sa= a->steps + i; - const json_path_step_t *sb= b->steps + i; - - if (!((sa->type & sb->type) & JSON_PATH_KEY_OR_ARRAY)) - return -1; - - if (sa->type & JSON_PATH_ARRAY) - { - if (!(sa->type & JSON_PATH_WILD) && sa->n_item != sb->n_item) - return -1; - } - else /* JSON_PATH_KEY */ - { - if (!(sa->type & JSON_PATH_WILD) && - (sa->key_end - sa->key != sb->key_end - sb->key || - memcmp(sa->key, sb->key, sa->key_end - sa->key) != 0)) - return -1; - } - } - - return b_len > a_len; -} -#endif /*DUMMY*/ - - static int json_path_compare(const json_path_t *a, const json_path_t *b) { const json_path_step_t *sa= a->steps + 1; diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index da9baf47648..e6f26d95b13 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -174,17 +174,15 @@ class Item_func_json_contains: public Item_int_func { protected: String tmp_js; - json_path_with_flags *paths; - String *tmp_paths; + json_path_with_flags path; + String tmp_path; bool a2_constant, a2_parsed; String tmp_val, *val; public: Item_func_json_contains(THD *thd, List &list): - Item_int_func(thd, list), tmp_paths(0) {} + Item_int_func(thd, list) {} const char *func_name() const { return "json_contains"; } - bool fix_fields(THD *thd, Item **ref); void fix_length_and_dec(); - void cleanup(); longlong val_int(); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } diff --git a/strings/json_lib.c b/strings/json_lib.c index a9498070195..015ce1f39f8 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1182,6 +1182,13 @@ int json_skip_level(json_engine_t *j) int json_skip_key(json_engine_t *j) { + if (j->state == JST_KEY) + { + while (json_read_keyname_chr(j) == 0); + if (j->s.error) + return 1; + } + if (json_read_value(j)) return 1; From e76183f0996ba97bf987f2b2d3e7f12d32055703 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 12 Dec 2016 15:35:08 +1100 Subject: [PATCH 016/135] MDEV-11075: Power - runtime detection of optimized instructions Signed-off-by: Daniel Black --- storage/innobase/ut/ut0crc32.cc | 16 ++++++++++++++-- storage/xtradb/ut/ut0crc32.cc | 10 ++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 386d32f6a60..1a5890eed42 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -83,6 +83,12 @@ mysys/my_perf.c, contributed by Facebook under the following license. #include "my_config.h" #include +#if defined(__linux__) && defined(HAVE_CRC32_VPMSUM) +/* Used to detect at runtime if we have vpmsum instructions (PowerISA 2.07) */ +#include +#include +#endif + #include "univ.i" #include "ut0crc32.h" @@ -740,8 +746,14 @@ ut_crc32_init() } #elif defined(HAVE_CRC32_VPMSUM) - ut_crc32 = ut_crc32_power8; - ut_crc32_implementation = "Using POWER8 crc32 instructions"; +#if defined(__linux__) + if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) { +#endif + ut_crc32 = ut_crc32_power8; + ut_crc32_implementation = "Using POWER8 crc32 instructions"; +#if defined(__linux__) + } +#endif #endif } diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index 15ed6bfadee..f8981ee544d 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -336,7 +336,13 @@ ut_crc32_init() } #elif defined(HAVE_CRC32_VPMSUM) - ut_crc32 = ut_crc32_power8; - ut_crc32_implementation = "Using POWER8 crc32 instructions"; +#if defined(__linux__) + if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) { +#endif + ut_crc32 = ut_crc32_power8; + ut_crc32_implementation = "Using POWER8 crc32 instructions"; +#if defined(__linux__) + } +#endif #endif } From 855f0b9b16c22b439743ee06ead97421622b4c00 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 18 Mar 2016 14:12:03 +0100 Subject: [PATCH 017/135] update RPM metadata (vendor and contact) --- cmake/mysql_version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 5033c8b5213..87d61fcf344 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -90,8 +90,8 @@ ENDIF() IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME) SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-${VERSION}") ENDIF() -SET(CPACK_PACKAGE_CONTACT "MariaDB team ") -SET(CPACK_PACKAGE_VENDOR "Monty Program AB") +SET(CPACK_PACKAGE_CONTACT "MariaDB Developers ") +SET(CPACK_PACKAGE_VENDOR "MariaDB Foundation") SET(CPACK_SOURCE_GENERATOR "TGZ") # Defintions for windows version resources From e336fc07bdd4e81b7bf085e323610d7e251d542c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 25 Oct 2016 15:47:53 +0200 Subject: [PATCH 018/135] fix stack traces when linking with libbfd also, return different values for different errors in my_addr_resolve() --- mysys/my_addr_resolve.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c index 72b04119855..83716bf11e1 100644 --- a/mysys/my_addr_resolve.c +++ b/mysys/my_addr_resolve.c @@ -34,6 +34,13 @@ static const char *strip_path(const char *s) return prev; } +#if defined(HAVE_LINK_H) && defined(HAVE_DLOPEN) +#include +static ptrdiff_t offset= 0; +#else +#define offset 0 +#endif + /* The following is very much single-threaded code and it's only supposed to be used on shutdown or for a crash report @@ -60,7 +67,7 @@ static asymbol **symtable= 0; */ int my_addr_resolve(void *ptr, my_addr_loc *loc) { - bfd_vma addr= (intptr)ptr; + bfd_vma addr= (intptr)ptr - offset; asection *sec; for (sec= bfdh->sections; sec; sec= sec->next) @@ -103,6 +110,12 @@ const char *my_addr_resolve_init() uint unused; char **matching; +#if defined(HAVE_LINK_H) && defined(HAVE_DLOPEN) + struct link_map *lm = (struct link_map*) dlopen(0, RTLD_NOW); + if (lm) + offset= lm->l_addr; +#endif + bfdh= bfd_openr(my_progname, NULL); if (!bfdh) goto err; @@ -133,13 +146,6 @@ err: #include #include -#if defined(HAVE_LINK_H) && defined(HAVE_DLOPEN) -#include -static ptrdiff_t offset= 0; -#else -#define offset 0 -#endif - static int in[2], out[2]; static int initialized= 0; static char output[1024]; @@ -174,7 +180,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) extra_bytes_read= read(out[0], output + total_bytes_read, sizeof(output) - total_bytes_read); if (extra_bytes_read < 0) - return 1; + return 2; /* Timeout or max bytes read. */ if (extra_bytes_read == 0) break; @@ -184,7 +190,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) /* Failed starting addr2line. */ if (total_bytes_read == 0) - return 1; + return 3; /* Go through the addr2line response and get the required data. The response is structured in 2 lines. The first line contains the function @@ -205,14 +211,14 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) } /* Response is malformed. */ if (filename_start == -1 || line_number_start == -1) - return 1; + return 4; loc->func= output; loc->file= output + filename_start; /* Addr2line was unable to extract any meaningful information. */ if (strcmp(loc->file, "??") == 0) - return 1; + return 5; loc->file= strip_path(loc->file); From b8dfedd7473c233bbb3c6fdb604a458529430904 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 18 Oct 2016 16:46:53 +0200 Subject: [PATCH 019/135] the mysql-test combination is 'innodb' not 'xtradb' --- mysql-test/include/have_innodb.combinations | 14 ++++++++++++++ mysql-test/suite.pm | 7 ++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations index 49ae741b269..e893da0a313 100644 --- a/mysql-test/include/have_innodb.combinations +++ b/mysql-test/include/have_innodb.combinations @@ -43,3 +43,17 @@ innodb-buffer-page-lru innodb-sys-foreign innodb-sys-foreign-cols innodb-sys-tables + +[innodb] +innodb +innodb-cmpmem +innodb-cmp-per-index +innodb-trx +innodb-locks +innodb-metrics +innodb-buffer-pool-stats +innodb-buffer-page +innodb-buffer-page-lru +innodb-sys-foreign +innodb-sys-foreign-cols +innodb-sys-tables diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index cc735638be9..f501e610e53 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -9,9 +9,10 @@ sub skip_combinations { # disable innodb/xtradb combinatons for configurations that were not built push @combinations, 'innodb_plugin' unless $ENV{HA_INNODB_SO}; - # if something is compiled in, it's xtradb. innodb is MODULE_ONLY: - push @combinations, 'xtradb' unless $::mysqld_variables{'innodb'} eq "ON"; - push @combinations, 'innodb'; + push @combinations, qw(xtradb innodb) unless $::mysqld_variables{'innodb'} eq "ON"; + + # unconditionally, for now in 10.2. Later it could check for xtradb I_S plugins + push @combinations, 'xtradb'; # XtraDB is RECOMPILE_FOR_EMBEDDED, ha_xtradb.so cannot work with embedded server push @combinations, 'xtradb_plugin' if not $ENV{HA_XTRADB_SO} From f7dcd8a0e8eeaa2b940ecc180453a8d0f82c25de Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 23 Oct 2016 00:13:11 +0200 Subject: [PATCH 020/135] shut up annoying InnoDB warning when --gdb --- storage/innobase/buf/buf0flu.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 26e0da4e371..179430a0d27 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -3237,7 +3237,8 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)( if (ret_sleep == OS_SYNC_TIME_EXCEEDED) { ulint curr_time = ut_time_ms(); - if (curr_time > next_loop_time + 3000) { + if (curr_time > next_loop_time + 3000 + && !(test_flags & TEST_SIGINT)) { if (warn_count == 0) { ib::info() << "page_cleaner: 1000ms" " intended loop took " From 0852cf534a7828e9ff114915eb8da0fa03c471ec Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 15 Oct 2016 23:51:03 +0200 Subject: [PATCH 021/135] say MariaDB in InnoDB error messages, not MySQL --- .../innodb/r/innodb-corrupted-table.result | 12 ++-- .../innodb/t/innodb-corrupted-table.test | 4 +- .../suite/sys_vars/r/sysvars_innodb.result | 4 +- storage/innobase/handler/ha_innodb.cc | 58 +++++++++---------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result index 94203a794f8..1a8cea06c4c 100644 --- a/mysql-test/suite/innodb/r/innodb-corrupted-table.result +++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result @@ -1,5 +1,5 @@ -call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); -call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MariaDB.*"); create table t1 (pk int, i int, key(i)) engine=InnoDB; insert into t1 values (1,1),(2,2); flush tables; @@ -14,18 +14,18 @@ t1 CREATE TABLE `t1` ( KEY `i` (`i`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Warnings: -Warning 1082 InnoDB: Table test/t1 has a primary key in InnoDB data dictionary, but not in MySQL! -Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +Warning 1082 InnoDB: Table test/t1 has a primary key in InnoDB data dictionary, but not in MariaDB! +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB select * from t1; pk i 1 1 2 2 alter table t1 add j int; Warnings: -Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB show warnings; Level Code Message -Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test index 94c5454429f..60da461a33c 100644 --- a/mysql-test/suite/innodb/t/innodb-corrupted-table.test +++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test @@ -5,8 +5,8 @@ # MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD # -call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); -call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MariaDB.*"); create table t1 (pk int, i int, key(i)) engine=InnoDB; insert into t1 values (1,1),(2,2); diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index d87d52c850a..c298c98ac99 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -488,7 +488,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE crc32 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM -VARIABLE_COMMENT The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by MySQL versions older than 5.6.3 +VARIABLE_COMMENT The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by InnoDB versions older than 5.6.3 NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL @@ -1930,7 +1930,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Print all deadlocks to MySQL error log (off by default) +VARIABLE_COMMENT Print all deadlocks to MariaDB error log (off by default) NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ea6797d2229..234a8447504 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4976,7 +4976,7 @@ innobase_commit( if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) { - sql_print_error("Transaction not registered for MySQL 2PC," + sql_print_error("Transaction not registered for MariaDB 2PC," " but transaction is active"); } @@ -5490,7 +5490,7 @@ innobase_close_connection( if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) { - sql_print_error("Transaction not registered for MySQL 2PC, " + sql_print_error("Transaction not registered for MariaDB 2PC, " "but transaction is active"); } @@ -5511,7 +5511,7 @@ innobase_close_connection( } } else { sql_print_warning( - "MySQL is closing a connection that has an active " + "MariaDB is closing a connection that has an active " "InnoDB transaction. " TRX_ID_FMT " row modifications " "will roll back.", " row modifications will roll back.", @@ -6485,7 +6485,7 @@ innobase_build_index_translation( if (!innobase_match_index_columns(&table->key_info[count], index_mapping[count])) { sql_print_error("Found index %s whose column info" - " does not match that of MySQL.", + " does not match that of MariaDB.", table->key_info[count].name); ret = false; goto func_exit; @@ -6670,7 +6670,7 @@ ha_innobase::innobase_initialize_autoinc() break; } case DB_RECORD_NOT_FOUND: - ib::error() << "MySQL and InnoDB data dictionaries are" + ib::error() << "MariaDB and InnoDB data dictionaries are" " out of sync. Unable to find the AUTOINC" " column " << col_name << " in the InnoDB" " table " << index->table->name << ". We set" @@ -6773,7 +6773,7 @@ ha_innobase::open( ib::warn() << "Table " << norm_name << " contains " << dict_table_get_n_user_cols(ib_table) << " user" " defined columns in InnoDB, but " << table->s->stored_fields - << " columns in MySQL. Please check" + << " columns in MariaDB. Please check" " INFORMATION_SCHEMA.INNODB_SYS_COLUMNS and " REFMAN "innodb-troubleshooting.html for how to resolve the" " issue."; @@ -7362,7 +7362,7 @@ wsrep_innobase_mysql_sort( if (charset == NULL) { sql_print_error("InnoDB needs charset %lu for doing " - "a comparison, but MySQL cannot " + "a comparison, but MariaDB cannot " "find that charset.", (ulong) charset_number); ut_a(0); @@ -11527,7 +11527,7 @@ ha_innobase::wsrep_append_keys( keyval1[0] = (char)i; if (!tab) { - WSREP_WARN("MySQL-InnoDB key mismatch %s %s", + WSREP_WARN("MariaDB-InnoDB key mismatch %s %s", table->s->table_name.str, key_info->name); } @@ -12403,7 +12403,7 @@ create_index( case DATA_DOUBLE: case DATA_DECIMAL: sql_print_error( - "MySQL is trying to create a column" + "MariaDB is trying to create a column" " prefix index field, on an" " inappropriate data type. Table" " name %s, column name %s.", @@ -14602,9 +14602,9 @@ ha_innobase::delete_table( tbl_name.m_name = norm_name; ib::error() << "Table " << tbl_name << " does not exist in the InnoDB" - " internal data dictionary though MySQL is" + " internal data dictionary though MariaDB is" " trying to drop it. Have you copied the .frm" - " file of the table to the MySQL database" + " file of the table to the MariaDB database" " directory from another database? " << TROUBLESHOOTING_MSG; } @@ -15204,9 +15204,9 @@ innobase_rename_table( if (error == DB_TABLE_NOT_FOUND) { ib::error() << "Table " << ut_get_name(trx, norm_from) << " does not exist in the InnoDB internal" - " data dictionary though MySQL is trying to" + " data dictionary though MariaDB is trying to" " rename the table. Have you copied the .frm" - " file of the table to the MySQL database" + " file of the table to the MariaDB database" " directory from another database? " << TROUBLESHOOTING_MSG; } @@ -15832,7 +15832,7 @@ innobase_get_mysql_key_number_for_index( if (index->is_committed()) { sql_print_warning( "Found index %s in InnoDB index list" - " but not its MySQL index number." + " but not its MariaDB index number." " It could be an InnoDB internal" " index.", index->name()); @@ -15954,7 +15954,7 @@ ha_innobase::info_low( /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ - m_prebuilt->trx->op_info = (char*)"returning various info to MySQL"; + m_prebuilt->trx->op_info = (char*)"returning various info to MariaDB"; trx_search_latch_release_if_reserved(m_prebuilt->trx); @@ -15991,7 +15991,7 @@ ha_innobase::info_low( } m_prebuilt->trx->op_info = - "returning various info to MySQL"; + "returning various info to MariaDB"; } @@ -16211,7 +16211,7 @@ ha_innobase::info_low( sql_print_error( "Index %s of %s has %lu columns" " unique inside InnoDB, but" - " MySQL is asking statistics for" + " MariaDB is asking statistics for" " %lu columns. Have you mixed" " up .frm files from different" " installations? %s", @@ -19194,7 +19194,7 @@ innobase_xa_prepare( if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) { - sql_print_error("Transaction not registered for MySQL 2PC," + sql_print_error("Transaction not registered for MariaDB 2PC," " but transaction is active"); } @@ -21878,7 +21878,7 @@ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, " write a constant magic number, do not allow values other than that" " magic number when reading;" " Files updated when this option is set to crc32 or strict_crc32 will" - " not be readable by MySQL versions older than 5.6.3", + " not be readable by InnoDB versions older than 5.6.3", NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, &innodb_checksum_algorithm_typelib); @@ -22850,7 +22850,7 @@ static MYSQL_SYSVAR_BOOL(status_output_locks, srv_print_innodb_lock_monitor, static MYSQL_SYSVAR_BOOL(print_all_deadlocks, srv_print_all_deadlocks, PLUGIN_VAR_OPCMDARG, - "Print all deadlocks to MySQL error log (off by default)", + "Print all deadlocks to MariaDB error log (off by default)", NULL, NULL, FALSE); static MYSQL_SYSVAR_ULONG(compression_failure_threshold_pct, @@ -24389,7 +24389,7 @@ ib_push_frm_error( case DICT_FRM_NO_PK: sql_print_error("Table %s has a primary key in " "InnoDB data dictionary, but not " - "in MySQL!" + "in MariaDB!" " Have you mixed up " ".frm files from different " "installations? See " @@ -24403,17 +24403,17 @@ ib_push_frm_error( "InnoDB: Table %s has a " "primary key in InnoDB data " "dictionary, but not in " - "MySQL!", ib_table->name); + "MariaDB!", ib_table->name); } break; case DICT_NO_PK_FRM_HAS: sql_print_error( "Table %s has no primary key in InnoDB data " - "dictionary, but has one in MySQL! If you " - "created the table with a MySQL version < " + "dictionary, but has one in MariaDB! If you " + "created the table with a MariaDB version < " "3.23.54 and did not define a primary key, " "but defined a unique key with all non-NULL " - "columns, then MySQL internally treats that " + "columns, then MariaDB internally treats that " "key as the primary key. You can fix this " "error by dump + DROP + CREATE + reimport " "of the table.", ib_table->name); @@ -24424,7 +24424,7 @@ ib_push_frm_error( "InnoDB: Table %s has no " "primary key in InnoDB data " "dictionary, but has one in " - "MySQL!", + "MariaDB!", ib_table->name); } break; @@ -24433,7 +24433,7 @@ ib_push_frm_error( sql_print_error("InnoDB: Table %s contains %lu " "indexes inside InnoDB, which " "is different from the number of " - "indexes %u defined in the MySQL " + "indexes %u defined in the MariaDB " " Have you mixed up " ".frm files from different " "installations? See " @@ -24448,7 +24448,7 @@ ib_push_frm_error( "InnoDB: Table %s contains %lu " "indexes inside InnoDB, which " "is different from the number of " - "indexes %u defined in the MySQL ", + "indexes %u defined in the MariaDB ", ib_table->name, n_keys, table->s->keys); } @@ -24457,7 +24457,7 @@ ib_push_frm_error( case DICT_FRM_CONSISTENT: default: sql_print_error("InnoDB: Table %s is consistent " - "on InnoDB data dictionary and MySQL " + "on InnoDB data dictionary and MariaDB " " FRM file.", ib_table->name); ut_error; From a838b10466b537314f4f15c035ba9680234bdd72 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 09:24:23 +0100 Subject: [PATCH 022/135] bugfix: delayed insert table was using other table's expr_arena --- sql/sql_insert.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 7c0c1b68a2b..ef17c3f1f10 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2451,6 +2451,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) goto error; dfield_ptr= copy->default_field; } + copy->expr_arena= NULL; /* Ensure we don't use the table list of the original table */ copy->pos_in_table_list= 0; From 96bb5f44d87e31e38237411ae8d532d4df89a10d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 3 Nov 2016 17:30:17 +0100 Subject: [PATCH 023/135] bugfix: returning on-the-stack buffer to the caller --- sql/sql_show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index de284cbe39d..da24eb2a5c3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1706,7 +1706,7 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, if (quoted) append_unescaped(def_value, def_val.ptr(), def_val.length()); else - def_value->move(def_val); + def_value->append(def_val); } else if (quoted) def_value->set(STRING_WITH_LEN("''"), system_charset_info); From 660355c1acf70cc30e6a69000a1c5357a84fdc60 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 2 Nov 2016 21:08:49 +0100 Subject: [PATCH 024/135] bugfix: Item_func_get_system_var::print() --- mysql-test/r/variables.result | 20 ++++++++++++++++++++ mysql-test/t/variables.test | 8 ++++++++ sql/item_func.cc | 17 ++++++++++++++++- sql/sql_string.h | 6 ++---- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 6c2a331d66b..760e11e8193 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1801,3 +1801,23 @@ select * from information_schema.session_variables where variable_name='sql_mode VARIABLE_NAME VARIABLE_VALUE SQL_MODE ANSI_QUOTES End of 5.5 tests +explain extended select @@VERsion from dual where rand() > @@verSION; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select @@VERsion AS "@@VERsion" from DUAL where (rand() > @@version) +explain extended select @@SESsion.SQL_mode from dual where rand() > @@sesSION.sql_MODE; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select @@SESsion.SQL_mode AS "@@SESsion.SQL_mode" from DUAL where (rand() > @@sql_mode) +explain extended select @@GLObal.COLLATION_connection from dual where rand() > @@gloBAL.collation_CONNECTION; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select @@GLObal.COLLATION_connection AS "@@GLObal.COLLATION_connection" from DUAL where (rand() > @@global.collation_connection) +explain extended select @@FOObar.KEY_BUFfer_size from dual where rand() > @@fooBAR.key_bufFER_SIZE; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select @@FOObar.KEY_BUFfer_size AS "@@FOObar.KEY_BUFfer_size" from DUAL where (rand() > @@fooBAR.key_buffer_size) diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 4d97f380dff..ed6e92f145e 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1532,3 +1532,11 @@ show global status like 'foobar'; select * from information_schema.session_variables where variable_name='sql_mode'; --echo End of 5.5 tests + +# +# test Item_func_get_system_var::print() +# +explain extended select @@VERsion from dual where rand() > @@verSION; +explain extended select @@SESsion.SQL_mode from dual where rand() > @@sesSION.sql_MODE; +explain extended select @@GLObal.COLLATION_connection from dual where rand() > @@gloBAL.collation_CONNECTION; +explain extended select @@FOObar.KEY_BUFfer_size from dual where rand() > @@fooBAR.key_bufFER_SIZE; diff --git a/sql/item_func.cc b/sql/item_func.cc index 3b98dd0d345..b03e65a2431 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5841,7 +5841,22 @@ void Item_func_get_system_var::fix_length_and_dec() void Item_func_get_system_var::print(String *str, enum_query_type query_type) { - str->append(name, name_length); + if (name_length) + str->append(name, name_length); + else + { + str->append(STRING_WITH_LEN("@@")); + if (component.length) + { + str->append(&component); + str->append('.'); + } + else if (var_type == SHOW_OPT_GLOBAL && var->scope() != sys_var::GLOBAL) + { + str->append(STRING_WITH_LEN("global.")); + } + str->append(&var->name); + } } bool Item_func_get_system_var::check_vcol_func_processor(void *arg) diff --git a/sql/sql_string.h b/sql/sql_string.h index e51d089709e..8be23184741 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -466,10 +466,8 @@ public: } bool append(const String &s); bool append(const char *s); - bool append(const LEX_STRING *ls) - { - return append(ls->str, ls->length); - } + bool append(const LEX_STRING *ls) { return append(ls->str, ls->length); } + bool append(const LEX_CSTRING *ls) { return append(ls->str, ls->length); } bool append(const char *s, uint32 arg_length); bool append(const char *s, uint32 arg_length, CHARSET_INFO *cs); bool append_ulonglong(ulonglong val); From 232dc91bc957bfc3e08d08cec940d5fc8021799e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 3 Nov 2016 22:40:19 +0100 Subject: [PATCH 025/135] bugfix: Item_func_like::print() was losing ESCAPE clause --- mysql-test/r/func_like.result | 8 ++++++++ mysql-test/t/func_like.test | 8 ++++++++ sql/item_cmpfunc.cc | 16 ++++++++++++++++ sql/item_cmpfunc.h | 5 +---- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 9c8e9727d16..0740e89f8df 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -254,3 +254,11 @@ DROP TABLE t1; # # End of 10.1 tests # +create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ('foo!' like 'foo!!') AS `'foo!' like 'foo!!'`,('foo!' like 'foo!!' escape '!') AS `'foo!' like 'foo!!' escape '!'` koi8r koi8r_general_ci +select * from v1; +'foo!' like 'foo!!' 'foo!' like 'foo!!' escape '!' +0 1 +drop view v1; diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index d1b9b170a3b..ed648fdc70a 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -185,3 +185,11 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +# +# Item_func_line::print() +# +create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; +show create view v1; +select * from v1; +drop view v1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index e10a4ba573f..f860ca4f06a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5076,6 +5076,22 @@ bool Item_bool_func2::count_sargable_conds(void *arg) return 0; } +void Item_func_like::print(String *str, enum_query_type query_type) +{ + str->append('('); + args[0]->print(str, query_type); + str->append(' '); + str->append(func_name()); + str->append(' '); + args[1]->print(str, query_type); + if (escape_used_in_parsing) + { + str->append(STRING_WITH_LEN(" escape ")); + escape_item->print(str, query_type); + } + str->append(')'); +} + longlong Item_func_like::val_int() { diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index b0120dd6c63..c5c34fa9da7 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1868,10 +1868,7 @@ public: escape_used_in_parsing(escape_used), use_sampling(0) {} longlong val_int(); enum Functype functype() const { return LIKE_FUNC; } - void print(String *str, enum_query_type query_type) - { - Item_func::print_op(str, query_type); - } + void print(String *str, enum_query_type query_type); CHARSET_INFO *compare_collation() const { return cmp_collation.collation; } cond_result eq_cmp_result() const From 0980627fcae1586573670f3f2d4ed45fcc751161 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 4 Nov 2016 16:54:58 +0100 Subject: [PATCH 026/135] bugfix: Item_func_weight_string::print() --- mysql-test/r/ctype_binary.result | 2 +- mysql-test/r/func_weight_string.result | 13 +++++++++---- mysql-test/t/func_weight_string.test | 7 +++++++ sql/item_strfunc.cc | 15 +++++++++++++++ sql/item_strfunc.h | 1 + 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index e7c40b5ed91..eb1746b933b 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -3145,7 +3145,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (weight_string(`test`.`t1`.`a`) = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (weight_string(`test`.`t1`.`a`,0,0,1) = 'a')) DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result index 0f52e793843..14737a2e62e 100644 --- a/mysql-test/r/func_weight_string.result +++ b/mysql-test/r/func_weight_string.result @@ -119,7 +119,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) ALTER TABLE t1 MODIFY a DOUBLE ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a @@ -129,7 +129,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) ALTER TABLE t1 MODIFY a DECIMAL(10,1) ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a @@ -139,7 +139,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) DROP TABLE t1; # # End of 10.1 tests @@ -155,13 +155,18 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) DEFAULT WEIGHT_STRING(a AS CHAR(10)) + `b` varbinary(10) DEFAULT weight_string(`a`,0,10,65) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'); SELECT a, HEX(b) FROM t1; a HEX(b) a 41202020202020202020 DROP TABLE t1; +create view v1 as select weight_string("MySQL" as char(4)); +select * from v1; +weight_string("MySQL" as char(4)) +MYSQ +drop view v1; # # End of 10.2 tests # diff --git a/mysql-test/t/func_weight_string.test b/mysql-test/t/func_weight_string.test index ddaf14dc75d..b376b996556 100644 --- a/mysql-test/t/func_weight_string.test +++ b/mysql-test/t/func_weight_string.test @@ -161,6 +161,13 @@ INSERT INTO t1 (a) VALUES ('a'); SELECT a, HEX(b) FROM t1; DROP TABLE t1; +# +# Item_func_weight_string::print() +# +create view v1 as select weight_string("MySQL" as char(4)); +select * from v1; +drop view v1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 162da17eb76..500a8e94e4b 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3621,6 +3621,21 @@ nl: } +void Item_func_weight_string::print(String *str, enum_query_type query_type) +{ + str->append(func_name()); + str->append('('); + args[0]->print(str, query_type); + str->append(','); + str->append_ulonglong(result_length); + str->append(','); + str->append_ulonglong(nweights); + str->append(','); + str->append_ulonglong(flags); + str->append(')'); +} + + String *Item_func_hex::val_str_ascii(String *str) { String *res; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 25b63ebe73d..ac7d820f2cf 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1254,6 +1254,7 @@ public: } Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) { return this; } + void print(String *str, enum_query_type query_type); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; From 75fb3213d3f53dabbcf5399d0ffdf4d9ec79794f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 6 Nov 2016 21:21:00 +0100 Subject: [PATCH 027/135] bugfix: Item_func_dyncol_add::print() --- mysql-test/r/dyncol.result | 8 ++++++++ mysql-test/t/dyncol.test | 8 ++++++++ sql/item_strfunc.cc | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 5b3ab44c19f..27547ef9a72 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1878,6 +1878,14 @@ COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) # # Start of 10.2 tests # +create view v1 as select column_get(column_add(column_create(1 , 'blue' as char), 2, 'ttt'), 1 as char); +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select column_get(column_add(column_create(1,'blue' AS char charset utf8 ),2,'ttt'),1 as char charset utf8) AS `Name_exp_1` utf8 utf8_general_ci +select * from v1; +Name_exp_1 +blue +drop view v1; # # MDEV-10134 Add full support for DEFAULT # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index f8f198be445..c0d22e9d1c4 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -928,6 +928,14 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); --echo # Start of 10.2 tests --echo # +# +# Item_func_dyncol_add::print +# +create view v1 as select column_get(column_add(column_create(1 , 'blue' as char), 2, 'ttt'), 1 as char); +show create view v1; +select * from v1; +drop view v1; + --echo # --echo # MDEV-10134 Add full support for DEFAULT --echo # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 500a8e94e4b..8fd71a80e62 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -4743,7 +4743,7 @@ void Item_func_dyncol_add::print(String *str, enum_query_type query_type) { DBUG_ASSERT((arg_count & 0x1) == 1); // odd number of arguments - str->append(STRING_WITH_LEN("column_create(")); + str->append(STRING_WITH_LEN("column_add(")); args[arg_count - 1]->print(str, query_type); str->append(','); print_arguments(str, query_type); From 75925f8fc1f395f23965afa0395356c87aeb9139 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 6 Nov 2016 22:25:39 +0100 Subject: [PATCH 028/135] bugfix: Item_func_spatial_collection::print() --- mysql-test/r/gis.result | 10 +++++++++- mysql-test/suite/innodb_gis/r/1.result | 2 +- mysql-test/suite/innodb_gis/r/gis.result | 2 +- mysql-test/t/gis.test | 8 ++++++++ sql/item_geofunc.h | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index d10cfec6003..04d169c84b6 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -488,7 +488,7 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select st_issimple(geometrycollection(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -1832,6 +1832,14 @@ DROP TABLE t1,t2; # # Start of 10.2 tests # +create view v1 as select AsWKT(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select st_astext(geometrycollection(point(44,6),geometrycollection(point(3,6),point(7,9)))) AS `Name_exp_1` latin1 latin1_swedish_ci +select * from v1; +Name_exp_1 +GEOMETRYCOLLECTION(POINT(44 6),GEOMETRYCOLLECTION(POINT(3 6),POINT(7 9))) +drop view v1; # # MDEV-10134 Add full support for DEFAULT # diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result index 95baf21cf78..8e0be6617a4 100644 --- a/mysql-test/suite/innodb_gis/r/1.result +++ b/mysql-test/suite/innodb_gis/r/1.result @@ -458,7 +458,7 @@ explain extended select ST_issimple(MultiPoint(Point(3, 6), Point(4, 10))), ST_i id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `ST_issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `ST_issimple(Point(3, 6))` +Note 1003 select st_issimple(geometrycollection(point(3,6),point(4,10))) AS `ST_issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `ST_issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (ST_GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result index ccf5224c56c..fed7592f42b 100644 --- a/mysql-test/suite/innodb_gis/r/gis.result +++ b/mysql-test/suite/innodb_gis/r/gis.result @@ -458,7 +458,7 @@ explain extended select ST_issimple(MultiPoint(Point(3, 6), Point(4, 10))), ST_i id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `ST_issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `ST_issimple(Point(3, 6))` +Note 1003 select st_issimple(geometrycollection(point(3,6),point(4,10))) AS `ST_issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `ST_issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (ST_GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 12b3e607e96..09d7a29744f 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1530,6 +1530,14 @@ DROP TABLE t1,t2; --echo # Start of 10.2 tests --echo # +# +# Item_func_spatial_collection::print() +# +create view v1 as select AsWKT(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +show create view v1; +select * from v1; +drop view v1; + --echo # --echo # MDEV-10134 Add full support for DEFAULT --echo # diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index f96e570915e..1584090c29e 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -291,7 +291,7 @@ public: } } - const char *func_name() const { return "st_multipoint"; } + const char *func_name() const { return "geometrycollection"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; From 867809f23a8f09b1ac0aa8f9212ac8afd572efc5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 20:04:09 +0100 Subject: [PATCH 029/135] bugfix: compile InnoDB w/o P_S --- mysql-test/suite/sys_vars/inc/sysvars_server.inc | 1 + storage/innobase/include/srv0srv.h | 3 +++ storage/innobase/include/univ.i | 2 +- storage/innobase/include/ut0ut.h | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc index cb06b40f8c9..76d35f0fd55 100644 --- a/mysql-test/suite/sys_vars/inc/sysvars_server.inc +++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc @@ -1,3 +1,4 @@ +--source include/have_perfschema.inc --source include/word_size.inc --vertical_results diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 5f8893b3e28..4f9bee7019f 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -620,6 +620,9 @@ do { \ do { \ PSI_THREAD_CALL(delete_current_thread)(); \ } while (0) +# else +# define pfs_register_thread(key) +# define pfs_delete_thread() # endif /* UNIV_PFS_THREAD */ #ifdef HAVE_PSI_STAGE_INTERFACE diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 6907bfec583..f885bd2191f 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -122,6 +122,7 @@ support cross-platform development and expose comonly used SQL names. */ #include #endif +#include "my_pthread.h" /* Following defines are to enable performance schema instrumentation in each of five InnoDB modules if HAVE_PSI_INTERFACE is defined. */ @@ -159,7 +160,6 @@ be excluded from instrumentation. */ #include "pfs_thread_provider.h" #endif -#include "my_pthread.h" #include "mysql/psi/mysql_thread.h" /* For PSI_FILE_CALL(). */ /* JAN: TODO: missing 5.7 header */ diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index c5355fd9d5c..087f175db50 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -30,6 +30,7 @@ Created 1/20/1994 Heikki Tuuri #include #include +#include #ifndef UNIV_INNOCHECKSUM From fd0044041bf70d5d8bbb530285055da585384ff1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 4 Nov 2016 11:16:13 +0100 Subject: [PATCH 030/135] don't convert WEEK(x) to WEEK(x, @@default_week_format) --- mysql-test/r/func_time.result | 2 +- mysql-test/r/set_statement.result | 2 +- .../suite/vcol/r/vcol_blocked_sql_funcs.result | 2 +- sql/item_timefunc.cc | 10 ++++++---- sql/item_timefunc.h | 18 +++++++++++++++++- sql/sql_yacc.yy | 10 +--------- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f4b1a39294c..f75ec17c702 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -874,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03',@@default_week_format) AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP='2007-08-01 12:22:49'; CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ('2007-08-01 12:22:59'); diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result index a66d636d18e..4cb143f6ba5 100644 --- a/mysql-test/r/set_statement.result +++ b/mysql-test/r/set_statement.result @@ -1152,7 +1152,7 @@ explain extended select week(a) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select week('2000-01-01',@@default_week_format) AS `week(a)` from dual +Note 1003 select week('2000-01-01') AS `week(a)` from dual prepare stmt1 from "select week(a) from t1"; execute stmt1; week(a) diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result index 0e03d80014d..dd580c344b0 100644 --- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result @@ -57,7 +57,7 @@ create or replace table t1 (a datetime, b datetime as (utc_timestamp()) PERSISTE ERROR HY000: Function or expression 'utc_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` # WEEK() - one argument version create or replace table t1 (a datetime, b datetime as (week(a)) PERSISTENT); -ERROR HY000: Function or expression '@@default_week_format' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'week()' cannot be used in the GENERATED ALWAYS AS clause of `b` # MATCH() create or replace table t1 (a varchar(32), b bool as (match a against ('sample text')) PERSISTENT); ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `b` diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 5e0ae028d88..c35606781ec 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1044,13 +1044,15 @@ uint week_mode(uint mode) longlong Item_func_week::val_int() { DBUG_ASSERT(fixed == 1); - uint year; + uint year, week_format; MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE)) return 0; - return (longlong) calc_week(<ime, - week_mode((uint) args[1]->val_int()), - &year); + if (arg_count > 1) + week_format= args[1]->val_int(); + else + week_format= current_thd->variables.default_week_format; + return (longlong) calc_week(<ime, week_mode(week_format), &year); } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 3d2b5c8c9e9..1e905c44fdf 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -334,6 +334,7 @@ public: class Item_func_week :public Item_int_func { public: + Item_func_week(THD *thd, Item *a): Item_int_func(thd, a) {} Item_func_week(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {} longlong val_int(); const char *func_name() const { return "week"; } @@ -343,6 +344,16 @@ public: max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } + bool check_vcol_func_processor(void *arg) + { + if (arg_count == 2) + return FALSE; + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } + bool check_valid_arguments_processor(void *int_arg) + { + return arg_count == 2; + } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -981,7 +992,12 @@ class Item_extract :public Item_int_func bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); bool check_partition_func_processor(void *int_arg) {return FALSE;} - bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_vcol_func_processor(void *arg) + { + if (int_type != INTERVAL_WEEK) + return FALSE; + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } bool check_valid_arguments_processor(void *int_arg) { switch (int_type) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index da7fb37ef89..d6376777c62 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -10022,15 +10022,7 @@ function_call_conflict: } | WEEK_SYM '(' expr ')' { - Item *i1; - LEX_STRING name= {C_STRING_WITH_LEN("default_week_format")}; - if (!(i1= get_system_var(thd, OPT_SESSION, - name, null_lex_str))) - MYSQL_YYABORT; - i1->set_name(thd, (const char *) - STRING_WITH_LEN("@@default_week_format"), - system_charset_info); - $$= new (thd->mem_root) Item_func_week(thd, $3, i1); + $$= new (thd->mem_root) Item_func_week(thd, $3); if ($$ == NULL) MYSQL_YYABORT; } From a721dcab8ec0ec5e89664416f8f220244867036c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 27 Nov 2016 19:30:20 +0100 Subject: [PATCH 031/135] cleanup: Item_func_opt_neg::negate() remove redundant method --- sql/item_cmpfunc.h | 1 - sql/sql_yacc.yy | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index c5c34fa9da7..8a0799b0f16 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -839,7 +839,6 @@ public: Item_func_opt_neg(THD *thd, List &list): Item_bool_func(thd, list), negated(0), pred_level(0) {} public: - inline void negate() { negated= !negated; } inline void top_level_item() { pred_level= 1; } bool is_top_level_item() const { return pred_level; } Item *neg_transformer(THD *thd) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d6376777c62..77cd06a465a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9016,8 +9016,7 @@ predicate: Item_func_in *item= new (thd->mem_root) Item_func_in(thd, *$7); if (item == NULL) MYSQL_YYABORT; - item->negate(); - $$= item; + $$= item->neg_transformer(thd); } | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate { @@ -9031,8 +9030,7 @@ predicate: item= new (thd->mem_root) Item_func_between(thd, $1, $4, $6); if (item == NULL) MYSQL_YYABORT; - item->negate(); - $$= item; + $$= item->neg_transformer(thd); } | bit_expr SOUNDS_SYM LIKE bit_expr { From 335082ec5e2e7214773720b0bf82a2242255326a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 3 Nov 2016 12:39:04 +0100 Subject: [PATCH 032/135] cleanup: remove bad String=0 assignment --- sql/sql_insert.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ef17c3f1f10..8555ccd4806 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4022,7 +4022,6 @@ static TABLE *create_table_from_items(THD *thd, Item *item; DBUG_ENTER("create_table_from_items"); - tmp_table.alias= 0; tmp_table.s= &share; init_tmp_table_share(thd, &share, "", 0, "", ""); From d440319842e564a727a54d2c44f92104bd96e0de Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Nov 2016 20:12:28 +0100 Subject: [PATCH 033/135] cleanup: TABLE::init() unused freshly initialized record should be trashed with TRASH_ALLOC, not TRASH_FREE --- sql/table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index 9177d1e38f6..3bc1fee273b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4454,7 +4454,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl) DBUG_ASSERT(key_read == 0); /* mark the record[0] uninitialized */ - TRASH(record[0], s->reclength); + TRASH_ALLOC(record[0], s->reclength); /* Initialize the null marker bits, to ensure that if we are doing a read From 0bef3bb8d0a0c3d25b6e4c707144c96cb0350e99 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 20 Nov 2015 13:11:35 +0100 Subject: [PATCH 034/135] cleanup: remove Item::intro_version and partition_info::set_show_version_string - they were already broken and impossible to maintain --- mysql-test/r/ctype_uca_partitions.result | 4 +- mysql-test/r/information_schema_part.result | 8 +- mysql-test/r/partition.result | 124 +-- mysql-test/r/partition_cache_innodb.result | 8 +- mysql-test/r/partition_cache_myisam.result | 8 +- mysql-test/r/partition_column.result | 40 +- mysql-test/r/partition_datatype.result | 12 +- mysql-test/r/partition_default.result | 76 +- mysql-test/r/partition_error.result | 24 +- mysql-test/r/partition_example.result | 8 +- mysql-test/r/partition_exchange.result | 96 +- mysql-test/r/partition_explicit_prune.result | 16 +- mysql-test/r/partition_innodb.result | 14 +- mysql-test/r/partition_innodb_plugin.result | 12 +- mysql-test/r/partition_mgm.result | 24 +- mysql-test/r/partition_mgm_err.result | 4 +- mysql-test/r/partition_myisam.result | 6 +- mysql-test/r/partition_not_windows.result | 4 +- mysql-test/r/partition_range.result | 44 +- mysql-test/r/partition_symlink.result | 8 +- mysql-test/r/partition_utf8.result | 12 +- .../suite/archive/partition_archive.result | 14 +- .../encryption/r/encryption_force.result | 4 +- .../funcs/r/tc_partition_analyze.result | 8 +- ...ition_change_from_range_to_hash_key.result | 96 +- .../engines/funcs/r/tc_partition_check.result | 8 +- .../engines/funcs/r/tc_partition_hash.result | 336 +++---- .../r/tc_partition_hash_date_function.result | 96 +- .../engines/funcs/r/tc_partition_key.result | 192 ++-- .../funcs/r/tc_partition_linear_key.result | 192 ++-- .../funcs/r/tc_partition_optimize.result | 8 +- .../funcs/r/tc_partition_rebuild.result | 8 +- .../funcs/r/tc_partition_remove.result | 24 +- .../funcs/r/tc_partition_reorg_divide.result | 48 +- .../r/tc_partition_reorg_hash_key.result | 288 +++--- .../funcs/r/tc_partition_reorg_merge.result | 48 +- .../funcs/r/tc_partition_repair.result | 8 +- .../engines/funcs/r/tc_partition_sub1.result | 24 +- .../engines/funcs/r/tc_partition_sub2.result | 24 +- .../engines/funcs/r/tc_partition_value.result | 20 +- .../r/tc_partition_value_specific.result | 20 +- .../federated/federated_partition.result | 4 +- mysql-test/suite/galera/r/partition.result | 12 +- mysql-test/suite/innodb_zip/r/restart.result | 64 +- .../r/part_supported_sql_func_innodb.result | 64 +- .../r/part_supported_sql_func_myisam.result | 64 +- .../r/partition_alter1_1_2_innodb.result | 224 ++--- .../r/partition_alter1_1_2_myisam.result | 64 +- .../parts/r/partition_alter1_1_innodb.result | 128 +-- .../parts/r/partition_alter1_1_myisam.result | 64 +- .../parts/r/partition_alter1_2_innodb.result | 320 +++---- .../parts/r/partition_alter1_2_myisam.result | 128 +-- .../r/partition_alter2_1_1_innodb.result | 160 ++-- .../r/partition_alter2_1_2_innodb.result | 160 ++-- .../parts/r/partition_alter2_1_maria.result | 192 ++-- .../parts/r/partition_alter2_1_myisam.result | 192 ++-- .../r/partition_alter2_2_1_innodb.result | 160 ++-- .../r/partition_alter2_2_2_innodb.result | 160 ++-- .../parts/r/partition_alter2_2_maria.result | 192 ++-- .../parts/r/partition_alter2_2_myisam.result | 192 ++-- .../parts/r/partition_alter3_innodb.result | 88 +- .../parts/r/partition_alter3_myisam.result | 88 +- .../parts/r/partition_alter4_innodb.result | 736 +++++++-------- .../parts/r/partition_alter4_myisam.result | 736 +++++++-------- .../r/partition_auto_increment_archive.result | 76 +- .../partition_auto_increment_blackhole.result | 76 +- .../r/partition_auto_increment_innodb.result | 76 +- .../r/partition_auto_increment_maria.result | 76 +- .../r/partition_auto_increment_memory.result | 76 +- .../r/partition_auto_increment_myisam.result | 76 +- .../parts/r/partition_basic_innodb.result | 256 ++--- .../parts/r/partition_basic_myisam.result | 128 +-- .../r/partition_basic_symlink_innodb.result | 12 +- .../r/partition_basic_symlink_myisam.result | 156 +-- .../suite/parts/r/partition_bit_innodb.result | 34 +- .../suite/parts/r/partition_bit_myisam.result | 34 +- .../parts/r/partition_char_innodb.result | Bin 50278 -> 50146 bytes .../parts/r/partition_char_myisam.result | Bin 50278 -> 50146 bytes .../parts/r/partition_datetime_innodb.result | 64 +- .../parts/r/partition_datetime_myisam.result | 64 +- .../suite/parts/r/partition_debug.result | 144 +-- .../parts/r/partition_debug_innodb.result | 888 +++++++++--------- .../parts/r/partition_debug_myisam.result | 744 +++++++-------- .../r/partition_debug_sync_innodb.result | 8 +- .../parts/r/partition_decimal_innodb.result | 16 +- .../parts/r/partition_decimal_myisam.result | 16 +- .../parts/r/partition_engine_innodb.result | 44 +- .../parts/r/partition_engine_myisam.result | 44 +- .../parts/r/partition_exch_qa_1_innodb.result | 8 +- .../parts/r/partition_exch_qa_1_myisam.result | 8 +- .../parts/r/partition_exchange_archive.result | 24 +- .../parts/r/partition_exchange_innodb.result | 24 +- .../parts/r/partition_exchange_memory.result | 24 +- .../parts/r/partition_exchange_myisam.result | 24 +- .../parts/r/partition_float_innodb.result | 16 +- .../parts/r/partition_float_myisam.result | 16 +- .../suite/parts/r/partition_int_innodb.result | 60 +- .../suite/parts/r/partition_int_myisam.result | 60 +- .../parts/r/partition_mgm_lc0_archive.result | 72 +- .../parts/r/partition_mgm_lc0_innodb.result | 76 +- .../parts/r/partition_mgm_lc0_memory.result | 76 +- .../parts/r/partition_mgm_lc0_myisam.result | 76 +- .../parts/r/partition_mgm_lc1_archive.result | 72 +- .../parts/r/partition_mgm_lc1_innodb.result | 76 +- .../parts/r/partition_mgm_lc1_memory.result | 76 +- .../parts/r/partition_mgm_lc1_myisam.result | 76 +- .../parts/r/partition_mgm_lc2_archive.result | 60 +- .../parts/r/partition_mgm_lc2_innodb.result | 76 +- .../parts/r/partition_mgm_lc2_memory.result | 76 +- .../parts/r/partition_mgm_lc2_myisam.result | 76 +- .../parts/r/partition_special_innodb.result | 16 +- .../parts/r/partition_special_myisam.result | 16 +- .../parts/r/partition_syntax_innodb.result | 42 +- .../parts/r/partition_syntax_myisam.result | 42 +- mysql-test/suite/parts/r/rpl_partition.result | 4 +- .../suite/perfschema/r/part_table_io.result | 4 +- .../rpl/r/rpl_extra_col_slave_innodb.result | 8 +- .../rpl/r/rpl_extra_col_slave_myisam.result | 8 +- .../suite/rpl/r/rpl_innodb_bug28430.result | 4 +- .../suite/rpl/r/rpl_partition_archive.result | 8 +- .../suite/rpl/r/rpl_partition_innodb.result | 8 +- .../suite/rpl/r/rpl_partition_memory.result | 8 +- .../suite/rpl/r/rpl_partition_myisam.result | 8 +- .../rpl/r/rpl_row_basic_8partition.result | 72 +- .../parts/truncate_table.result | 16 +- sql/item.h | 9 - sql/item_timefunc.h | 9 - sql/partition_info.cc | 36 - sql/partition_info.h | 1 - sql/sql_show.cc | 5 +- .../mroonga/storage/r/partition_insert.result | 4 +- .../mroonga/storage/r/partition_update.result | 4 +- .../storage_engine/parts/truncate_table.rdiff | 16 +- .../rpl/r/rpl_extra_col_slave_tokudb.result | 8 +- .../rpl/r/rpl_partition_tokudb.result | 8 +- .../rpl/r/rpl_tokudb_bug28430.result | 4 +- .../tokudb/r/cluster_key_part.result | 8 +- .../tokudb_alter_table/r/ai_part.result | 8 +- .../r/frm_discover_partition.result | 16 +- .../tokudb_alter_table/r/hcad_part.result | 8 +- .../r/partition_alter3_tokudb.result | 88 +- .../r/partition_auto_increment_tokudb.result | 76 +- .../r/partition_bit_tokudb.result | 34 +- .../r/partition_char_tokudb.result | Bin 50278 -> 50146 bytes .../r/partition_datetime_tokudb.result | 64 +- .../r/partition_debug_sync_tokudb.result | 8 +- .../r/partition_decimal_tokudb.result | 16 +- .../r/partition_engine_tokudb.result | 44 +- .../r/partition_exch_qa_1_tokudb.result | 8 +- .../r/partition_exchange_tokudb.result | 24 +- .../r/partition_float_tokudb.result | 16 +- .../r/partition_int_tokudb.result | 60 +- .../r/partition_mgm_lc0_tokudb.result | 76 +- .../r/partition_mgm_lc10_tokudb.result | 68 +- .../r/partition_mgm_lc1_tokudb.result | 76 +- .../r/partition_special_tokudb.result | 16 +- .../r/partition_syntax_tokudb.result | 42 +- 157 files changed, 5769 insertions(+), 5825 deletions(-) diff --git a/mysql-test/r/ctype_uca_partitions.result b/mysql-test/r/ctype_uca_partitions.result index 11d4e82e27b..508893522e4 100644 --- a/mysql-test/r/ctype_uca_partitions.result +++ b/mysql-test/r/ctype_uca_partitions.result @@ -6,8 +6,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); INSERT INTO t1 VALUES ('B'); INSERT INTO t1 VALUES ('C'); diff --git a/mysql-test/r/information_schema_part.result b/mysql-test/r/information_schema_part.result index b34183ebdee..e0a0f28dec6 100644 --- a/mysql-test/r/information_schema_part.result +++ b/mysql-test/r/information_schema_part.result @@ -120,9 +120,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) -(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; SUBPARTITION_METHOD @@ -138,8 +138,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = "test" AND table_name = "t1"; PARTITION_DESCRIPTION diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 29243beefa9..3b365d6fdde 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -94,8 +94,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 SELECT * FROM t1; a b 0 1 @@ -187,12 +187,12 @@ t1 CREATE TABLE `t1` ( `new_field0` varchar(50) DEFAULT NULL, PRIMARY KEY (`ID`,`aaaa,aaaaa`,`ddddddddd`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (ID) + PARTITION BY RANGE (ID) SUBPARTITION BY LINEAR KEY (`ID`,`aaaa,aaaaa`) SUBPARTITIONS 2 (PARTITION p01 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION p11 VALUES LESS THAN (200) ENGINE = MyISAM, - PARTITION p21 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p21 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) drop table t1; CREATE TABLE t1 (a INT, b INT) PARTITION BY LIST (a) @@ -264,10 +264,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a)) + PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (PARTITION p1 VALUES LESS THAN (1199134800) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1247688000) ENGINE = MyISAM, - PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) DROP TABLE t1; create table t1 (a int NOT NULL, b varchar(5) NOT NULL) default charset=utf8 @@ -376,9 +376,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) DROP TABLE t1; SET sql_mode=DEFAULT; CREATE TABLE t1 (a INT NOT NULL, KEY(a)) @@ -775,20 +775,20 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (2) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (2) ENGINE = MyISAM) alter table t1 reorganize partition p1 into (partition p1 values less than (3)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM) drop table t1; CREATE TABLE t1 ( a int not null, @@ -807,7 +807,7 @@ t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; CREATE TABLE t1 ( a int not null, @@ -985,8 +985,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION x1 VALUES IN (1) ENGINE = MEMORY) */ + PARTITION BY LIST (a) +(PARTITION x1 VALUES IN (1) ENGINE = MEMORY) drop table t1; CREATE TABLE t1 (a int, unique(a)) PARTITION BY LIST (a) @@ -1011,8 +1011,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 5 */ + PARTITION BY HASH (a) +PARTITIONS 5 drop table t1; CREATE TABLE t1 (a int) PARTITION BY RANGE (a) @@ -1040,10 +1040,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM) */ + PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM) drop table t1; CREATE TABLE t1 (a int, b int) PARTITION BY RANGE (a) @@ -1065,7 +1065,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, @@ -1073,7 +1073,7 @@ t1 CREATE TABLE `t1` ( PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, - PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM) */ + PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM) drop table t1; create table t1 (a int not null, b int not null) partition by LIST (a+b) ( partition p0 values in (12), @@ -1128,36 +1128,36 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) alter table t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) alter table t1 engine=myisam; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) alter table t1 engine=heap; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) alter table t1 remove partitioning; show create table t1; Table Create Table @@ -1175,9 +1175,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) alter table t1 add column b int remove partitioning; show create table t1; Table Create Table @@ -1195,9 +1195,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) alter table t1 engine=heap partition by key(a) @@ -1208,9 +1208,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) alter table t1 engine=myisam, add column c int remove partitioning; show create table t1; Table Create Table @@ -1230,9 +1230,9 @@ t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) alter table t1 partition by key (a) (partition p0, partition p1); @@ -1243,9 +1243,9 @@ t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) alter table t1 engine=heap partition by key (a) @@ -1257,9 +1257,9 @@ t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, - PARTITION p1 ENGINE = MEMORY) */ + PARTITION p1 ENGINE = MEMORY) alter table t1 partition by key(a) (partition p0, partition p1 engine=heap); @@ -1403,9 +1403,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) -(PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM) alter table t1 add partition (partition p1 values less than (200) (subpartition subpart21)); show create table t1; @@ -1413,12 +1413,12 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) (SUBPARTITION p0sp0 ENGINE = MyISAM), PARTITION p1 VALUES LESS THAN (200) - (SUBPARTITION subpart21 ENGINE = MyISAM)) */ + (SUBPARTITION subpart21 ENGINE = MyISAM)) drop table t1; create table t1 (a int) partition by key (a); @@ -1427,16 +1427,16 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) alter table t1 add partition (partition p1); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, - PARTITION p1 ENGINE = MyISAM) */ + PARTITION p1 ENGINE = MyISAM) drop table t1; create table t1 (a int, b int) partition by range (a) @@ -1520,9 +1520,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p1 VALUES IN (1) ENGINE = MyISAM, - PARTITION p2 VALUES IN (2) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (2) ENGINE = MyISAM) drop table t1; create table t1 (a int unsigned not null auto_increment primary key) partition by key(a); @@ -1534,7 +1534,7 @@ t2 CREATE TABLE `t2` ( `c` char(10) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t2; create table t1 (f1 int) partition by hash (f1) as select 1; drop table t1; @@ -1731,8 +1731,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) DROP TABLE t1; CREATE TABLE t1 (a int) PARTITION BY RANGE(a) @@ -1769,8 +1769,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) -/*!50100 PARTITION BY KEY (a) -(PARTITION p0) */ + PARTITION BY KEY (a) +(PARTITION p0) set session sql_mode=''; drop table t1; create table t1 (a int) @@ -1785,7 +1785,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; CREATE TABLE t1 (a int) ENGINE = MYISAM PARTITION BY KEY(a); INSERT into t1 values (1), (2); @@ -1858,8 +1858,8 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t1; @@ -2024,9 +2024,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (b) + PARTITION BY RANGE (b) (PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */ + PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) drop table t1, t2; create table t1 (s1 timestamp on update current_timestamp, s2 int) @@ -2164,12 +2164,12 @@ t1 CREATE TABLE `t1` ( `user` char(25) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + 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 pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) drop table t1; CREATE TABLE t1 ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, diff --git a/mysql-test/r/partition_cache_innodb.result b/mysql-test/r/partition_cache_innodb.result index c12ff3588b0..f0e4f83ddb3 100644 --- a/mysql-test/r/partition_cache_innodb.result +++ b/mysql-test/r/partition_cache_innodb.result @@ -23,10 +23,10 @@ t1 CREATE TABLE `t1` ( `created_at` datetime NOT NULL, `cool` tinyint(4) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) + PARTITION BY RANGE (TO_DAYS(created_at)) (PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, - PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) INSERT INTO t1 VALUES (1, now(), 0); flush status; show status like "Qcache_queries_in_cache"; @@ -72,12 +72,12 @@ t1 CREATE TABLE `t1` ( `created_at` datetime NOT NULL, `cool` tinyint(4) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) + PARTITION BY RANGE (TO_DAYS(created_at)) SUBPARTITION BY HASH (cool) SUBPARTITIONS 3 (PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, - PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) INSERT INTO t1 VALUES (1, now(), 0); flush status; show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/r/partition_cache_myisam.result b/mysql-test/r/partition_cache_myisam.result index d20a8baeab7..2b6c34b1cd9 100644 --- a/mysql-test/r/partition_cache_myisam.result +++ b/mysql-test/r/partition_cache_myisam.result @@ -23,10 +23,10 @@ t1 CREATE TABLE `t1` ( `created_at` datetime NOT NULL, `cool` tinyint(4) DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) + PARTITION BY RANGE (TO_DAYS(created_at)) (PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, - PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) INSERT INTO t1 VALUES (1, now(), 0); flush status; show status like "Qcache_queries_in_cache"; @@ -72,12 +72,12 @@ t1 CREATE TABLE `t1` ( `created_at` datetime NOT NULL, `cool` tinyint(4) DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) + PARTITION BY RANGE (TO_DAYS(created_at)) SUBPARTITION BY HASH (cool) SUBPARTITIONS 3 (PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, - PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) INSERT INTO t1 VALUES (1, now(), 0); flush status; show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result index a494656a6a6..06d39771466 100644 --- a/mysql-test/r/partition_column.result +++ b/mysql-test/r/partition_column.result @@ -30,9 +30,9 @@ t1 CREATE TABLE `t1` ( `department` varchar(10) DEFAULT NULL, `country` varchar(255) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(department,country) + PARTITION BY LIST COLUMNS(department,country) (PARTITION first_office VALUES IN (('dep1','Russia'),('dep1','Croatia')) ENGINE = MyISAM, - PARTITION second_office VALUES IN (('dep2','Russia')) ENGINE = MyISAM) */ + PARTITION second_office VALUES IN (('dep2','Russia')) ENGINE = MyISAM) SELECT * FROM t1 WHERE department = 'dep2' and country = 'Croatia'; id name department country SELECT * FROM t1 WHERE department = 'dep1' and country = 'Croatia'; @@ -173,10 +173,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) + PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN ('''') ENGINE = MyISAM, PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM, - PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */ + PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) drop table t1; set @@sql_mode=allow_invalid_dates; create table t1 (a char, b char, c date) @@ -232,13 +232,13 @@ t1 CREATE TABLE `t1` ( `c` varchar(25) DEFAULT NULL, `d` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE COLUMNS(a,b,c,d) + PARTITION BY RANGE COLUMNS(a,b,c,d) SUBPARTITION BY HASH (to_seconds(d)) SUBPARTITIONS 4 (PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1,'a',MAXVALUE,'1999-01-01') ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1,'b',MAXVALUE,MAXVALUE) ENGINE = MyISAM, - PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */ + PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) drop table t1; create table t1 (a int, b int) partition by range columns (a,b) @@ -315,10 +315,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM, - PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) insert into t1 values (3, NULL); insert into t1 values (NULL, 1); insert into t1 values (NULL, NULL); @@ -349,10 +349,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM, - PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) drop table t1; create table t1 (a int) partition by list (a) @@ -373,9 +373,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM, - PARTITION p1 VALUES IN (NULL,4,3) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN (NULL,4,3) ENGINE = MyISAM) insert into t1 values (1); insert into t1 values (2); insert into t1 values (3); @@ -403,9 +403,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) + PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM, - PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) insert into t1 values (1); insert into t1 values (2); insert into t1 values (3); @@ -418,9 +418,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) + PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM, - PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) drop table t1; create table t1 (a int, b char(10), c varchar(5), d int) partition by range columns(a,b,c) @@ -453,13 +453,13 @@ t1 CREATE TABLE `t1` ( `c` varchar(5) DEFAULT NULL, `d` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE COLUMNS(a,b,c) + PARTITION BY RANGE COLUMNS(a,b,c) SUBPARTITION BY KEY (c,d) SUBPARTITIONS 3 (PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (2,'abc','abc') ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (3,'abc','abc') ENGINE = MyISAM, - PARTITION p3 VALUES LESS THAN (4,'abc','abc') ENGINE = MyISAM) */ + PARTITION p3 VALUES LESS THAN (4,'abc','abc') ENGINE = MyISAM) insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3); insert into t1 values (1,'b','c',1),(2,'b','c',2),(3,'b','c',3); insert into t1 values (1,'c','d',1),(2,'c','d',2),(3,'c','d',3); @@ -486,9 +486,9 @@ t1 CREATE TABLE `t1` ( `b` varchar(2) DEFAULT NULL, `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE COLUMNS(a,b,c) + PARTITION BY RANGE COLUMNS(a,b,c) (PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) insert into t1 values (1, 'A', 1); explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1; id select_type table partitions type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result index fa58df3dec3..31d265d95ee 100644 --- a/mysql-test/r/partition_datatype.result +++ b/mysql-test/r/partition_datatype.result @@ -329,10 +329,10 @@ t1 CREATE TABLE `t1` ( `a` bit(27) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, - PARTITION p2 ENGINE = MyISAM) */ + PARTITION p2 ENGINE = MyISAM) insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); select hex(a) from t1 where a = 7; hex(a) @@ -850,7 +850,7 @@ t2 CREATE TABLE `t2` ( `a` timestamp NULL DEFAULT NULL, `tz` varchar(16) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a)) + PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION `p-2000` VALUES LESS THAN (946684800) ENGINE = MyISAM, PARTITION `p-2011-MSK` VALUES LESS THAN (1301180400) ENGINE = MyISAM, @@ -859,7 +859,7 @@ t2 CREATE TABLE `t2` ( PARTITION `p-2012-MSK-1` VALUES LESS THAN (1319932800) ENGINE = MyISAM, PARTITION `p-2012-MSK-2` VALUES LESS THAN (1332630000) ENGINE = MyISAM, PARTITION pEnd VALUES LESS THAN (2147483647) ENGINE = MyISAM, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) TRUNCATE TABLE t2; SET @@session.time_zone = 'Europe/Moscow'; INSERT INTO t2 SELECT * FROM t1; @@ -1334,7 +1334,7 @@ t2 CREATE TABLE `t2` ( `a` timestamp NULL DEFAULT NULL, `tz` varchar(16) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a)) + PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION `p-2000` VALUES LESS THAN (946684800) ENGINE = MyISAM, PARTITION `p-2011-MSK` VALUES LESS THAN (1301180400) ENGINE = MyISAM, @@ -1343,7 +1343,7 @@ t2 CREATE TABLE `t2` ( PARTITION `p-2012-MSK-1` VALUES LESS THAN (1319932800) ENGINE = MyISAM, PARTITION `p-2012-MSK-2` VALUES LESS THAN (1332630000) ENGINE = MyISAM, PARTITION pEnd VALUES LESS THAN (2147483647) ENGINE = MyISAM, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) TRUNCATE TABLE t2; DROP TABLE t1, t2; SET @@session.time_zone= @old_time_zone; diff --git a/mysql-test/r/partition_default.result b/mysql-test/r/partition_default.result index fcf16ba7ccf..2833d92de32 100644 --- a/mysql-test/r/partition_default.result +++ b/mysql-test/r/partition_default.result @@ -22,10 +22,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION p1 VALUES IN (1) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) insert into t1 values (10,10); insert into t1 values (4,4); select * from t1; @@ -72,10 +72,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 DEFAULT ENGINE = MyISAM, PARTITION p2 VALUES IN (4,5,6) ENGINE = MyISAM, - PARTITION p1 VALUES IN (1) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN (1) ENGINE = MyISAM) insert into t1 values (10,10); select * from t1; a b @@ -100,10 +100,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 DEFAULT ENGINE = MyISAM, PARTITION p2 VALUES IN (4,5,6) ENGINE = MyISAM, - PARTITION p1 VALUES IN (1,0) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN (1,0) ENGINE = MyISAM) insert into t1 values (10,10); select * from t1; a b @@ -128,10 +128,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p2 VALUES IN ((1,4),(2,5),(3,6)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) insert into t1 values (10,10); select * from t1; a b @@ -176,10 +176,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION p1 VALUES IN (1,20) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) insert into t1 values (10,10); select partition_name, table_rows from INFORMATION_SCHEMA.PARTITIONS where table_name='t1'; partition_name table_rows @@ -256,10 +256,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p2 VALUES IN ((1,4),(2,5),(3,6),(5,5)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(20,20)) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) insert into t1 values (10,10); select partition_name, table_rows from INFORMATION_SCHEMA.PARTITIONS where table_name='t1'; partition_name table_rows @@ -325,10 +325,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a+b) + PARTITION BY LIST (a+b) (PARTITION p2 VALUES IN (1,2,3,7) ENGINE = MyISAM, PARTITION p1 VALUES IN (21,0) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) select * from t1; a b 2 5 @@ -362,10 +362,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a+5) + PARTITION BY LIST (a+5) (PARTITION p2 VALUES IN (1,2,3,7) ENGINE = MyISAM, PARTITION p1 VALUES IN (0) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) select * from t1; a b 2 5 @@ -832,10 +832,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p2 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION p1 VALUES IN (20,0) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) select * from t1; a b 2 5 @@ -866,10 +866,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p2 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION p1 VALUES IN (20,0) ENGINE = MyISAM, - PARTITION p0 VALUES IN (10) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN (10) ENGINE = MyISAM) select * from t1; a b 2 5 @@ -900,10 +900,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p2 DEFAULT ENGINE = MyISAM, PARTITION p1 VALUES IN (20,0) ENGINE = MyISAM, - PARTITION p0 VALUES IN (10) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN (10) ENGINE = MyISAM) select * from t1; a b 2 5 @@ -930,9 +930,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p1 VALUES IN (20,0) ENGINE = MyISAM, - PARTITION p0 VALUES IN (10) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN (10) ENGINE = MyISAM) select * from t1; a b 0 0 @@ -948,10 +948,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p1 VALUES IN (20,0) ENGINE = MyISAM, PARTITION p0 VALUES IN (10) ENGINE = MyISAM, - PARTITION pd DEFAULT ENGINE = MyISAM) */ + PARTITION pd DEFAULT ENGINE = MyISAM) alter table t1 add partition (PARTITION pdd DEFAULT); ERROR HY000: Only one DEFAULT partition allowed alter table t1 drop partition pd; @@ -980,10 +980,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p2 VALUES IN ((1,4),(2,5),(3,6)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, - PARTITION p0 DEFAULT ENGINE = MyISAM) */ + PARTITION p0 DEFAULT ENGINE = MyISAM) select * from t1; a b 2 5 @@ -1014,10 +1014,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p2 VALUES IN ((1,4),(2,5),(3,6)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, - PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) select * from t1; a b 2 5 @@ -1048,10 +1048,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p2 DEFAULT ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, - PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) select * from t1; a b 2 5 @@ -1078,9 +1078,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, - PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) */ + PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM) select * from t1; a b 0 0 @@ -1096,10 +1096,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM, PARTITION p0 VALUES IN ((10,10)) ENGINE = MyISAM, - PARTITION pd DEFAULT ENGINE = MyISAM) */ + PARTITION pd DEFAULT ENGINE = MyISAM) alter table t1 add partition (PARTITION pdd DEFAULT); ERROR HY000: Only one DEFAULT partition allowed alter table t1 drop partition pd; @@ -1144,10 +1144,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a,b) + PARTITION BY LIST COLUMNS(a,b) (PARTITION p0 DEFAULT ENGINE = MyISAM, PARTITION p2 VALUES IN ((1,4),(2,5),(3,6)) ENGINE = MyISAM, - PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM) */ + PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM) drop table t1; # # MDEV-10765: Wrong result - query does not retrieve values from diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index f05b145053d..eeea5215218 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -781,9 +781,9 @@ t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(purchased)) + PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = ) */ +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = ) DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -802,11 +802,11 @@ t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(purchased)) + PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 ENGINE = , - SUBPARTITION sp1 ENGINE = )) */ + SUBPARTITION sp1 ENGINE = )) DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -822,8 +822,8 @@ t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = ) */ + PARTITION BY RANGE (YEAR(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = ) DROP TABLE t1; SET @@sql_mode= @org_mode; CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)); @@ -1783,14 +1783,14 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) SUBPARTITION BY HASH (a) (PARTITION p1 VALUES IN (1) (SUBPARTITION p1spFirst COMMENT = 'SubPartition comment in p1spFirst' ENGINE = MyISAM, SUBPARTITION p1spSecond COMMENT = 'SubPartition comment in p1spSecond' ENGINE = MyISAM), PARTITION p2 VALUES IN (2) (SUBPARTITION p2spFirst COMMENT = 'SubPartition comment in p2spFirst' ENGINE = MyISAM, - SUBPARTITION p2spSecond COMMENT = 'SubPartition comment in p2spSecond' ENGINE = MyISAM)) */ + SUBPARTITION p2spSecond COMMENT = 'SubPartition comment in p2spSecond' ENGINE = MyISAM)) SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; PARTITION_NAME SUBPARTITION_NAME PARTITION_COMMENT @@ -1813,14 +1813,14 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) SUBPARTITION BY HASH (a) (PARTITION p1 VALUES IN (1) (SUBPARTITION p1spFirst COMMENT = 'SubPartition comment in p1spFirst' ENGINE = MyISAM, SUBPARTITION p1spSecond ENGINE = MyISAM), PARTITION p2 VALUES IN (2) (SUBPARTITION p2spFirst COMMENT = 'Comment in p2' ENGINE = MyISAM, - SUBPARTITION p2spSecond COMMENT = 'SubPartition comment in p2spSecond' ENGINE = MyISAM)) */ + SUBPARTITION p2spSecond COMMENT = 'SubPartition comment in p2spSecond' ENGINE = MyISAM)) SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; PARTITION_NAME SUBPARTITION_NAME PARTITION_COMMENT @@ -1849,14 +1849,14 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, KEY `inx_a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION pUpTo10 VALUES LESS THAN (10) (SUBPARTITION `p-10sp0` COMMENT = 'This is a long comment (2050 ascii characters) 50 pUpTo10 partition ......80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|' ENGINE = MyISAM, SUBPARTITION `p-10sp1` COMMENT = 'This is a long comment (2050 ascii characters) 50 pUpTo10 partition ......80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|' ENGINE = MyISAM), PARTITION pMax VALUES LESS THAN MAXVALUE (SUBPARTITION pMaxsp0 COMMENT = 'This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|' ENGINE = MyISAM, - SUBPARTITION pMaxsp1 COMMENT = 'This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|' ENGINE = MyISAM)) */ + SUBPARTITION pMaxsp1 COMMENT = 'This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|' ENGINE = MyISAM)) SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; PARTITION_NAME SUBPARTITION_NAME PARTITION_COMMENT diff --git a/mysql-test/r/partition_example.result b/mysql-test/r/partition_example.result index 2129eea0818..9e1a4ccdad9 100644 --- a/mysql-test/r/partition_example.result +++ b/mysql-test/r/partition_example.result @@ -8,9 +8,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, - PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ + PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) drop table t1; create table t1 (a int not null) engine=example ull=12340 @@ -21,9 +21,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, - PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ + PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) drop table t1; select 1; 1 diff --git a/mysql-test/r/partition_exchange.result b/mysql-test/r/partition_exchange.result index 0f6ac2cf480..f7b2d7647ff 100644 --- a/mysql-test/r/partition_exchange.result +++ b/mysql-test/r/partition_exchange.result @@ -28,8 +28,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -64,8 +64,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -112,8 +112,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -172,8 +172,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -232,8 +232,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -292,8 +292,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -349,8 +349,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -406,8 +406,8 @@ Create Table CREATE TABLE `t1` ( `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( @@ -496,9 +496,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 1 First value @@ -534,9 +534,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 10 Ten @@ -594,9 +594,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 1 First value @@ -650,9 +650,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SHOW CREATE TABLE tsp; Table Create Table tsp CREATE TABLE `tsp` ( @@ -660,14 +660,14 @@ tsp CREATE TABLE `tsp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) (SUBPARTITION sp0 ENGINE = MyISAM, SUBPARTITION sp1 ENGINE = MyISAM), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION sp2 ENGINE = MyISAM, - SUBPARTITION sp3 ENGINE = MyISAM)) */ + SUBPARTITION sp3 ENGINE = MyISAM)) SELECT * FROM t; a b 1 First value @@ -704,9 +704,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 10 Ten @@ -742,9 +742,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 1 First value @@ -781,14 +781,14 @@ tsp CREATE TABLE `tsp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) (SUBPARTITION sp0 ENGINE = MyISAM, SUBPARTITION sp1 ENGINE = MyISAM), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION sp2 ENGINE = MyISAM, - SUBPARTITION sp3 ENGINE = MyISAM)) */ + SUBPARTITION sp3 ENGINE = MyISAM)) SELECT * FROM t; a b 61 Sixty one @@ -826,9 +826,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t; a b 1 First value @@ -864,9 +864,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t; a b 10 Ten @@ -905,9 +905,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t; ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MariaDB SHOW CREATE TABLE t; @@ -924,9 +924,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) # Test different charsets ALTER TABLE t ENGINE = MyISAM; CREATE TABLE tmp LIKE t; @@ -957,9 +957,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t; ERROR HY000: Non matching attribute 'MAX_ROWS' between partition and table SHOW WARNINGS; @@ -988,9 +988,9 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), KEY `ba_key` (`b`,`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 10 Ten @@ -1047,9 +1047,9 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), KEY `ba_key` (`b`,`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t; ERROR HY000: Table to exchange with partition is temporary: 't' SHOW CREATE TABLE t; @@ -1068,9 +1068,9 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), KEY `ba_key` (`b`,`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) DROP TEMPORARY TABLE t; ALTER TABLE tmp2 RENAME TO t; # Test non partitioned table diff --git a/mysql-test/r/partition_explicit_prune.result b/mysql-test/r/partition_explicit_prune.result index 1272ff8c5fc..65b8e8083fe 100644 --- a/mysql-test/r/partition_explicit_prune.result +++ b/mysql-test/r/partition_explicit_prune.result @@ -202,7 +202,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`), KEY `b` (`b`,`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION pNeg VALUES LESS THAN (0) (SUBPARTITION subp0 ENGINE = InnoDB, @@ -215,7 +215,7 @@ SUBPARTITION BY HASH (a) SUBPARTITION subp5 ENGINE = InnoDB), PARTITION `p100-99999` VALUES LESS THAN (100000) (SUBPARTITION subp6 ENGINE = InnoDB, - SUBPARTITION subp7 ENGINE = InnoDB)) */ + SUBPARTITION subp7 ENGINE = InnoDB)) # First test that the syntax is OK SHOW CREATE TABLE t1 PARTITION (subp0); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PARTITION (subp0)' at line 1 @@ -1125,7 +1125,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`), KEY `b` (`b`,`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION pNeg VALUES LESS THAN (0) (SUBPARTITION subp0 ENGINE = InnoDB, @@ -1138,7 +1138,7 @@ SUBPARTITION BY HASH (a) SUBPARTITION subp5 ENGINE = InnoDB), PARTITION `p100-99999` VALUES LESS THAN (100000) (SUBPARTITION subp6 ENGINE = InnoDB, - SUBPARTITION subp7 ENGINE = InnoDB)) */ + SUBPARTITION subp7 ENGINE = InnoDB)) SELECT * FROM t1; a b -4 (pNeg-)subp0, Updated, Updated2, Updated from a = -2 @@ -1157,7 +1157,7 @@ t2 CREATE TABLE `t2` ( PRIMARY KEY (`a`), KEY `b` (`b`,`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION pNeg VALUES LESS THAN (0) (SUBPARTITION subp0 ENGINE = InnoDB, @@ -1170,7 +1170,7 @@ SUBPARTITION BY HASH (a) SUBPARTITION subp5 ENGINE = InnoDB), PARTITION `p100-99999` VALUES LESS THAN (100000) (SUBPARTITION subp6 ENGINE = InnoDB, - SUBPARTITION subp7 ENGINE = InnoDB)) */ + SUBPARTITION subp7 ENGINE = InnoDB)) SELECT * FROM t2; a b 10 p10-99 @@ -1657,7 +1657,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`), KEY `b` (`b`,`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION pNeg VALUES LESS THAN (0) (SUBPARTITION subp0 ENGINE = InnoDB, @@ -1678,7 +1678,7 @@ SUBPARTITION BY HASH (a) PARTITION `p3000-299999` VALUES LESS THAN (300000) (SUBPARTITION subp12 ENGINE = InnoDB, SUBPARTITION subp13 ENGINE = InnoDB, - SUBPARTITION subp14 ENGINE = InnoDB)) */ + SUBPARTITION subp14 ENGINE = InnoDB)) INSERT INTO t1 VALUES (-9, "negative nine"), (-8, "-8"), (-7, "-7"), (-6, "-6"), (-5, "-5"), (-4, "-4"), (-3, "-3"), (-2, "-2"), (-1, "-1"); INSERT INTO t1 VALUES (9, "nine"), (8, "8"), (7, "7"), (6, "6"), (5, "5"), (4, "4"), (3, "3"), (2, "2"), (1, "1"); INSERT INTO t1 VALUES (39, "Thirty nine"), (38, "38"), (37, "37"), (36, "36"), (35, "35"), (34, "34"), (33, "33"), (32, "32"), (31, "31"); diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index df0bab4a6b4..46dcfe4231b 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -446,7 +446,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; create table t1 (a int) engine = innodb @@ -460,8 +460,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) drop table t1; SET SQL_MODE=default; create table t1 @@ -539,10 +539,10 @@ t1 CREATE TABLE `t1` ( `int_column` int(11) DEFAULT NULL, `char_column` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (int_column) + PARTITION BY RANGE (int_column) SUBPARTITION BY KEY (char_column) SUBPARTITIONS 2 -(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */ +(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) drop table t1; CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY list(a) (PARTITION p1 VALUES IN (1)); @@ -587,8 +587,8 @@ t1 CREATE TABLE `t1` ( `b` int(11) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 SELECT * FROM t1; a b 1 2 diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result index 16b5daad620..cd5dfade0ab 100644 --- a/mysql-test/r/partition_innodb_plugin.result +++ b/mysql-test/r/partition_innodb_plugin.result @@ -29,9 +29,9 @@ t1 CREATE TABLE `t1` ( `id2` bigint(20) NOT NULL, PRIMARY KEY (`id`,`time`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 -/*!50100 PARTITION BY RANGE (TO_DAYS(time)) + PARTITION BY RANGE (TO_DAYS(time)) (PARTITION p10 VALUES LESS THAN (734708) ENGINE = InnoDB, - PARTITION p20 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p20 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) DROP TABLE t1; call mtr.add_suppression("InnoDB: Error: table `test`.`t1` .* InnoDB internal"); # @@ -62,8 +62,8 @@ t1 CREATE TABLE `t1` ( `user_num` char(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 1 */ + PARTITION BY HASH (id) +PARTITIONS 1 SET GLOBAL innodb_file_per_table = OFF; disconnect con1; connect con2,localhost,root,,; @@ -100,8 +100,8 @@ t1 CREATE TABLE `t1` ( `user_num` char(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 3 */ + PARTITION BY HASH (id) +PARTITIONS 3 DROP TABLE t1; disconnect con2; connection default; diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result index 2ff6e3f1923..2acaf7356ef 100644 --- a/mysql-test/r/partition_mgm.result +++ b/mysql-test/r/partition_mgm.result @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) -PARTITIONS 2 */ + PARTITION BY HASH (YEAR(f_date)) +PARTITIONS 2 ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table @@ -33,8 +33,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) -PARTITIONS 1 */ + PARTITION BY HASH (YEAR(f_date)) +PARTITIONS 1 drop table t1; create table t1 (a int) partition by list (a) @@ -58,8 +58,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 5 */ + PARTITION BY HASH (a) +PARTITIONS 5 DROP TABLE t1; CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) @@ -70,8 +70,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 5 */ + PARTITION BY HASH (a) +PARTITIONS 5 DROP TABLE t1; CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) @@ -81,8 +81,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 5 */ + PARTITION BY HASH (a) +PARTITIONS 5 DROP TABLE t1; CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */; SHOW CREATE TABLE t1; @@ -90,6 +90,6 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 5 */ + PARTITION BY HASH (a) +PARTITIONS 5 DROP TABLE t1; diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result index cbf45a2b7be..9cfe0594a0c 100644 --- a/mysql-test/r/partition_mgm_err.result +++ b/mysql-test/r/partition_mgm_err.result @@ -145,8 +145,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 DROP TABLE t1; CREATE TABLE t1 (a INT) PARTITION BY HASH(a); ALTER TABLE t1 ADD PARTITION PARTITIONS 4; diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index bb1a7b19a9d..f9f917a2803 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -27,10 +27,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CHECKSUM=1 -/*!50100 PARTITION BY RANGE (i) + PARTITION BY RANGE (i) (PARTITION p3 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN (5) ENGINE = MyISAM, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) DROP TABLE t1; # Same test without partitioning CREATE TABLE t1 ( @@ -131,7 +131,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`a`) ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) INSERT INTO t1 VALUES (NULL); SELECT * FROM t1; a diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result index a1da9af675b..afde7977961 100644 --- a/mysql-test/r/partition_not_windows.result +++ b/mysql-test/r/partition_not_windows.result @@ -31,8 +31,8 @@ Table Create Table t2 CREATE TABLE `t2` ( `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (i) -(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ + PARTITION BY RANGE (i) +(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) DROP TABLE t1, t2; set @@sql_mode=@org_mode; CREATE TABLE t1(a INT) diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 339f2209cb3..94c727f6339 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -22,9 +22,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE (TO_DAYS(a)) + PARTITION BY RANGE (TO_DAYS(a)) SUBPARTITION BY HASH (to_seconds(a)) -(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) drop table t1; create table t1 (a int) partition by range (a) @@ -62,9 +62,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE (TO_SECONDS(a)) + PARTITION BY RANGE (TO_SECONDS(a)) (PARTITION p0 VALUES LESS THAN (63340531200) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (63342604800) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (63342604800) ENGINE = MyISAM) drop table t1; create table t1 (a date) partition by range(to_seconds(a)) @@ -93,9 +93,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE (to_seconds(a)) + PARTITION BY RANGE (to_seconds(a)) (PARTITION p0 VALUES LESS THAN (63240134400) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (63271756800) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (63271756800) ENGINE = MyISAM) drop table t1; create table t1 (a datetime) partition by range(to_seconds(a)) @@ -123,9 +123,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY RANGE (to_seconds(a)) + PARTITION BY RANGE (to_seconds(a)) (PARTITION p0 VALUES LESS THAN (63240177600) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (63271800000) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (63271800000) ENGINE = MyISAM) drop table t1; create table t1 (a int, b char(20)) partition by range columns(a,b) @@ -153,8 +153,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) drop table t1; create table t1 (a integer) partition by range (a) @@ -284,10 +284,10 @@ t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, - PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */ + PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) ALTER TABLE t1 partition by range (a) partitions 3 @@ -308,10 +308,10 @@ t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, - PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */ + PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) drop table if exists t1; CREATE TABLE t1 ( a int not null, @@ -409,14 +409,14 @@ t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, - SUBPARTITION x22 ENGINE = MyISAM)) */ + SUBPARTITION x22 ENGINE = MyISAM)) ALTER TABLE t1 ADD COLUMN d int; show create table t1; Table Create Table @@ -427,14 +427,14 @@ t1 CREATE TABLE `t1` ( `d` int(11) DEFAULT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, - SUBPARTITION x22 ENGINE = MyISAM)) */ + SUBPARTITION x22 ENGINE = MyISAM)) drop table t1; CREATE TABLE t1 ( a int not null, @@ -658,9 +658,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) drop table t1; create table t1 (a bigint unsigned) partition by range (a) @@ -671,9 +671,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) insert into t1 values (0xFFFFFFFFFFFFFFFF); ERROR HY000: Table has no partition for value 18446744073709551615 drop table t1; diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result index 387717ab7e7..3f175bb7534 100644 --- a/mysql-test/r/partition_symlink.result +++ b/mysql-test/r/partition_symlink.result @@ -22,10 +22,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, - PARTITION p2 VALUES IN (2) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (2) ENGINE = MyISAM) SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -158,8 +158,8 @@ Table Create Table t2 CREATE TABLE `t2` ( `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (i) -(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ + PARTITION BY RANGE (i) +(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) DROP TABLE t1, t2; set @@sql_mode=@org_mode; create table t1 (a int) diff --git a/mysql-test/r/partition_utf8.result b/mysql-test/r/partition_utf8.result index 339871f1f4a..c359980be51 100644 --- a/mysql-test/r/partition_utf8.result +++ b/mysql-test/r/partition_utf8.result @@ -7,8 +7,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) -(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */ + PARTITION BY LIST COLUMNS(a) +(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) drop table t1; create table t1 (a varchar(2) character set cp1250) partition by list columns (a) @@ -18,8 +18,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) -(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */ + PARTITION BY LIST COLUMNS(a) +(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) drop table t1; create table t1 (a varchar(1500), b varchar(1570)) partition by list columns(a,b) @@ -45,9 +45,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50500 PARTITION BY LIST COLUMNS(a) + PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN ('†') ENGINE = MyISAM, - PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */ + PARTITION p1 VALUES IN ('') ENGINE = MyISAM) insert into t1 values (''); insert into t1 values (_ucs2 0x2020); drop table t1; diff --git a/mysql-test/suite/archive/partition_archive.result b/mysql-test/suite/archive/partition_archive.result index c4cccc03a04..1ed979f2c92 100644 --- a/mysql-test/suite/archive/partition_archive.result +++ b/mysql-test/suite/archive/partition_archive.result @@ -84,7 +84,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) */ + PARTITION BY HASH (a) drop table t1; CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT, f1 VARCHAR(25), @@ -109,7 +109,7 @@ t1 CREATE TABLE `t1` ( `f1` varchar(25) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE, @@ -122,7 +122,7 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE, PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE, PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) select count(*) from t1; count(*) 100 @@ -138,8 +138,8 @@ t1 CREATE TABLE `t1` ( `fld1` int(11) NOT NULL, PRIMARY KEY (`fld1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (fld1) -PARTITIONS 5 */ + PARTITION BY HASH (fld1) +PARTITIONS 5 ALTER TABLE t1 ENGINE= ARCHIVE; ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") #After the patch, the ENGINE is correctly displayed as MyISAM @@ -149,8 +149,8 @@ t1 CREATE TABLE `t1` ( `fld1` int(11) NOT NULL, PRIMARY KEY (`fld1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (fld1) -PARTITIONS 5 */ + PARTITION BY HASH (fld1) +PARTITIONS 5 #Cleanup. DROP TABLE t1; create database mysqltest1; diff --git a/mysql-test/suite/encryption/r/encryption_force.result b/mysql-test/suite/encryption/r/encryption_force.result index de5f7da60a8..164a0067062 100644 --- a/mysql-test/suite/encryption/r/encryption_force.result +++ b/mysql-test/suite/encryption/r/encryption_force.result @@ -31,8 +31,8 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 alter table t1 encrypted=no; ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") alter table t2 encrypted=yes; diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_analyze.result b/mysql-test/suite/engines/funcs/r/tc_partition_analyze.result index 4611766d5ca..852b300332b 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_analyze.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_analyze.result @@ -24,13 +24,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 ANALYZE PARTITION p1,p2; Table Op Msg_type Msg_text test.t1 analyze status OK @@ -48,13 +48,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_change_from_range_to_hash_key.result b/mysql-test/suite/engines/funcs/r/tc_partition_change_from_range_to_hash_key.result index bbaaeea8af7..805e4637928 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_change_from_range_to_hash_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_change_from_range_to_hash_key.result @@ -34,8 +34,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -56,8 +56,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -97,8 +97,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -119,8 +119,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -160,8 +160,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -182,8 +182,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -223,8 +223,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -245,8 +245,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -286,8 +286,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -308,8 +308,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -349,8 +349,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -371,8 +371,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -412,8 +412,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -434,8 +434,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -475,8 +475,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -497,8 +497,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -538,8 +538,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -560,8 +560,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -601,8 +601,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -623,8 +623,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -664,8 +664,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -686,8 +686,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -727,8 +727,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 ALTER TABLE t1 COALESCE PARTITION 2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -749,8 +749,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 3 */ + PARTITION BY KEY (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_check.result b/mysql-test/suite/engines/funcs/r/tc_partition_check.result index c03de001177..f2e10ec2a06 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_check.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_check.result @@ -24,13 +24,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 CHECK PARTITION p1,p2; Table Op Msg_type Msg_text test.t1 check status OK @@ -48,13 +48,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_hash.result b/mysql-test/suite/engines/funcs/r/tc_partition_hash.result index 72f32932bc0..8c29eb32d90 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_hash.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_hash.result @@ -9,8 +9,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -54,8 +54,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -69,8 +69,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -84,8 +84,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -99,8 +99,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -114,8 +114,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -129,8 +129,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -144,8 +144,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -159,8 +159,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -174,8 +174,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 1 */ + PARTITION BY HASH (c1) +PARTITIONS 1 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -189,8 +189,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -204,8 +204,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -219,8 +219,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -234,8 +234,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -249,8 +249,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -264,8 +264,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -279,8 +279,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -294,8 +294,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -309,8 +309,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -324,8 +324,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -339,8 +339,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -354,8 +354,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -369,8 +369,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -384,8 +384,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -399,8 +399,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -414,8 +414,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -429,8 +429,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -444,8 +444,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -459,8 +459,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -474,8 +474,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -489,8 +489,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -504,8 +504,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -519,8 +519,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -534,8 +534,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 3 */ + PARTITION BY HASH (c1) +PARTITIONS 3 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -549,8 +549,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -564,8 +564,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -579,8 +579,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -594,8 +594,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -609,8 +609,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -624,8 +624,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -639,8 +639,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -654,8 +654,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -669,8 +669,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -684,8 +684,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -699,8 +699,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -714,8 +714,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 4 */ + PARTITION BY HASH (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -729,8 +729,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -744,8 +744,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -759,8 +759,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -774,8 +774,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -789,8 +789,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -804,8 +804,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -819,8 +819,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -834,8 +834,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -849,8 +849,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -864,8 +864,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -879,8 +879,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -894,8 +894,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 5 */ + PARTITION BY HASH (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -909,8 +909,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -924,8 +924,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -939,8 +939,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -954,8 +954,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -969,8 +969,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -984,8 +984,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -999,8 +999,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1014,8 +1014,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1029,8 +1029,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1044,8 +1044,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1059,8 +1059,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1074,8 +1074,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1089,8 +1089,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1104,8 +1104,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1119,8 +1119,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1134,8 +1134,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1149,8 +1149,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1164,8 +1164,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1179,8 +1179,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1194,8 +1194,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1209,8 +1209,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1224,8 +1224,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1239,8 +1239,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1254,8 +1254,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 50 */ + PARTITION BY HASH (c1) +PARTITIONS 50 DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_hash_date_function.result b/mysql-test/suite/engines/funcs/r/tc_partition_hash_date_function.result index ff154b8db6e..368ba8c0249 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_hash_date_function.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_hash_date_function.result @@ -10,7 +10,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -25,7 +25,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -40,7 +40,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -55,7 +55,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -70,7 +70,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -85,7 +85,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -100,7 +100,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -115,7 +115,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -130,7 +130,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -145,7 +145,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -160,7 +160,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -175,7 +175,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(c3)) */ + PARTITION BY HASH (YEAR(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -190,7 +190,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -205,7 +205,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -220,7 +220,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -235,7 +235,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -250,7 +250,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -265,7 +265,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -280,7 +280,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -295,7 +295,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -310,7 +310,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -325,7 +325,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -340,7 +340,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -355,7 +355,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (MONTH(c3)) */ + PARTITION BY HASH (MONTH(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -370,7 +370,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -385,7 +385,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -400,7 +400,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -415,7 +415,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -430,7 +430,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -445,7 +445,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -460,7 +460,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -475,7 +475,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -490,7 +490,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -505,7 +505,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -520,7 +520,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -535,7 +535,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAY(c3)) */ + PARTITION BY HASH (DAY(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -550,7 +550,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -565,7 +565,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -580,7 +580,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -595,7 +595,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -610,7 +610,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -625,7 +625,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -640,7 +640,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -655,7 +655,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -670,7 +670,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -685,7 +685,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -700,7 +700,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test @@ -715,7 +715,7 @@ t2 CREATE TABLE `t2` ( `c2` char(5) DEFAULT NULL, `c3` datetime DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFWEEK(c3)) */ + PARTITION BY HASH (DAYOFWEEK(c3)) DROP TABLE t2; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_key.result b/mysql-test/suite/engines/funcs/r/tc_partition_key.result index 309ddfe2bd9..9ca335be0e2 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_key.result @@ -9,8 +9,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -54,8 +54,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -69,8 +69,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -84,8 +84,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -99,8 +99,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -114,8 +114,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -129,8 +129,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -144,8 +144,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -159,8 +159,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -174,8 +174,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -189,8 +189,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -204,8 +204,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -219,8 +219,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -234,8 +234,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -249,8 +249,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -264,8 +264,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -279,8 +279,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -294,8 +294,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -309,8 +309,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -324,8 +324,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -339,8 +339,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -354,8 +354,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -369,8 +369,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -384,8 +384,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -399,8 +399,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -414,8 +414,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -429,8 +429,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -444,8 +444,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -459,8 +459,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -474,8 +474,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -489,8 +489,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -504,8 +504,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -519,8 +519,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -534,8 +534,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 5 */ + PARTITION BY KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -549,8 +549,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -564,8 +564,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -579,8 +579,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -594,8 +594,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -609,8 +609,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -624,8 +624,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -639,8 +639,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -654,8 +654,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -669,8 +669,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -684,8 +684,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -699,8 +699,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -714,8 +714,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 99 */ + PARTITION BY KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_linear_key.result b/mysql-test/suite/engines/funcs/r/tc_partition_linear_key.result index ae543da271c..0a560743832 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_linear_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_linear_key.result @@ -9,8 +9,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -54,8 +54,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -69,8 +69,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -84,8 +84,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -99,8 +99,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -114,8 +114,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -129,8 +129,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -144,8 +144,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -159,8 +159,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -174,8 +174,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -189,8 +189,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -204,8 +204,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -219,8 +219,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -234,8 +234,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -249,8 +249,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -264,8 +264,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -279,8 +279,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -294,8 +294,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -309,8 +309,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -324,8 +324,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -339,8 +339,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -354,8 +354,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 4 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 4 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -369,8 +369,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -384,8 +384,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -399,8 +399,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -414,8 +414,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -429,8 +429,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -444,8 +444,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -459,8 +459,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -474,8 +474,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -489,8 +489,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -504,8 +504,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -519,8 +519,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -534,8 +534,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 5 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 5 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -549,8 +549,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -564,8 +564,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -579,8 +579,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -594,8 +594,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -609,8 +609,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -624,8 +624,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -639,8 +639,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -654,8 +654,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -669,8 +669,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -684,8 +684,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -699,8 +699,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -714,8 +714,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 99 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 99 DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_optimize.result b/mysql-test/suite/engines/funcs/r/tc_partition_optimize.result index 78ad0ae8c7d..c30705c8194 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_optimize.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_optimize.result @@ -24,13 +24,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 OPTIMIZE PARTITION p1,p2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -46,13 +46,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_rebuild.result b/mysql-test/suite/engines/funcs/r/tc_partition_rebuild.result index d2512532436..bef7ba0635d 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_rebuild.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_rebuild.result @@ -24,13 +24,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 REBUILD PARTITION p1,p2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -46,13 +46,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_remove.result b/mysql-test/suite/engines/funcs/r/tc_partition_remove.result index ee91c5e358d..6e7831bd6c5 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_remove.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_remove.result @@ -21,7 +21,7 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -60,7 +60,7 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -99,7 +99,7 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -138,7 +138,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -177,7 +177,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -216,7 +216,7 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -298,7 +298,7 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -337,7 +337,7 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -376,7 +376,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -415,7 +415,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -454,7 +454,7 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) */ + PARTITION BY HASH (c1) ALTER TABLE t1 REMOVE PARTITIONING; SELECT * FROM t1 ORDER BY c1; c1 c2 diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result index a4c456d14bd..517c16083b3 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result @@ -44,12 +44,12 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -71,11 +71,11 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -125,12 +125,12 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -152,11 +152,11 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -206,12 +206,12 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -233,11 +233,11 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -287,12 +287,12 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -314,11 +314,11 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -368,12 +368,12 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -395,11 +395,11 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -449,12 +449,12 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION s1 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION s2; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION s1; @@ -476,11 +476,11 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION s0 VALUES LESS THAN (3) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (20) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_hash_key.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_hash_key.result index 3556bcf1e4f..18f07127cb3 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_hash_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_hash_key.result @@ -19,8 +19,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -41,8 +41,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SHOW TABLES; Tables_in_test @@ -63,16 +63,16 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -97,8 +97,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -119,8 +119,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -141,16 +141,16 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -175,8 +175,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -197,8 +197,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -219,16 +219,16 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -253,8 +253,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -275,8 +275,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -297,16 +297,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -331,8 +331,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -353,8 +353,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -375,16 +375,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -409,8 +409,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 10 */ + PARTITION BY HASH (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -431,8 +431,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 20 */ + PARTITION BY HASH (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -453,16 +453,16 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -487,8 +487,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -509,8 +509,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -531,16 +531,16 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -565,8 +565,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -587,8 +587,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -609,16 +609,16 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -643,8 +643,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -665,8 +665,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -687,16 +687,16 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -721,8 +721,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -743,8 +743,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -765,16 +765,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -799,8 +799,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -821,8 +821,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -843,16 +843,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -877,8 +877,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 10 */ + PARTITION BY KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -899,8 +899,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 20 */ + PARTITION BY KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -921,16 +921,16 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 2 */ + PARTITION BY KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -955,8 +955,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -977,8 +977,8 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -999,16 +999,16 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1033,8 +1033,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1055,8 +1055,8 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1077,16 +1077,16 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1111,8 +1111,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1133,8 +1133,8 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1155,16 +1155,16 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1189,8 +1189,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1211,8 +1211,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1233,16 +1233,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1267,8 +1267,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1289,8 +1289,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1311,16 +1311,16 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -1345,8 +1345,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 10 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 10 ALTER TABLE t1 ADD PARTITION PARTITIONS 10; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1367,8 +1367,8 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 20 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 20 ALTER TABLE t1 COALESCE PARTITION 18; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -1389,16 +1389,16 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LINEAR KEY (c1) -PARTITIONS 2 */ + PARTITION BY LINEAR KEY (c1) +PARTITIONS 2 DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result index d7ffd0218cf..618b8dd2465 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result @@ -41,10 +41,10 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -63,9 +63,9 @@ t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -112,10 +112,10 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -134,9 +134,9 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -183,10 +183,10 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -205,9 +205,9 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -254,10 +254,10 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -276,9 +276,9 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -325,10 +325,10 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -347,9 +347,9 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -396,10 +396,10 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, PARTITION m0 VALUES LESS THAN (30) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 DROP PARTITION m1; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 DROP PARTITION m0; @@ -418,9 +418,9 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( c1) + PARTITION BY RANGE ( c1) (PARTITION p0 VALUES LESS THAN (10) ENGINE = ENGINE, - PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p3 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_repair.result b/mysql-test/suite/engines/funcs/r/tc_partition_repair.result index 254d527624a..98d9aa93740 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_repair.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_repair.result @@ -24,13 +24,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) ALTER TABLE t1 REPAIR PARTITION p1,p2; SELECT * FROM t1 ORDER BY c1; c1 c2 @@ -46,13 +46,13 @@ t1 CREATE TABLE `t1` ( `c2` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (200) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (300) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (400) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (500) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_sub1.result b/mysql-test/suite/engines/funcs/r/tc_partition_sub1.result index a122f75b69a..6d1dc41a354 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_sub1.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_sub1.result @@ -45,12 +45,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -100,12 +100,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -155,12 +155,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -210,12 +210,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -265,12 +265,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -320,12 +320,12 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN (1990) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (2000) ENGINE = ENGINE, - PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_sub2.result b/mysql-test/suite/engines/funcs/r/tc_partition_sub2.result index bd1cd1b3b21..c6a0d9aac68 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_sub2.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_sub2.result @@ -53,7 +53,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -63,7 +63,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -121,7 +121,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -131,7 +131,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -189,7 +189,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -199,7 +199,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -257,7 +257,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -267,7 +267,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -325,7 +325,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -335,7 +335,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -393,7 +393,7 @@ t1 CREATE TABLE `t1` ( `name` varchar(30) DEFAULT NULL, `purchased` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ( YEAR(purchased)) + PARTITION BY RANGE ( YEAR(purchased)) SUBPARTITION BY HASH ( TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0 ENGINE = ENGINE, @@ -403,7 +403,7 @@ SUBPARTITION BY HASH ( TO_DAYS(purchased)) SUBPARTITION s3 ENGINE = ENGINE), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION s4 ENGINE = ENGINE, - SUBPARTITION s5 ENGINE = ENGINE)) */ + SUBPARTITION s5 ENGINE = ENGINE)) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_value.result b/mysql-test/suite/engines/funcs/r/tc_partition_value.result index f8cf5804dc6..98a5f885e4b 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_value.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_value.result @@ -15,13 +15,13 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (1991) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (1995) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (1999) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (2002) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (2006) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -41,13 +41,13 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (1991) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (1995) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (1999) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (2002) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (2006) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -67,13 +67,13 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (1991) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (1995) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (1999) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (2002) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (2006) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -93,13 +93,13 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (1991) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (1995) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (1999) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (2002) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (2006) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -119,13 +119,13 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) (PARTITION p0 VALUES LESS THAN (1991) ENGINE = ENGINE, PARTITION p1 VALUES LESS THAN (1995) ENGINE = ENGINE, PARTITION p2 VALUES LESS THAN (1999) ENGINE = ENGINE, PARTITION p3 VALUES LESS THAN (2002) ENGINE = ENGINE, PARTITION p4 VALUES LESS THAN (2006) ENGINE = ENGINE, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_value_specific.result b/mysql-test/suite/engines/funcs/r/tc_partition_value_specific.result index d524486d7b7..71a38814fd8 100644 --- a/mysql-test/suite/engines/funcs/r/tc_partition_value_specific.result +++ b/mysql-test/suite/engines/funcs/r/tc_partition_value_specific.result @@ -13,11 +13,11 @@ t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (c1) + PARTITION BY LIST (c1) (PARTITION r0 VALUES IN (1,5,9,13,17,21) ENGINE = ENGINE, PARTITION r1 VALUES IN (2,6,10,14,18,22) ENGINE = ENGINE, PARTITION r2 VALUES IN (3,7,11,15,19,23) ENGINE = ENGINE, - PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) */ + PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -35,11 +35,11 @@ t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (c1) + PARTITION BY LIST (c1) (PARTITION r0 VALUES IN (1,5,9,13,17,21) ENGINE = ENGINE, PARTITION r1 VALUES IN (2,6,10,14,18,22) ENGINE = ENGINE, PARTITION r2 VALUES IN (3,7,11,15,19,23) ENGINE = ENGINE, - PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) */ + PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -57,11 +57,11 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (c1) + PARTITION BY LIST (c1) (PARTITION r0 VALUES IN (1,5,9,13,17,21) ENGINE = ENGINE, PARTITION r1 VALUES IN (2,6,10,14,18,22) ENGINE = ENGINE, PARTITION r2 VALUES IN (3,7,11,15,19,23) ENGINE = ENGINE, - PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) */ + PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -79,11 +79,11 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (c1) + PARTITION BY LIST (c1) (PARTITION r0 VALUES IN (1,5,9,13,17,21) ENGINE = ENGINE, PARTITION r1 VALUES IN (2,6,10,14,18,22) ENGINE = ENGINE, PARTITION r2 VALUES IN (3,7,11,15,19,23) ENGINE = ENGINE, - PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) */ + PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test @@ -101,11 +101,11 @@ t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (c1) + PARTITION BY LIST (c1) (PARTITION r0 VALUES IN (1,5,9,13,17,21) ENGINE = ENGINE, PARTITION r1 VALUES IN (2,6,10,14,18,22) ENGINE = ENGINE, PARTITION r2 VALUES IN (3,7,11,15,19,23) ENGINE = ENGINE, - PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) */ + PARTITION r3 VALUES IN (4,8,12,16,20,24) ENGINE = ENGINE) DROP TABLE t1; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/federated/federated_partition.result b/mysql-test/suite/federated/federated_partition.result index 8d0840a1d2d..8485328a166 100644 --- a/mysql-test/suite/federated/federated_partition.result +++ b/mysql-test/suite/federated/federated_partition.result @@ -21,9 +21,9 @@ t1 CREATE TABLE `t1` ( `s1` int(11) NOT NULL, PRIMARY KEY (`s1`) ) ENGINE=FEDERATED DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (s1) + PARTITION BY LIST (s1) (PARTITION p1 VALUES IN (1,3) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1' ENGINE = FEDERATED, - PARTITION p2 VALUES IN (2,4) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2' ENGINE = FEDERATED) */ + PARTITION p2 VALUES IN (2,4) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2' ENGINE = FEDERATED) insert into t1 values (1), (2), (3), (4); select * from t1; s1 diff --git a/mysql-test/suite/galera/r/partition.result b/mysql-test/suite/galera/r/partition.result index 15f0275a04c..824572065c1 100644 --- a/mysql-test/suite/galera/r/partition.result +++ b/mysql-test/suite/galera/r/partition.result @@ -56,10 +56,10 @@ t1 CREATE TABLE `t1` ( `i` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`i`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (i) + PARTITION BY RANGE (i) (PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SHOW CREATE TABLE p1; Table Create Table p1 CREATE TABLE `p1` ( @@ -93,9 +93,9 @@ t1 CREATE TABLE `t1` ( `i` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`i`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (i) + PARTITION BY RANGE (i) (PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) # On node_2 connection node_2; @@ -105,9 +105,9 @@ t1 CREATE TABLE `t1` ( `i` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`i`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (i) + PARTITION BY RANGE (i) (PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) DROP TABLE t1, p1; # # MDEV-5146: Bulk loads into partitioned table not working diff --git a/mysql-test/suite/innodb_zip/r/restart.result b/mysql-test/suite/innodb_zip/r/restart.result index fdcbc260044..4820914f760 100644 --- a/mysql-test/suite/innodb_zip/r/restart.result +++ b/mysql-test/suite/innodb_zip/r/restart.result @@ -145,10 +145,10 @@ t6_restart CREATE TABLE `t6_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) SELECT count(*) FROM t6_restart; count(*) 16 @@ -181,14 +181,14 @@ t7_restart CREATE TABLE `t7_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) SELECT count(*) FROM t7_restart; count(*) 16 @@ -325,10 +325,10 @@ t6_restart CREATE TABLE `t6_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) SHOW CREATE TABLE t7_restart; Table Create Table t7_restart CREATE TABLE `t7_restart` ( @@ -339,14 +339,14 @@ t7_restart CREATE TABLE `t7_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); @@ -456,10 +456,10 @@ t6_restart CREATE TABLE `t6_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) SELECT count(*) FROM t7_restart; count(*) 9 @@ -473,14 +473,14 @@ t7_restart CREATE TABLE `t7_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) # # Shutdown the server and make a backup of a tablespace # @@ -555,10 +555,10 @@ t6_restart CREATE TABLE `t6_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) SELECT count(*) FROM t7_restart; count(*) 9 @@ -572,14 +572,14 @@ t7_restart CREATE TABLE `t7_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) # # Try to rename a tablespace to a file that already exists # @@ -657,10 +657,10 @@ t66_restart CREATE TABLE `t66_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); SELECT count(*) FROM t77_restart; count(*) @@ -675,14 +675,14 @@ t77_restart CREATE TABLE `t77_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) ---- MYSQL_DATA_DIR/test t4_restart.frm t4_restart.ibd @@ -753,10 +753,10 @@ t66_restart CREATE TABLE `t66_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); SELECT count(*) FROM t77_restart; count(*) @@ -771,14 +771,14 @@ t77_restart CREATE TABLE `t77_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) # # Shutdown the server # @@ -898,10 +898,10 @@ t66_restart CREATE TABLE `t66_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, - PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB) */ + PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB) INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); SELECT count(*) FROM t77_restart; count(*) @@ -916,14 +916,14 @@ t77_restart CREATE TABLE `t77_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, - SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB)) */ + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB)) # # Shutdown the server # @@ -1033,10 +1033,10 @@ t66_restart CREATE TABLE `t66_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 ENGINE = InnoDB, PARTITION p1 ENGINE = InnoDB, - PARTITION p2 ENGINE = InnoDB) */ + PARTITION p2 ENGINE = InnoDB) INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); SELECT count(*) FROM t77_restart; count(*) @@ -1051,14 +1051,14 @@ t77_restart CREATE TABLE `t77_restart` ( `c5` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -/*!50100 PARTITION BY RANGE (c1) + PARTITION BY RANGE (c1) SUBPARTITION BY HASH (c1) (PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0 ENGINE = InnoDB, SUBPARTITION s1 ENGINE = InnoDB), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s2 ENGINE = InnoDB, - SUBPARTITION s3 ENGINE = InnoDB)) */ + SUBPARTITION s3 ENGINE = InnoDB)) # # Cleanup # diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result index c4eeb25d6b4..e0c16eeba74 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result @@ -620,7 +620,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -628,7 +628,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 15 @@ -2317,7 +2317,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -2325,7 +2325,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 15 @@ -3667,7 +3667,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -3675,7 +3675,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-05 @@ -4184,7 +4184,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -4192,7 +4192,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-05 @@ -4701,7 +4701,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -4709,7 +4709,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -5230,7 +5230,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -5238,7 +5238,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -5749,7 +5749,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -5757,7 +5757,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -6268,7 +6268,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -6276,7 +6276,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 09:09:15 @@ -6793,7 +6793,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time(6) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -6801,7 +6801,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 05:30:34.000037 @@ -7314,7 +7314,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -7322,7 +7322,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 10:24:23 @@ -7845,7 +7845,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -7853,7 +7853,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 09:09:15 @@ -8376,7 +8376,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -8384,7 +8384,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -8901,7 +8901,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -8909,7 +8909,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -9424,7 +9424,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -9432,7 +9432,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -9945,7 +9945,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -9953,7 +9953,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -10470,7 +10470,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, @@ -10478,7 +10478,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) select * from t55 order by colint; colint col1 1 2006-02-03 diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result index e4bf955f16a..b211340a6ff 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result @@ -620,7 +620,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -628,7 +628,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 15 @@ -2317,7 +2317,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -2325,7 +2325,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 15 @@ -3667,7 +3667,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -3675,7 +3675,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-05 @@ -4184,7 +4184,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -4192,7 +4192,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-05 @@ -4701,7 +4701,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -4709,7 +4709,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -5230,7 +5230,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -5238,7 +5238,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -5749,7 +5749,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -5757,7 +5757,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -6268,7 +6268,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -6276,7 +6276,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 09:09:15 @@ -6793,7 +6793,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time(6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -6801,7 +6801,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 05:30:34.000037 @@ -7314,7 +7314,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -7322,7 +7322,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 10:24:23 @@ -7845,7 +7845,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -7853,7 +7853,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 09:09:15 @@ -8376,7 +8376,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -8384,7 +8384,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -8901,7 +8901,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -8909,7 +8909,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -9424,7 +9424,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -9432,7 +9432,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -9945,7 +9945,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -9953,7 +9953,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 @@ -10470,7 +10470,7 @@ t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (colint) + PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, @@ -10478,7 +10478,7 @@ SUBPARTITIONS 5 PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, - PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) select * from t55 order by colint; colint col1 1 2006-02-03 diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result index c55fab0f5cc..b126d459335 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result @@ -75,8 +75,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -567,8 +567,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1067,7 +1067,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1075,7 +1075,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1572,13 +1572,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2071,13 +2071,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2574,7 +2574,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2587,7 +2587,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3084,7 +3084,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -3097,7 +3097,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3592,12 +3592,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4089,8 +4089,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4581,8 +4581,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5081,7 +5081,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -5089,7 +5089,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5586,13 +5586,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6085,13 +6085,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6588,7 +6588,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6601,7 +6601,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7098,7 +7098,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -7111,7 +7111,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7606,12 +7606,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8104,8 +8104,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8612,8 +8612,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9128,7 +9128,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -9136,7 +9136,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9649,13 +9649,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10164,13 +10164,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10683,7 +10683,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10696,7 +10696,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11209,7 +11209,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -11222,7 +11222,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11733,12 +11733,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12246,8 +12246,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12754,8 +12754,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13270,7 +13270,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -13278,7 +13278,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13791,13 +13791,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14306,13 +14306,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14825,7 +14825,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14838,7 +14838,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15351,7 +15351,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -15364,7 +15364,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15875,12 +15875,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16390,8 +16390,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16883,8 +16883,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17384,7 +17384,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -17392,7 +17392,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17890,13 +17890,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18390,13 +18390,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18894,7 +18894,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18907,7 +18907,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19405,7 +19405,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -19418,7 +19418,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19914,12 +19914,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20412,8 +20412,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20905,8 +20905,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21406,7 +21406,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -21414,7 +21414,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21912,13 +21912,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22412,13 +22412,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22916,7 +22916,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -22929,7 +22929,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23427,7 +23427,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -23440,7 +23440,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23936,12 +23936,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24434,8 +24434,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24927,8 +24927,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25428,7 +25428,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -25436,7 +25436,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25934,13 +25934,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26434,13 +26434,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26938,7 +26938,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -26951,7 +26951,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27449,7 +27449,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -27462,7 +27462,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27958,12 +27958,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result index 3d5548c340b..ae352a35a36 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result @@ -75,8 +75,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -592,8 +592,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1123,7 +1123,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1131,7 +1131,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1665,13 +1665,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -2197,13 +2197,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2737,7 +2737,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2750,7 +2750,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -3284,7 +3284,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -3297,7 +3297,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3829,12 +3829,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -4365,8 +4365,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -4882,8 +4882,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -5413,7 +5413,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -5421,7 +5421,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5955,13 +5955,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -6487,13 +6487,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -7027,7 +7027,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -7040,7 +7040,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -7574,7 +7574,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -7587,7 +7587,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -8119,12 +8119,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result index 29aaa2713c1..30dd7222570 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result @@ -393,8 +393,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -885,8 +885,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1385,7 +1385,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1393,7 +1393,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1890,13 +1890,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2389,13 +2389,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2894,7 +2894,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2907,7 +2907,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3404,7 +3404,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -3417,7 +3417,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3912,12 +3912,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4409,8 +4409,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4901,8 +4901,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5401,7 +5401,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -5409,7 +5409,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5906,13 +5906,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6405,13 +6405,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6910,7 +6910,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6923,7 +6923,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7420,7 +7420,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -7433,7 +7433,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7928,12 +7928,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8426,8 +8426,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8934,8 +8934,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9450,7 +9450,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -9458,7 +9458,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9971,13 +9971,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10486,13 +10486,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11007,7 +11007,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -11020,7 +11020,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11533,7 +11533,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -11546,7 +11546,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12057,12 +12057,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12570,8 +12570,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13078,8 +13078,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13594,7 +13594,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -13602,7 +13602,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14115,13 +14115,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14630,13 +14630,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15151,7 +15151,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -15164,7 +15164,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15677,7 +15677,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -15690,7 +15690,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16201,12 +16201,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 4f724d3c8b2..6c769bd8cd9 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -234,8 +234,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -751,8 +751,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1282,7 +1282,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1290,7 +1290,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1824,13 +1824,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -2356,13 +2356,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2898,7 +2898,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2911,7 +2911,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -3445,7 +3445,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -3458,7 +3458,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3990,12 +3990,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -4526,8 +4526,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -5043,8 +5043,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -5574,7 +5574,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -5582,7 +5582,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -6116,13 +6116,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -6648,13 +6648,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -7190,7 +7190,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -7203,7 +7203,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -7737,7 +7737,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -7750,7 +7750,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -8282,12 +8282,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result index d52a3180124..f4765293d15 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result @@ -73,8 +73,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -513,8 +513,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -961,7 +961,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -969,7 +969,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1414,13 +1414,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1861,13 +1861,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2314,7 +2314,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2327,7 +2327,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2772,7 +2772,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2785,7 +2785,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3228,12 +3228,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3673,8 +3673,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4113,8 +4113,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4561,7 +4561,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4569,7 +4569,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5014,13 +5014,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5461,13 +5461,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5914,7 +5914,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -5927,7 +5927,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6372,7 +6372,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6385,7 +6385,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6828,12 +6828,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7273,8 +7273,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7729,8 +7729,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8193,7 +8193,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8201,7 +8201,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8662,13 +8662,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9125,13 +9125,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9594,7 +9594,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -9607,7 +9607,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10068,7 +10068,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10081,7 +10081,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10540,12 +10540,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11005,8 +11005,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11445,8 +11445,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11893,7 +11893,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -11901,7 +11901,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12346,13 +12346,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12793,13 +12793,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13244,7 +13244,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -13257,7 +13257,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13702,7 +13702,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -13715,7 +13715,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14158,12 +14158,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14603,8 +14603,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15043,8 +15043,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15491,7 +15491,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -15499,7 +15499,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15944,13 +15944,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16391,13 +16391,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16842,7 +16842,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -16855,7 +16855,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17300,7 +17300,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -17313,7 +17313,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17756,12 +17756,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18202,8 +18202,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18658,8 +18658,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19122,7 +19122,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -19130,7 +19130,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19591,13 +19591,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20054,13 +20054,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20521,7 +20521,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -20534,7 +20534,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20995,7 +20995,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -21008,7 +21008,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21467,12 +21467,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21928,8 +21928,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22384,8 +22384,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22848,7 +22848,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -22856,7 +22856,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23317,13 +23317,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23780,13 +23780,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24247,7 +24247,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -24260,7 +24260,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24721,7 +24721,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -24734,7 +24734,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25193,12 +25193,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25655,8 +25655,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26095,8 +26095,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26543,7 +26543,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -26551,7 +26551,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26996,13 +26996,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27443,13 +27443,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27894,7 +27894,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -27907,7 +27907,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28352,7 +28352,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -28365,7 +28365,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28808,12 +28808,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29253,8 +29253,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29693,8 +29693,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30141,7 +30141,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -30149,7 +30149,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30594,13 +30594,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31041,13 +31041,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31492,7 +31492,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -31505,7 +31505,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31950,7 +31950,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -31963,7 +31963,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32406,12 +32406,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32851,8 +32851,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33307,8 +33307,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33771,7 +33771,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -33779,7 +33779,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34240,13 +34240,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34703,13 +34703,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35170,7 +35170,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -35183,7 +35183,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35644,7 +35644,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -35657,7 +35657,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36116,12 +36116,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index 6f9a2486fbe..7001cbd17d2 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -72,8 +72,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -537,8 +537,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1016,7 +1016,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1024,7 +1024,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1506,13 +1506,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -1986,13 +1986,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2476,7 +2476,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2489,7 +2489,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2971,7 +2971,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -2984,7 +2984,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3464,12 +3464,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -3952,8 +3952,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -4417,8 +4417,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -4896,7 +4896,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -4904,7 +4904,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5386,13 +5386,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -5866,13 +5866,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -6354,7 +6354,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -6367,7 +6367,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -6849,7 +6849,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -6862,7 +6862,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -7342,12 +7342,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -7826,8 +7826,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -8291,8 +8291,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -8770,7 +8770,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -8778,7 +8778,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9260,13 +9260,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -9740,13 +9740,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -10228,7 +10228,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -10241,7 +10241,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -10723,7 +10723,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -10736,7 +10736,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -11216,12 +11216,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -11700,8 +11700,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -12165,8 +12165,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -12644,7 +12644,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -12652,7 +12652,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -13134,13 +13134,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -13614,13 +13614,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -14102,7 +14102,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -14115,7 +14115,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -14597,7 +14597,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -14610,7 +14610,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -15090,12 +15090,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result index 06dd78b69dc..22317d93724 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -530,8 +530,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -994,7 +994,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1002,7 +1002,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1463,13 +1463,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1926,13 +1926,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2395,7 +2395,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2408,7 +2408,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2869,7 +2869,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2882,7 +2882,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3341,12 +3341,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3804,8 +3804,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4298,8 +4298,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4800,7 +4800,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4808,7 +4808,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5307,13 +5307,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5808,13 +5808,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6315,7 +6315,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6328,7 +6328,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6827,7 +6827,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6840,7 +6840,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7337,12 +7337,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7836,8 +7836,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8330,8 +8330,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8832,7 +8832,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8840,7 +8840,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9339,13 +9339,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9840,13 +9840,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10347,7 +10347,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10360,7 +10360,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10859,7 +10859,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10872,7 +10872,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11369,12 +11369,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11869,8 +11869,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12377,8 +12377,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12893,7 +12893,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -12901,7 +12901,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13414,13 +13414,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13929,13 +13929,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14450,7 +14450,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14463,7 +14463,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14976,7 +14976,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -14989,7 +14989,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15500,12 +15500,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16013,8 +16013,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16521,8 +16521,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17037,7 +17037,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -17045,7 +17045,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17558,13 +17558,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18073,13 +18073,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18594,7 +18594,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18607,7 +18607,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19120,7 +19120,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -19133,7 +19133,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19644,12 +19644,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result index 769abc32dff..680edaa7cc7 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result @@ -70,8 +70,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -526,8 +526,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -990,7 +990,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -998,7 +998,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1459,13 +1459,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1922,13 +1922,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2389,7 +2389,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2402,7 +2402,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2863,7 +2863,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2876,7 +2876,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3335,12 +3335,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3798,8 +3798,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4293,8 +4293,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4796,7 +4796,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4804,7 +4804,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5304,13 +5304,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5806,13 +5806,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6312,7 +6312,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6325,7 +6325,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6825,7 +6825,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6838,7 +6838,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7336,12 +7336,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7836,8 +7836,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8331,8 +8331,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8834,7 +8834,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8842,7 +8842,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9342,13 +9342,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9844,13 +9844,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10350,7 +10350,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10363,7 +10363,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10863,7 +10863,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10876,7 +10876,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11374,12 +11374,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11875,8 +11875,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12383,8 +12383,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12899,7 +12899,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -12907,7 +12907,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13420,13 +13420,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13935,13 +13935,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14454,7 +14454,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14467,7 +14467,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14980,7 +14980,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -14993,7 +14993,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15504,12 +15504,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16017,8 +16017,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16525,8 +16525,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17041,7 +17041,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -17049,7 +17049,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17562,13 +17562,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18077,13 +18077,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18596,7 +18596,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18609,7 +18609,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19122,7 +19122,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -19135,7 +19135,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19646,12 +19646,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter2_1_maria.result b/mysql-test/suite/parts/r/partition_alter2_1_maria.result index 1905c5c25ae..3ef0364c5a8 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_maria.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_maria.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -539,8 +539,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -1018,7 +1018,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -1026,7 +1026,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -1508,13 +1508,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -1988,13 +1988,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -2478,7 +2478,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -2491,7 +2491,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -2973,7 +2973,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -2986,7 +2986,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -3466,12 +3466,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -3952,8 +3952,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -4469,8 +4469,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -5000,7 +5000,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -5008,7 +5008,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -5542,13 +5542,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -6074,13 +6074,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -6616,7 +6616,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -6629,7 +6629,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -7163,7 +7163,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -7176,7 +7176,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -7708,12 +7708,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -8244,8 +8244,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -8761,8 +8761,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -9292,7 +9292,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -9300,7 +9300,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -9834,13 +9834,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -10366,13 +10366,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -10908,7 +10908,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -10921,7 +10921,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -11455,7 +11455,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -11468,7 +11468,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -12000,12 +12000,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -12540,8 +12540,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -13005,8 +13005,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -13484,7 +13484,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -13492,7 +13492,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -13974,13 +13974,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -14454,13 +14454,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -14942,7 +14942,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -14955,7 +14955,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -15437,7 +15437,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -15450,7 +15450,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -15930,12 +15930,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -16416,8 +16416,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -16933,8 +16933,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -17464,7 +17464,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -17472,7 +17472,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -18006,13 +18006,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -18538,13 +18538,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -19078,7 +19078,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -19091,7 +19091,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -19625,7 +19625,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -19638,7 +19638,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -20170,12 +20170,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -20706,8 +20706,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -21223,8 +21223,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -21754,7 +21754,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -21762,7 +21762,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -22296,13 +22296,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -22828,13 +22828,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -23368,7 +23368,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -23381,7 +23381,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -23915,7 +23915,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -23928,7 +23928,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -24460,12 +24460,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD diff --git a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result index 3a31fa905e1..44550776616 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -539,8 +539,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1018,7 +1018,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1026,7 +1026,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1508,13 +1508,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -1988,13 +1988,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2478,7 +2478,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2491,7 +2491,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2973,7 +2973,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -2986,7 +2986,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3466,12 +3466,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -3952,8 +3952,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -4469,8 +4469,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -5000,7 +5000,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -5008,7 +5008,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5542,13 +5542,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -6074,13 +6074,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -6616,7 +6616,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -6629,7 +6629,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -7163,7 +7163,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -7176,7 +7176,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -7708,12 +7708,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -8244,8 +8244,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -8761,8 +8761,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -9292,7 +9292,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -9300,7 +9300,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9834,13 +9834,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -10366,13 +10366,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -10908,7 +10908,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -10921,7 +10921,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -11455,7 +11455,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -11468,7 +11468,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -12000,12 +12000,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -12540,8 +12540,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -13005,8 +13005,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -13484,7 +13484,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -13492,7 +13492,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -13974,13 +13974,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -14454,13 +14454,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -14942,7 +14942,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -14955,7 +14955,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -15437,7 +15437,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -15450,7 +15450,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -15930,12 +15930,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -16416,8 +16416,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -16933,8 +16933,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -17464,7 +17464,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -17472,7 +17472,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -18006,13 +18006,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -18538,13 +18538,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -19078,7 +19078,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -19091,7 +19091,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -19625,7 +19625,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -19638,7 +19638,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -20170,12 +20170,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -20706,8 +20706,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -21223,8 +21223,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -21754,7 +21754,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -21762,7 +21762,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -22296,13 +22296,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -22828,13 +22828,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -23368,7 +23368,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -23381,7 +23381,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -23915,7 +23915,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -23928,7 +23928,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -24460,12 +24460,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result index 1b5fbc437cc..113fc7bb312 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -532,8 +532,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -998,7 +998,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1006,7 +1006,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1469,13 +1469,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1932,13 +1932,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2403,7 +2403,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2416,7 +2416,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2877,7 +2877,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2890,7 +2890,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3351,12 +3351,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3815,8 +3815,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4311,8 +4311,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4815,7 +4815,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4823,7 +4823,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5324,13 +5324,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5825,13 +5825,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6334,7 +6334,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6347,7 +6347,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6846,7 +6846,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6859,7 +6859,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7358,12 +7358,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7859,8 +7859,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8355,8 +8355,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8859,7 +8859,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8867,7 +8867,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9368,13 +9368,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9869,13 +9869,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10378,7 +10378,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10391,7 +10391,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10890,7 +10890,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10903,7 +10903,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11402,12 +11402,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11904,8 +11904,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12414,8 +12414,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12932,7 +12932,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -12940,7 +12940,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13455,13 +13455,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13970,13 +13970,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14493,7 +14493,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14506,7 +14506,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15019,7 +15019,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -15032,7 +15032,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15545,12 +15545,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16060,8 +16060,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16570,8 +16570,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17088,7 +17088,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -17096,7 +17096,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17611,13 +17611,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18126,13 +18126,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18649,7 +18649,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18662,7 +18662,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19175,7 +19175,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -19188,7 +19188,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19701,12 +19701,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result index c2e4d73cd0d..becbaddd927 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result @@ -69,8 +69,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -528,8 +528,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -995,7 +995,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1003,7 +1003,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1467,13 +1467,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1935,13 +1935,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2407,7 +2407,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2420,7 +2420,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2886,7 +2886,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2899,7 +2899,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3361,12 +3361,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3827,8 +3827,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4325,8 +4325,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4831,7 +4831,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4839,7 +4839,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5342,13 +5342,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5849,13 +5849,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6360,7 +6360,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6373,7 +6373,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6878,7 +6878,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6891,7 +6891,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7392,12 +7392,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7895,8 +7895,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8393,8 +8393,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8899,7 +8899,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8907,7 +8907,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9410,13 +9410,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9917,13 +9917,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10428,7 +10428,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10441,7 +10441,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10946,7 +10946,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10959,7 +10959,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11460,12 +11460,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11964,8 +11964,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12475,8 +12475,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12994,7 +12994,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -13002,7 +13002,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13518,13 +13518,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14038,13 +14038,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14562,7 +14562,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14575,7 +14575,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15093,7 +15093,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -15106,7 +15106,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15620,12 +15620,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16136,8 +16136,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16647,8 +16647,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17166,7 +17166,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -17174,7 +17174,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17690,13 +17690,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18210,13 +18210,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18734,7 +18734,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18747,7 +18747,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19265,7 +19265,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -19278,7 +19278,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19792,12 +19792,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter2_2_maria.result b/mysql-test/suite/parts/r/partition_alter2_2_maria.result index 9407be53e04..72a497ed964 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_maria.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_maria.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -541,8 +541,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -1022,7 +1022,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -1030,7 +1030,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -1514,13 +1514,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -1994,13 +1994,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -2486,7 +2486,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -2499,7 +2499,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -2981,7 +2981,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -2994,7 +2994,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -3476,12 +3476,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -3964,8 +3964,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -4483,8 +4483,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -5016,7 +5016,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -5024,7 +5024,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -5560,13 +5560,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -6092,13 +6092,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -6636,7 +6636,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -6649,7 +6649,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -7183,7 +7183,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -7196,7 +7196,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -7730,12 +7730,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -8268,8 +8268,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -8787,8 +8787,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -9320,7 +9320,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -9328,7 +9328,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -9864,13 +9864,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -10396,13 +10396,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -10940,7 +10940,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -10953,7 +10953,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -11487,7 +11487,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -11500,7 +11500,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -12034,12 +12034,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -12575,8 +12575,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -13043,8 +13043,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -13525,7 +13525,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -13533,7 +13533,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -14018,13 +14018,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -14503,13 +14503,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -14996,7 +14996,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -15009,7 +15009,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -15496,7 +15496,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -15509,7 +15509,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -15992,12 +15992,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -16481,8 +16481,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -17001,8 +17001,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -17535,7 +17535,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -17543,7 +17543,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -18080,13 +18080,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -18617,13 +18617,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -19162,7 +19162,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -19175,7 +19175,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -19714,7 +19714,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -19727,7 +19727,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -20262,12 +20262,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD @@ -20801,8 +20801,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MAD @@ -21321,8 +21321,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MAD @@ -21855,7 +21855,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = Aria, PARTITION part_2 VALUES IN (-2) ENGINE = Aria, PARTITION part_1 VALUES IN (-1) ENGINE = Aria, @@ -21863,7 +21863,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = Aria, PARTITION part1 VALUES IN (1) ENGINE = Aria, PARTITION part2 VALUES IN (2) ENGINE = Aria, - PARTITION part3 VALUES IN (3) ENGINE = Aria) */ + PARTITION part3 VALUES IN (3) ENGINE = Aria) unified filelist t1#P#part0.MAD @@ -22400,13 +22400,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, PARTITION partd VALUES LESS THAN (15) ENGINE = Aria, PARTITION parte VALUES LESS THAN (20) ENGINE = Aria, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta.MAD @@ -22937,13 +22937,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = Aria, PARTITION partb VALUES LESS THAN (5) ENGINE = Aria, PARTITION partc VALUES LESS THAN (10) ENGINE = Aria, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = Aria) unified filelist t1#P#parta#SP#partasp0.MAD @@ -23482,7 +23482,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = Aria, @@ -23495,7 +23495,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = Aria), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = Aria, - SUBPARTITION subpart42 ENGINE = Aria)) */ + SUBPARTITION subpart42 ENGINE = Aria)) unified filelist t1#P#part1#SP#subpart11.MAD @@ -24034,7 +24034,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = Aria, @@ -24047,7 +24047,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = Aria), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = Aria, - SUBPARTITION sp42 ENGINE = Aria)) */ + SUBPARTITION sp42 ENGINE = Aria)) unified filelist t1#P#part1#SP#sp11.MAD @@ -24582,12 +24582,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = Aria, PARTITION part2 VALUES IN (1) ENGINE = Aria, - PARTITION part3 VALUES IN (NULL) ENGINE = Aria) */ + PARTITION part3 VALUES IN (NULL) ENGINE = Aria) unified filelist t1#P#part1#SP#part1sp0.MAD diff --git a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result index f2a450686f5..aa490308295 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result @@ -74,8 +74,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -541,8 +541,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1022,7 +1022,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1030,7 +1030,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1514,13 +1514,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -1994,13 +1994,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2486,7 +2486,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2499,7 +2499,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2981,7 +2981,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -2994,7 +2994,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3476,12 +3476,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -3964,8 +3964,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -4483,8 +4483,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -5016,7 +5016,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -5024,7 +5024,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5560,13 +5560,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -6092,13 +6092,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -6636,7 +6636,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -6649,7 +6649,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -7183,7 +7183,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -7196,7 +7196,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -7730,12 +7730,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -8268,8 +8268,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -8787,8 +8787,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -9320,7 +9320,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -9328,7 +9328,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9864,13 +9864,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -10396,13 +10396,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -10940,7 +10940,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -10953,7 +10953,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -11487,7 +11487,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -11500,7 +11500,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -12034,12 +12034,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -12575,8 +12575,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -13043,8 +13043,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -13525,7 +13525,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -13533,7 +13533,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -14018,13 +14018,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -14503,13 +14503,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -14996,7 +14996,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -15009,7 +15009,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -15496,7 +15496,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -15509,7 +15509,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -15992,12 +15992,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -16481,8 +16481,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -17001,8 +17001,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -17535,7 +17535,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -17543,7 +17543,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -18080,13 +18080,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -18617,13 +18617,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -19162,7 +19162,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -19175,7 +19175,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -19714,7 +19714,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -19727,7 +19727,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -20262,12 +20262,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int1`,`f_int2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -20801,8 +20801,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -21321,8 +21321,8 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -21855,7 +21855,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -21863,7 +21863,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -22400,13 +22400,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -22937,13 +22937,13 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -23482,7 +23482,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -23495,7 +23495,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -24034,7 +24034,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -24047,7 +24047,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -24582,12 +24582,12 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index 2bb1bcc2433..57c0bc78914 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -78,7 +78,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1#P#p0.ibd t1.frm t1.par @@ -97,7 +97,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ + PARTITION BY HASH (DAYOFYEAR(f_date)) t1#P#p0.ibd t1.frm t1.par @@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1#P#p0.ibd t1.frm t1.par @@ -137,10 +137,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, - PARTITION part7 ENGINE = InnoDB) */ + PARTITION part7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part7.ibd @@ -163,11 +163,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part2.ibd @@ -188,7 +188,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, @@ -196,7 +196,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, - PARTITION p7 ENGINE = InnoDB) */ + PARTITION p7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -233,14 +233,14 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, - PARTITION p6 ENGINE = InnoDB) */ + PARTITION p6 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -263,13 +263,13 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, - PARTITION p5 ENGINE = InnoDB) */ + PARTITION p5 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -291,12 +291,12 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, - PARTITION p4 ENGINE = InnoDB) */ + PARTITION p4 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#part1.ibd @@ -317,11 +317,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part2.ibd @@ -341,10 +341,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, - PARTITION part7 ENGINE = InnoDB) */ + PARTITION part7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part7.ibd @@ -363,9 +363,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, - PARTITION part1 ENGINE = InnoDB) */ + PARTITION part1 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1.frm @@ -383,8 +383,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) -(PARTITION p0 ENGINE = InnoDB) */ + PARTITION BY HASH (YEAR(f_date)) +(PARTITION p0 ENGINE = InnoDB) t1#P#p0.ibd t1.frm t1.par @@ -469,7 +469,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) */ + PARTITION BY KEY (f_int1) t1#P#p0.ibd t1.frm t1.par @@ -495,10 +495,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, - PARTITION part7 ENGINE = InnoDB) */ + PARTITION part7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part7.ibd @@ -521,11 +521,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part2.ibd @@ -549,7 +549,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, @@ -557,7 +557,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, - PARTITION p7 ENGINE = InnoDB) */ + PARTITION p7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -592,14 +592,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, - PARTITION p6 ENGINE = InnoDB) */ + PARTITION p6 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -625,13 +625,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, - PARTITION p5 ENGINE = InnoDB) */ + PARTITION p5 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#p5.ibd @@ -656,12 +656,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, - PARTITION p4 ENGINE = InnoDB) */ + PARTITION p4 ENGINE = InnoDB) t1#P#p0.ibd t1#P#p4.ibd t1#P#part1.ibd @@ -685,11 +685,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part2.ibd @@ -712,10 +712,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, - PARTITION part7 ENGINE = InnoDB) */ + PARTITION part7 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1#P#part7.ibd @@ -737,9 +737,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, - PARTITION part1 ENGINE = InnoDB) */ + PARTITION part1 ENGINE = InnoDB) t1#P#p0.ibd t1#P#part1.ibd t1.frm @@ -760,8 +760,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -(PARTITION p0 ENGINE = InnoDB) */ + PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB) t1#P#p0.ibd t1.frm t1.par diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index 2a2ae74d8bd..99d1587ef09 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -79,7 +79,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1#P#p0.MYD t1#P#p0.MYI t1.frm @@ -99,7 +99,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ + PARTITION BY HASH (DAYOFYEAR(f_date)) t1#P#p0.MYD t1#P#p0.MYI t1.frm @@ -117,7 +117,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1#P#p0.MYD t1#P#p0.MYI t1.frm @@ -141,10 +141,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, - PARTITION part7 ENGINE = MyISAM) */ + PARTITION part7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -170,11 +170,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, @@ -207,7 +207,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, - PARTITION p7 ENGINE = MyISAM) */ + PARTITION p7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -252,14 +252,14 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, - PARTITION p6 ENGINE = MyISAM) */ + PARTITION p6 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -289,13 +289,13 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, - PARTITION p5 ENGINE = MyISAM) */ + PARTITION p5 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -323,12 +323,12 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, - PARTITION p4 ENGINE = MyISAM) */ + PARTITION p4 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -354,11 +354,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -382,10 +382,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, - PARTITION part7 ENGINE = MyISAM) */ + PARTITION part7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -407,9 +407,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, - PARTITION part1 ENGINE = MyISAM) */ + PARTITION part1 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -429,8 +429,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) -(PARTITION p0 ENGINE = MyISAM) */ + PARTITION BY HASH (YEAR(f_date)) +(PARTITION p0 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1.frm @@ -512,7 +512,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) */ + PARTITION BY KEY (f_int1) t1#P#p0.MYD t1#P#p0.MYI t1.frm @@ -539,10 +539,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, - PARTITION part7 ENGINE = MyISAM) */ + PARTITION part7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -568,11 +568,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -600,7 +600,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, @@ -608,7 +608,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, - PARTITION p7 ENGINE = MyISAM) */ + PARTITION p7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -651,14 +651,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, - PARTITION p6 ENGINE = MyISAM) */ + PARTITION p6 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -691,13 +691,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, - PARTITION p5 ENGINE = MyISAM) */ + PARTITION p5 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -728,12 +728,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, - PARTITION p4 ENGINE = MyISAM) */ + PARTITION p4 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#p4.MYD @@ -762,11 +762,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -793,10 +793,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, - PARTITION part7 ENGINE = MyISAM) */ + PARTITION part7 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -821,9 +821,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, - PARTITION part1 ENGINE = MyISAM) */ + PARTITION part1 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1#P#part1.MYD @@ -846,8 +846,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -(PARTITION p0 ENGINE = MyISAM) */ + PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = MyISAM) t1#P#p0.MYD t1#P#p0.MYI t1.frm diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result index 5bdf4ac0ab1..169f73d045a 100644 --- a/mysql-test/suite/parts/r/partition_alter4_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result @@ -75,9 +75,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -534,12 +534,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1004,7 +1004,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1012,7 +1012,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1475,13 +1475,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1940,13 +1940,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2411,7 +2411,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2424,7 +2424,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2887,7 +2887,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2900,7 +2900,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3361,12 +3361,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3825,9 +3825,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4284,12 +4284,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4754,7 +4754,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4762,7 +4762,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5225,13 +5225,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5690,13 +5690,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6161,7 +6161,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6174,7 +6174,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6637,7 +6637,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6650,7 +6650,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7111,12 +7111,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7575,9 +7575,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8034,12 +8034,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8504,7 +8504,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8512,7 +8512,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8975,13 +8975,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9440,13 +9440,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9911,7 +9911,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -9924,7 +9924,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10387,7 +10387,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10400,7 +10400,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10861,12 +10861,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11325,9 +11325,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11784,12 +11784,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12254,7 +12254,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -12262,7 +12262,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12725,13 +12725,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13190,13 +13190,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13661,7 +13661,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -13674,7 +13674,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14137,7 +14137,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -14150,7 +14150,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14611,12 +14611,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15075,9 +15075,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15534,12 +15534,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16004,7 +16004,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -16012,7 +16012,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16475,13 +16475,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16940,13 +16940,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17411,7 +17411,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -17424,7 +17424,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17887,7 +17887,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -17900,7 +17900,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18361,12 +18361,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18828,9 +18828,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19287,12 +19287,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19757,7 +19757,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -19765,7 +19765,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20228,13 +20228,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20693,13 +20693,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21164,7 +21164,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -21177,7 +21177,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21640,7 +21640,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -21653,7 +21653,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22114,12 +22114,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22578,9 +22578,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23037,12 +23037,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23507,7 +23507,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -23515,7 +23515,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23978,13 +23978,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24443,13 +24443,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24914,7 +24914,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -24927,7 +24927,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25390,7 +25390,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -25403,7 +25403,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25864,12 +25864,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26328,9 +26328,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26787,12 +26787,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27257,7 +27257,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -27265,7 +27265,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27728,13 +27728,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28193,13 +28193,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28664,7 +28664,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -28677,7 +28677,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29140,7 +29140,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -29153,7 +29153,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29614,12 +29614,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30078,9 +30078,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30537,12 +30537,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31007,7 +31007,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -31015,7 +31015,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31478,13 +31478,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31943,13 +31943,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32414,7 +32414,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -32427,7 +32427,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32890,7 +32890,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -32903,7 +32903,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33364,12 +33364,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33828,9 +33828,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34287,12 +34287,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34757,7 +34757,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -34765,7 +34765,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35228,13 +35228,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35693,13 +35693,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36164,7 +36164,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -36177,7 +36177,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36640,7 +36640,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -36653,7 +36653,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37114,12 +37114,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37582,9 +37582,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38042,12 +38042,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38513,7 +38513,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -38521,7 +38521,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38985,13 +38985,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39451,13 +39451,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39923,7 +39923,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -39936,7 +39936,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40400,7 +40400,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -40413,7 +40413,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40875,12 +40875,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41340,9 +41340,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41800,12 +41800,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42271,7 +42271,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -42279,7 +42279,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42743,13 +42743,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43209,13 +43209,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43681,7 +43681,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -43694,7 +43694,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44158,7 +44158,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -44171,7 +44171,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44633,12 +44633,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -45097,9 +45097,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -45556,12 +45556,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46026,7 +46026,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -46034,7 +46034,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46497,13 +46497,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46962,13 +46962,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47433,7 +47433,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -47446,7 +47446,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47909,7 +47909,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -47922,7 +47922,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48383,12 +48383,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48847,9 +48847,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49306,12 +49306,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49776,7 +49776,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -49784,7 +49784,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50247,13 +50247,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50712,13 +50712,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51183,7 +51183,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -51196,7 +51196,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51659,7 +51659,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -51672,7 +51672,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52133,12 +52133,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52598,9 +52598,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53058,12 +53058,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53529,7 +53529,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -53537,7 +53537,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54001,13 +54001,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54467,13 +54467,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54939,7 +54939,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -54952,7 +54952,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55416,7 +55416,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -55429,7 +55429,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55891,12 +55891,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56356,9 +56356,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56813,12 +56813,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57281,7 +57281,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -57289,7 +57289,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57750,13 +57750,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58213,13 +58213,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58682,7 +58682,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -58695,7 +58695,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59156,7 +59156,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -59169,7 +59169,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59628,12 +59628,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60090,9 +60090,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60547,12 +60547,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61015,7 +61015,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -61023,7 +61023,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61484,13 +61484,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61947,13 +61947,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62416,7 +62416,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -62429,7 +62429,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62890,7 +62890,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -62903,7 +62903,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -63362,12 +63362,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64144,9 +64144,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64601,12 +64601,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65069,7 +65069,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -65077,7 +65077,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65538,13 +65538,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66001,13 +66001,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66470,7 +66470,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -66483,7 +66483,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66944,7 +66944,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -66957,7 +66957,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67416,12 +67416,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67883,9 +67883,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68342,12 +68342,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68812,7 +68812,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -68820,7 +68820,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69283,13 +69283,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69748,13 +69748,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70219,7 +70219,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -70232,7 +70232,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70695,7 +70695,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -70708,7 +70708,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71169,12 +71169,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71633,9 +71633,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72092,12 +72092,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72562,7 +72562,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -72570,7 +72570,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73033,13 +73033,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73498,13 +73498,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73969,7 +73969,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -73982,7 +73982,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -74445,7 +74445,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -74458,7 +74458,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -74919,12 +74919,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -75383,9 +75383,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -75842,12 +75842,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -76312,7 +76312,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -76320,7 +76320,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -76783,13 +76783,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -77248,13 +77248,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -77719,7 +77719,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -77732,7 +77732,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -78195,7 +78195,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -78208,7 +78208,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -78669,12 +78669,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -79133,9 +79133,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -79592,12 +79592,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -80062,7 +80062,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -80070,7 +80070,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -80533,13 +80533,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -80998,13 +80998,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -81469,7 +81469,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -81482,7 +81482,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -81945,7 +81945,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -81958,7 +81958,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -82419,12 +82419,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -82883,9 +82883,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, - PARTITION part_2 ENGINE = InnoDB) */ + PARTITION part_2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -83342,12 +83342,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, - PARTITION part_5 ENGINE = InnoDB) */ + PARTITION part_5 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -83812,7 +83812,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -83820,7 +83820,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -84283,13 +84283,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -84748,13 +84748,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -85219,7 +85219,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -85232,7 +85232,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -85695,7 +85695,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -85708,7 +85708,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -86169,12 +86169,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result index da99d6867ab..a4f7c05345f 100644 --- a/mysql-test/suite/parts/r/partition_alter4_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result @@ -75,9 +75,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -543,12 +543,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -1028,7 +1028,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1036,7 +1036,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1520,13 +1520,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -2002,13 +2002,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -2494,7 +2494,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2507,7 +2507,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -2991,7 +2991,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -3004,7 +3004,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -3486,12 +3486,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -3973,9 +3973,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -4441,12 +4441,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -4926,7 +4926,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -4934,7 +4934,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5418,13 +5418,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -5900,13 +5900,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -6392,7 +6392,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -6405,7 +6405,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -6889,7 +6889,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -6902,7 +6902,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -7384,12 +7384,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -7871,9 +7871,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -8339,12 +8339,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -8824,7 +8824,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -8832,7 +8832,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9316,13 +9316,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -9798,13 +9798,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -10290,7 +10290,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -10303,7 +10303,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -10787,7 +10787,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -10800,7 +10800,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -11282,12 +11282,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -11769,9 +11769,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -12237,12 +12237,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -12722,7 +12722,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -12730,7 +12730,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -13214,13 +13214,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -13696,13 +13696,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -14188,7 +14188,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -14201,7 +14201,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -14685,7 +14685,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -14698,7 +14698,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -15180,12 +15180,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -15667,9 +15667,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -16135,12 +16135,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -16620,7 +16620,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -16628,7 +16628,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -17112,13 +17112,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -17594,13 +17594,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -18086,7 +18086,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -18099,7 +18099,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -18583,7 +18583,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -18596,7 +18596,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -19078,12 +19078,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -19568,9 +19568,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -20036,12 +20036,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -20521,7 +20521,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -20529,7 +20529,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -21013,13 +21013,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -21495,13 +21495,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -21987,7 +21987,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -22000,7 +22000,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -22484,7 +22484,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -22497,7 +22497,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -22979,12 +22979,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -23466,9 +23466,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -23934,12 +23934,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -24419,7 +24419,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -24427,7 +24427,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -24911,13 +24911,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -25393,13 +25393,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -25885,7 +25885,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -25898,7 +25898,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -26382,7 +26382,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -26395,7 +26395,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -26877,12 +26877,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -27364,9 +27364,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -27832,12 +27832,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -28317,7 +28317,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -28325,7 +28325,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -28809,13 +28809,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -29291,13 +29291,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -29783,7 +29783,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -29796,7 +29796,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -30280,7 +30280,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -30293,7 +30293,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -30775,12 +30775,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -31262,9 +31262,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -31730,12 +31730,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -32215,7 +32215,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -32223,7 +32223,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -32707,13 +32707,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -33189,13 +33189,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -33681,7 +33681,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -33694,7 +33694,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -34178,7 +34178,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -34191,7 +34191,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -34673,12 +34673,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -35160,9 +35160,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -35628,12 +35628,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -36113,7 +36113,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -36121,7 +36121,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -36605,13 +36605,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -37087,13 +37087,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -37579,7 +37579,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -37592,7 +37592,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -38076,7 +38076,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -38089,7 +38089,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -38571,12 +38571,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -39061,9 +39061,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -39529,12 +39529,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -40014,7 +40014,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -40022,7 +40022,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -40506,13 +40506,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -40988,13 +40988,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -41480,7 +41480,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -41493,7 +41493,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -41977,7 +41977,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -41990,7 +41990,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -42472,12 +42472,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -42959,9 +42959,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -43427,12 +43427,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -43912,7 +43912,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -43920,7 +43920,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -44404,13 +44404,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -44886,13 +44886,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -45378,7 +45378,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -45391,7 +45391,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -45875,7 +45875,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -45888,7 +45888,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -46370,12 +46370,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -46857,9 +46857,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -47325,12 +47325,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -47810,7 +47810,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -47818,7 +47818,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -48302,13 +48302,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -48784,13 +48784,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -49276,7 +49276,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -49289,7 +49289,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -49773,7 +49773,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -49786,7 +49786,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -50268,12 +50268,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -50755,9 +50755,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -51223,12 +51223,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -51708,7 +51708,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -51716,7 +51716,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -52200,13 +52200,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -52682,13 +52682,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -53174,7 +53174,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -53187,7 +53187,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -53671,7 +53671,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -53684,7 +53684,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -54166,12 +54166,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -54653,9 +54653,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -55121,12 +55121,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -55606,7 +55606,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -55614,7 +55614,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -56098,13 +56098,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -56580,13 +56580,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -57072,7 +57072,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -57085,7 +57085,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -57569,7 +57569,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -57582,7 +57582,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -58064,12 +58064,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -58552,9 +58552,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -59018,12 +59018,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -59501,7 +59501,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -59509,7 +59509,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -59991,13 +59991,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -60471,13 +60471,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -60961,7 +60961,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -60974,7 +60974,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -61456,7 +61456,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -61469,7 +61469,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -61949,12 +61949,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -62434,9 +62434,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -62900,12 +62900,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -63383,7 +63383,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -63391,7 +63391,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -63873,13 +63873,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -64353,13 +64353,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -64843,7 +64843,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -64856,7 +64856,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -65338,7 +65338,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -65351,7 +65351,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -65831,12 +65831,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -66636,9 +66636,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -67102,12 +67102,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -67585,7 +67585,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -67593,7 +67593,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -68075,13 +68075,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -68555,13 +68555,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -69045,7 +69045,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -69058,7 +69058,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -69540,7 +69540,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -69553,7 +69553,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -70033,12 +70033,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -70523,9 +70523,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -70991,12 +70991,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -71476,7 +71476,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -71484,7 +71484,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -71968,13 +71968,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -72450,13 +72450,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -72942,7 +72942,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -72955,7 +72955,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -73439,7 +73439,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -73452,7 +73452,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -73934,12 +73934,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -74421,9 +74421,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -74889,12 +74889,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -75374,7 +75374,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -75382,7 +75382,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -75866,13 +75866,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -76348,13 +76348,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -76840,7 +76840,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -76853,7 +76853,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -77337,7 +77337,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -77350,7 +77350,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -77832,12 +77832,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -78319,9 +78319,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -78787,12 +78787,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -79272,7 +79272,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -79280,7 +79280,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -79764,13 +79764,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -80246,13 +80246,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -80738,7 +80738,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -80751,7 +80751,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -81235,7 +81235,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -81248,7 +81248,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -81730,12 +81730,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -82217,9 +82217,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -82685,12 +82685,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -83170,7 +83170,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -83178,7 +83178,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -83662,13 +83662,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -84144,13 +84144,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -84636,7 +84636,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -84649,7 +84649,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -85133,7 +85133,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -85146,7 +85146,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -85628,12 +85628,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -86115,9 +86115,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, - PARTITION part_2 ENGINE = MyISAM) */ + PARTITION part_2 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -86583,12 +86583,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, - PARTITION part_5 ENGINE = MyISAM) */ + PARTITION part_5 ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -87068,7 +87068,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -87076,7 +87076,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -87560,13 +87560,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1.MYD @@ -88042,13 +88042,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD @@ -88534,7 +88534,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -88547,7 +88547,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#subpart11.MYD @@ -89031,7 +89031,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -89044,7 +89044,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part_1#SP#sp11.MYD @@ -89526,12 +89526,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part_1#SP#part_1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_auto_increment_archive.result b/mysql-test/suite/parts/r/partition_auto_increment_archive.result index c9a2103f2ce..7497e7d9cea 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_archive.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_archive.result @@ -135,8 +135,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -341,8 +341,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 2 @@ -365,8 +365,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 2 @@ -394,8 +394,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -646,8 +646,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); # ERROR (only OK if Archive) mysql_errno: 1022 SHOW CREATE TABLE t1; @@ -656,8 +656,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -665,8 +665,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -674,8 +674,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 15 @@ -689,8 +689,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); # ERROR (only OK if Archive) mysql_errno: 1022 SHOW CREATE TABLE t1; @@ -699,8 +699,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -708,8 +708,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 15 @@ -729,8 +729,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -738,8 +738,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -750,8 +750,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -759,8 +759,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -784,8 +784,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -793,8 +793,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -803,8 +803,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -813,8 +813,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result index e1d5814dc45..639748e7977 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result @@ -166,8 +166,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 DROP TABLE t1; @@ -324,8 +324,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 TRUNCATE TABLE t1; @@ -336,8 +336,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 INSERT INTO t1 VALUES (100); @@ -352,8 +352,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -534,8 +534,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -543,8 +543,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -552,8 +552,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -561,8 +561,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 # Test sql_mode 'NO_AUTO_VALUE_ON_ZERO' @@ -574,8 +574,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -583,8 +583,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -592,8 +592,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 SET @@session.sql_mode = ''; @@ -609,8 +609,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -618,8 +618,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 SET INSERT_ID = 23; @@ -629,8 +629,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -638,8 +638,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY @@ -661,8 +661,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -670,8 +670,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -680,8 +680,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -690,8 +690,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result index 63bd8a83b70..635942a1f34 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result @@ -186,8 +186,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -410,8 +410,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 26 @@ -423,8 +423,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 1 @@ -441,8 +441,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -701,8 +701,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -710,8 +710,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -719,8 +719,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -728,8 +728,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 @@ -744,8 +744,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -753,8 +753,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -762,8 +762,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 0 @@ -785,8 +785,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -794,8 +794,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -806,8 +806,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -815,8 +815,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -839,8 +839,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -848,8 +848,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -858,8 +858,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -868,8 +868,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result index 9a38ae6b8d5..6fdbdeb2653 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_maria.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result @@ -186,8 +186,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -410,8 +410,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 26 @@ -423,8 +423,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 27 @@ -440,8 +440,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -747,8 +747,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -756,8 +756,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -765,8 +765,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -774,8 +774,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 @@ -790,8 +790,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -799,8 +799,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -808,8 +808,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 0 @@ -831,8 +831,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -840,8 +840,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -852,8 +852,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -861,8 +861,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -886,8 +886,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -895,8 +895,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -905,8 +905,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -915,8 +915,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result index e6240f1bb40..62ab0c1ca51 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result @@ -186,8 +186,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -410,8 +410,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 26 @@ -423,8 +423,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 1 @@ -440,8 +440,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -728,8 +728,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -737,8 +737,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -746,8 +746,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -755,8 +755,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 @@ -771,8 +771,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -780,8 +780,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -789,8 +789,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 0 @@ -812,8 +812,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -821,8 +821,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -833,8 +833,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -842,8 +842,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -867,8 +867,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -876,8 +876,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -886,8 +886,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -896,8 +896,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MEMORY AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result index 32e75205f3b..27cf857abb0 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result @@ -186,8 +186,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -410,8 +410,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 26 @@ -423,8 +423,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 1 @@ -440,8 +440,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -747,8 +747,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -756,8 +756,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -765,8 +765,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -774,8 +774,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 @@ -790,8 +790,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -799,8 +799,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -808,8 +808,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 0 @@ -831,8 +831,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -840,8 +840,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -852,8 +852,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -861,8 +861,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -886,8 +886,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -895,8 +895,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -905,8 +905,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -915,8 +915,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index 5bfda948ca4..d8872e16d5e 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -73,8 +73,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -530,8 +530,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -998,7 +998,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -1006,7 +1006,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -1474,13 +1474,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -1942,13 +1942,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -2418,7 +2418,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -2431,7 +2431,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -2903,7 +2903,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -2916,7 +2916,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -3382,12 +3382,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -3852,8 +3852,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -4309,8 +4309,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -4777,7 +4777,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -4785,7 +4785,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -5253,13 +5253,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -5721,13 +5721,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -6195,7 +6195,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -6208,7 +6208,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -6676,7 +6676,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -6689,7 +6689,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -7155,12 +7155,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -7631,8 +7631,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -8125,8 +8125,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -8630,7 +8630,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -8638,7 +8638,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -9143,13 +9143,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -9648,13 +9648,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -10161,7 +10161,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -10174,7 +10174,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -10683,7 +10683,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -10696,7 +10696,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -11199,12 +11199,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -11705,8 +11705,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -12199,8 +12199,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -12704,7 +12704,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -12712,7 +12712,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -13217,13 +13217,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -13722,13 +13722,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -14235,7 +14235,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -14248,7 +14248,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -14757,7 +14757,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -14770,7 +14770,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -15273,12 +15273,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -15779,8 +15779,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -16289,8 +16289,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -16810,7 +16810,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -16818,7 +16818,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -17339,13 +17339,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -17860,13 +17860,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -18389,7 +18389,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -18402,7 +18402,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -18927,7 +18927,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -18940,7 +18940,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -19459,12 +19459,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -19986,8 +19986,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -20480,8 +20480,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -20985,7 +20985,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -20993,7 +20993,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -21498,13 +21498,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -22003,13 +22003,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -22514,7 +22514,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -22527,7 +22527,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -23032,7 +23032,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -23045,7 +23045,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -23548,12 +23548,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -24054,8 +24054,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -24548,8 +24548,8 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -25053,7 +25053,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -25061,7 +25061,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -25566,13 +25566,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -26071,13 +26071,13 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -26582,7 +26582,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -26595,7 +26595,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -27100,7 +27100,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -27113,7 +27113,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -27616,12 +27616,12 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd @@ -28122,8 +28122,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.ibd @@ -28632,8 +28632,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.ibd @@ -29153,7 +29153,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, @@ -29161,7 +29161,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, - PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (3) ENGINE = InnoDB) unified filelist t1#P#part0.ibd @@ -29682,13 +29682,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta.ibd @@ -30203,13 +30203,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) unified filelist t1#P#parta#SP#partasp0.ibd @@ -30730,7 +30730,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -30743,7 +30743,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, - SUBPARTITION subpart42 ENGINE = InnoDB)) */ + SUBPARTITION subpart42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#subpart11.ibd @@ -31264,7 +31264,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, @@ -31277,7 +31277,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, - SUBPARTITION sp42 ENGINE = InnoDB)) */ + SUBPARTITION sp42 ENGINE = InnoDB)) unified filelist t1#P#part1#SP#sp11.ibd @@ -31796,12 +31796,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, - PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) unified filelist t1#P#part1#SP#part1sp0.ibd diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index 3351201ea06..69799a07076 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -73,8 +73,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -533,8 +533,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -1007,7 +1007,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -1015,7 +1015,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1492,13 +1492,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -1967,13 +1967,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2452,7 +2452,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -2465,7 +2465,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2946,7 +2946,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -2959,7 +2959,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3434,12 +3434,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -3914,8 +3914,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -4374,8 +4374,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -4848,7 +4848,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -4856,7 +4856,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5333,13 +5333,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -5808,13 +5808,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -6291,7 +6291,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -6304,7 +6304,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -6781,7 +6781,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -6794,7 +6794,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -7269,12 +7269,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -7755,8 +7755,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -8268,8 +8268,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -8795,7 +8795,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -8803,7 +8803,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9333,13 +9333,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -9861,13 +9861,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -10399,7 +10399,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -10412,7 +10412,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -10946,7 +10946,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -10959,7 +10959,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -11487,12 +11487,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -12024,8 +12024,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1 + f_int2) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -12537,8 +12537,8 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) -PARTITIONS 5 */ + PARTITION BY KEY (f_int1,f_int2) +PARTITIONS 5 unified filelist t1#P#p0.MYD @@ -13064,7 +13064,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, @@ -13072,7 +13072,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -13602,13 +13602,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -14130,13 +14130,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -14666,7 +14666,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -14679,7 +14679,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -15209,7 +15209,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, @@ -15222,7 +15222,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, - SUBPARTITION sp42 ENGINE = MyISAM)) */ + SUBPARTITION sp42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -15750,12 +15750,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result index d7a77e5e54a..f1c2a7d9af4 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result @@ -70,9 +70,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB, - PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB) */ + PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB) # # Verify that the DATA/INDEX DIRECTORY is stored and used if we # ALTER TABLE to MyISAM. @@ -83,9 +83,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, - PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM) */ + PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM) # Verifying .frm, .par and MyISAM files (.MYD, MYI) ---- MYSQLD_DATADIR/test t1#P#p0.MYD @@ -110,9 +110,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) + PARTITION BY HASH (c1) (PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB, - PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB) */ + PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = InnoDB) # Verifying .frm, .par, .isl and InnoDB .ibd files ---- MYSQLD_DATADIR/test t1#P#p0.isl diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result index 1c1a758f985..89ebd5652e7 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -83,9 +83,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -563,12 +563,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -1059,7 +1059,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -1067,7 +1067,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -1572,13 +1572,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -2067,13 +2067,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -2572,7 +2572,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -2585,7 +2585,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -3102,7 +3102,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -3115,7 +3115,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -3612,12 +3612,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -4116,9 +4116,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) + PARTITION BY HASH (f_int1 + f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -4596,12 +4596,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) + PARTITION BY KEY (f_int1,f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -5092,7 +5092,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -5100,7 +5100,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -5605,13 +5605,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -6100,13 +6100,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -6603,7 +6603,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -6616,7 +6616,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -7133,7 +7133,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -7146,7 +7146,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -7643,12 +7643,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -8153,9 +8153,9 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -8686,12 +8686,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -9235,7 +9235,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -9243,7 +9243,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -9801,13 +9801,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -10349,13 +10349,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -10907,7 +10907,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -10920,7 +10920,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -11490,7 +11490,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -11503,7 +11503,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -12053,12 +12053,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -12614,9 +12614,9 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1 + f_int2) + PARTITION BY HASH (f_int1 + f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -13147,12 +13147,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1,f_int2) + PARTITION BY KEY (f_int1,f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -13696,7 +13696,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) + PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -13704,7 +13704,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -14262,13 +14262,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) + PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -14810,13 +14810,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -15366,7 +15366,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -15379,7 +15379,7 @@ SUBPARTITION BY KEY (f_int2) SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -15949,7 +15949,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -15962,7 +15962,7 @@ SUBPARTITION BY HASH (f_int2 + 1) SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD @@ -16512,12 +16512,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) + PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -17069,9 +17069,9 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION p1 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -17595,12 +17595,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, - PARTITION p5 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION p5 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#p1.MYD @@ -18139,7 +18139,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,4)) + PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -18147,7 +18147,7 @@ t1 CREATE TABLE `t1` ( PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, - PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#part0.MYD @@ -18692,13 +18692,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, - PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta.MYD @@ -19230,13 +19230,13 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1 DIV 2) + PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ + PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) unified filelist t1#P#parta#SP#partasp0.MYD @@ -19781,7 +19781,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, @@ -19794,7 +19794,7 @@ SUBPARTITION BY KEY (f_int1) SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, - SUBPARTITION subpart42 ENGINE = MyISAM)) */ + SUBPARTITION subpart42 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -20324,7 +20324,7 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) + PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, @@ -20337,7 +20337,7 @@ SUBPARTITION BY HASH (f_int1 + 1) SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, - SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ + SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) unified filelist t1#P#part1#SP#sp11.MYD diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result index 558b5b3aae4..187b4a13d05 100644 --- a/mysql-test/suite/parts/r/partition_bit_innodb.result +++ b/mysql-test/suite/parts/r/partition_bit_innodb.result @@ -9,7 +9,7 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a) ( @@ -21,9 +21,9 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 ENGINE = InnoDB, - PARTITION pa2 ENGINE = InnoDB) */ + PARTITION pa2 ENGINE = InnoDB) drop table t1; create table t1 (a bit(64), primary key (a)) engine='INNODB' partition by key (a) partitions 2; @@ -33,8 +33,8 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -61,11 +61,11 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -91,8 +91,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 insert into t2 values (b'0'), (b'1'); select hex(a) from t2; hex(a) @@ -104,8 +104,8 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -117,8 +117,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -136,13 +136,13 @@ t3 CREATE TABLE `t3` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (64) ENGINE = InnoDB, - PARTITION pa4 VALUES LESS THAN (256) ENGINE = InnoDB) */ + PARTITION pa4 VALUES LESS THAN (256) ENGINE = InnoDB) 255 inserts; select hex(a) from t3 where a=b'01010101'; hex(a) @@ -419,12 +419,12 @@ t4 CREATE TABLE `t4` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = InnoDB, - PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = InnoDB) */ + PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = InnoDB) 32 inserts; select hex(a) from t4 where a=b'00000001'; hex(a) diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result index c101f44475d..3530743893e 100644 --- a/mysql-test/suite/parts/r/partition_bit_myisam.result +++ b/mysql-test/suite/parts/r/partition_bit_myisam.result @@ -9,7 +9,7 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a) ( @@ -21,9 +21,9 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 ENGINE = MyISAM, - PARTITION pa2 ENGINE = MyISAM) */ + PARTITION pa2 ENGINE = MyISAM) drop table t1; create table t1 (a bit(64), primary key (a)) engine='MyISAM' partition by key (a) partitions 2; @@ -33,8 +33,8 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -61,11 +61,11 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -91,8 +91,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 insert into t2 values (b'0'), (b'1'); select hex(a) from t2; hex(a) @@ -104,8 +104,8 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -117,8 +117,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -136,13 +136,13 @@ t3 CREATE TABLE `t3` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (64) ENGINE = MyISAM, - PARTITION pa4 VALUES LESS THAN (256) ENGINE = MyISAM) */ + PARTITION pa4 VALUES LESS THAN (256) ENGINE = MyISAM) 255 inserts; select hex(a) from t3 where a=b'01010101'; hex(a) @@ -419,12 +419,12 @@ t4 CREATE TABLE `t4` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = MyISAM, - PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM) */ + PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM) 32 inserts; select hex(a) from t4 where a=b'00000001'; hex(a) diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result index bb99e89b022c365b901e33f5a91578dde5218eb9..ab961222a6636cd24e1ceaa8533b794a21d6e374 100644 GIT binary patch delta 243 zcmaFX!ThM5dBY~g&4H^K87E)dEHPQCg?sWOA*;#pExn5q+88${bXqck7?XMXQzpBz zznfe*L6OPGd~+fP6DNwU&69)-grKsM6FDq5YpNbMg{#;s)e^-$IWPSqLdCSr1#uxv zKyw{8Pslc8+Waz?R}@*jKMzo?GSDbYg-ODjLsx!*yIN{<{+h2$FqchQZ_ErfXY<9) RDaKR WYAD$3gOGx0nB1^kYV*%+FL?k0XkS$T diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result index 9936f3ec0f4bff645155b494f148986d9e6197a9..09b77cad211d8a2856a11871137574b589ff82ff 100644 GIT binary patch delta 243 zcmaFX!ThM5dBY~g&4H^K87E)dEHPQCg?sWOA*;#pExn5q+88${bXqck7?XMXQzpBz zznfe*L6OPGd~+fP6DNwU&69)-grKsM6FDq5YpNbMg{#;s)e^-$IWPSqLdCSr1#uxv zKyw{8Pslc8+Waz?R}@*jKMzo?GSDbYg-ODjLsx!*yIN{<{+h2$FqchQZ_ErfXY<9) RDaKR WYAD$3gOGx0nB1^kYV*%+FL?k0XkS$T diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index 0a5e9775c36..ced3a1d0b25 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -40,8 +40,8 @@ t2 CREATE TABLE `t2` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -137,11 +137,11 @@ t1 CREATE TABLE `t1` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -167,8 +167,8 @@ t2 CREATE TABLE `t2` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t2; a @@ -291,13 +291,13 @@ t3 CREATE TABLE `t3` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) 12 inserts; select count(*) from t3; count(*) @@ -331,13 +331,13 @@ t4 CREATE TABLE `t4` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) 12 inserts; select count(*) from t4; count(*) @@ -369,11 +369,11 @@ t1 CREATE TABLE `t1` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -399,8 +399,8 @@ t2 CREATE TABLE `t2` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16'); select * from t2; a @@ -498,13 +498,13 @@ t3 CREATE TABLE `t3` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (second(a)) + PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, - PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) 59 inserts; select count(*) from t3; count(*) @@ -585,13 +585,13 @@ t4 CREATE TABLE `t4` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (second(a)) + PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, - PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) 59 inserts; select count(*) from t4; count(*) @@ -670,11 +670,11 @@ t1 CREATE TABLE `t1` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -700,8 +700,8 @@ t2 CREATE TABLE `t2` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -799,13 +799,13 @@ t3 CREATE TABLE `t3` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) 12 inserts; select count(*) from t3; count(*) @@ -839,13 +839,13 @@ t4 CREATE TABLE `t4` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) 12 inserts; select count(*) from t4; count(*) @@ -877,11 +877,11 @@ t1 CREATE TABLE `t1` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a @@ -907,8 +907,8 @@ t2 CREATE TABLE `t2` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975'), ('2020'), ('1980'), ('2000'); select * from t2; a diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 217fe9ace1d..7939df21d67 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -40,8 +40,8 @@ t2 CREATE TABLE `t2` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -137,11 +137,11 @@ t1 CREATE TABLE `t1` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -167,8 +167,8 @@ t2 CREATE TABLE `t2` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t2; a @@ -291,13 +291,13 @@ t3 CREATE TABLE `t3` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) 12 inserts; select count(*) from t3; count(*) @@ -331,13 +331,13 @@ t4 CREATE TABLE `t4` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) 12 inserts; select count(*) from t4; count(*) @@ -369,11 +369,11 @@ t1 CREATE TABLE `t1` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -399,8 +399,8 @@ t2 CREATE TABLE `t2` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16'); select * from t2; a @@ -498,13 +498,13 @@ t3 CREATE TABLE `t3` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (second(a)) + PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, - PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) 59 inserts; select count(*) from t3; count(*) @@ -585,13 +585,13 @@ t4 CREATE TABLE `t4` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (second(a)) + PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, - PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) 59 inserts; select count(*) from t4; count(*) @@ -670,11 +670,11 @@ t1 CREATE TABLE `t1` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -700,8 +700,8 @@ t2 CREATE TABLE `t2` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -799,13 +799,13 @@ t3 CREATE TABLE `t3` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) 12 inserts; select count(*) from t3; count(*) @@ -839,13 +839,13 @@ t4 CREATE TABLE `t4` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) 12 inserts; select count(*) from t4; count(*) @@ -877,11 +877,11 @@ t1 CREATE TABLE `t1` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a @@ -907,8 +907,8 @@ t2 CREATE TABLE `t2` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975'), ('2020'), ('1980'), ('2000'); select * from t2; a diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result index 109072be49c..aa33b3ffa57 100644 --- a/mysql-test/suite/parts/r/partition_debug.result +++ b/mysql-test/suite/parts/r/partition_debug.result @@ -55,9 +55,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -100,9 +100,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -167,9 +167,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -212,9 +212,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -279,9 +279,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -324,9 +324,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -391,9 +391,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -436,9 +436,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -503,9 +503,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -548,9 +548,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -615,9 +615,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -660,9 +660,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -727,9 +727,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -772,9 +772,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -839,9 +839,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -884,9 +884,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -951,9 +951,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -996,9 +996,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 11 Original from partition p1 @@ -1063,9 +1063,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1098,9 +1098,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1165,9 +1165,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1200,9 +1200,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1267,9 +1267,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1302,9 +1302,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1369,9 +1369,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1404,9 +1404,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1471,9 +1471,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1506,9 +1506,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1573,9 +1573,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1608,9 +1608,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1675,9 +1675,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1710,9 +1710,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1777,9 +1777,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1812,9 +1812,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1879,9 +1879,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1914,9 +1914,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1; a b 11 Original from partition p1 diff --git a/mysql-test/suite/parts/r/partition_debug_innodb.result b/mysql-test/suite/parts/r/partition_debug_innodb.result index 7ecd746077e..0cc8b5454a2 100644 --- a/mysql-test/suite/parts/r/partition_debug_innodb.result +++ b/mysql-test/suite/parts/r/partition_debug_innodb.result @@ -30,9 +30,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -62,9 +62,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -95,9 +95,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -129,9 +129,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -162,9 +162,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -196,9 +196,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -229,9 +229,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -263,9 +263,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -296,9 +296,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -331,9 +331,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -364,9 +364,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -399,9 +399,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -432,9 +432,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -467,9 +467,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -500,9 +500,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -536,10 +536,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -570,9 +570,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -604,10 +604,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -638,9 +638,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -672,10 +672,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -707,9 +707,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -734,9 +734,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -766,9 +766,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -794,9 +794,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -828,9 +828,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -855,9 +855,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -887,9 +887,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -915,9 +915,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -949,9 +949,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -976,9 +976,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1008,9 +1008,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1036,9 +1036,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1070,9 +1070,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1097,9 +1097,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1129,9 +1129,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1157,9 +1157,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1191,9 +1191,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1218,9 +1218,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1250,9 +1250,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1278,9 +1278,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1312,9 +1312,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1339,9 +1339,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1371,9 +1371,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1399,9 +1399,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1433,9 +1433,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1460,9 +1460,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1492,9 +1492,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1520,9 +1520,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1554,9 +1554,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1582,10 +1582,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1615,9 +1615,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1644,10 +1644,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1679,9 +1679,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1707,10 +1707,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1740,9 +1740,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1769,10 +1769,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1804,9 +1804,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1832,10 +1832,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1865,9 +1865,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1894,10 +1894,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1930,9 +1930,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1961,9 +1961,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1994,9 +1994,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2027,9 +2027,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2060,9 +2060,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2093,9 +2093,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2126,9 +2126,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2158,8 +2158,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2186,9 +2186,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2218,8 +2218,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2246,9 +2246,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2278,8 +2278,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2306,9 +2306,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2336,8 +2336,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2364,9 +2364,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2393,8 +2393,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2421,9 +2421,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2450,8 +2450,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2479,9 +2479,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2505,9 +2505,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2537,9 +2537,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2564,9 +2564,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2598,9 +2598,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2624,9 +2624,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2656,9 +2656,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2683,9 +2683,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2717,9 +2717,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2743,9 +2743,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2775,9 +2775,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2802,9 +2802,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2836,9 +2836,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2861,8 +2861,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2888,9 +2888,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2914,8 +2914,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2943,9 +2943,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2968,8 +2968,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2995,9 +2995,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3021,8 +3021,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3050,9 +3050,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3075,8 +3075,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3102,9 +3102,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3128,8 +3128,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3157,9 +3157,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3182,8 +3182,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3209,9 +3209,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3235,8 +3235,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3264,9 +3264,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3289,8 +3289,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3316,9 +3316,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3342,8 +3342,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3371,9 +3371,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3396,8 +3396,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3423,9 +3423,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3449,8 +3449,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3480,9 +3480,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3513,9 +3513,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3546,9 +3546,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3581,9 +3581,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3614,9 +3614,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3649,9 +3649,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3682,9 +3682,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3719,9 +3719,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3752,9 +3752,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3789,9 +3789,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3822,9 +3822,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3859,9 +3859,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3892,9 +3892,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3930,10 +3930,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3964,9 +3964,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4002,10 +4002,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4036,9 +4036,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4072,10 +4072,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4106,9 +4106,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4142,10 +4142,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4176,9 +4176,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4211,10 +4211,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4245,9 +4245,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4280,10 +4280,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4316,9 +4316,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4344,9 +4344,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4376,9 +4376,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4405,9 +4405,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4439,9 +4439,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4467,9 +4467,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4499,9 +4499,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4528,9 +4528,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4562,9 +4562,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4590,9 +4590,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4622,9 +4622,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4651,9 +4651,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4685,9 +4685,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4713,9 +4713,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4745,9 +4745,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4774,9 +4774,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4808,9 +4808,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4836,9 +4836,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4868,9 +4868,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4897,9 +4897,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4931,9 +4931,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4959,9 +4959,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4991,9 +4991,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5020,9 +5020,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5054,9 +5054,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5083,10 +5083,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5116,9 +5116,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5146,10 +5146,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5181,9 +5181,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5210,10 +5210,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5243,9 +5243,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5273,10 +5273,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5308,9 +5308,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5337,10 +5337,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5370,9 +5370,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5400,10 +5400,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5435,9 +5435,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5464,10 +5464,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5497,9 +5497,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5527,10 +5527,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5562,9 +5562,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5591,10 +5591,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5624,9 +5624,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5654,10 +5654,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5689,9 +5689,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5718,10 +5718,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5751,9 +5751,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5781,10 +5781,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5838,9 +5838,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5877,9 +5877,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5943,9 +5943,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5982,9 +5982,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6048,9 +6048,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6087,9 +6087,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6153,9 +6153,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6192,9 +6192,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6258,9 +6258,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6297,9 +6297,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6363,9 +6363,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6402,9 +6402,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6468,9 +6468,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6507,9 +6507,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6573,9 +6573,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6612,9 +6612,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6678,9 +6678,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6717,9 +6717,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 11 Original from partition p1 @@ -6783,9 +6783,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6815,9 +6815,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6881,9 +6881,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6913,9 +6913,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6979,9 +6979,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7011,9 +7011,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7077,9 +7077,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7109,9 +7109,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7175,9 +7175,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7207,9 +7207,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7273,9 +7273,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7305,9 +7305,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7371,9 +7371,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7403,9 +7403,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7469,9 +7469,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7501,9 +7501,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7567,9 +7567,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 1 Original from partition p0 @@ -7599,9 +7599,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a b 11 Original from partition p1 diff --git a/mysql-test/suite/parts/r/partition_debug_myisam.result b/mysql-test/suite/parts/r/partition_debug_myisam.result index 8408f166e79..c0ddc1bfb16 100644 --- a/mysql-test/suite/parts/r/partition_debug_myisam.result +++ b/mysql-test/suite/parts/r/partition_debug_myisam.result @@ -29,9 +29,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -65,9 +65,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -100,9 +100,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -138,9 +138,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -173,9 +173,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -211,9 +211,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -246,9 +246,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -284,9 +284,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -319,9 +319,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -359,9 +359,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -394,9 +394,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -434,9 +434,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -469,9 +469,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -509,9 +509,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -544,9 +544,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -586,10 +586,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -622,9 +622,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -662,10 +662,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -698,9 +698,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -738,10 +738,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -775,9 +775,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -804,9 +804,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -838,9 +838,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -868,9 +868,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -904,9 +904,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -933,9 +933,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -967,9 +967,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -997,9 +997,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1033,9 +1033,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1062,9 +1062,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1096,9 +1096,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1126,9 +1126,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1162,9 +1162,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1191,9 +1191,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1225,9 +1225,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1255,9 +1255,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1291,9 +1291,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1320,9 +1320,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1354,9 +1354,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1384,9 +1384,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1420,9 +1420,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1449,9 +1449,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1483,9 +1483,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1513,9 +1513,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1549,9 +1549,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1578,9 +1578,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1612,9 +1612,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1642,9 +1642,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1678,9 +1678,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1709,10 +1709,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1744,9 +1744,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1776,10 +1776,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1813,9 +1813,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1844,10 +1844,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1879,9 +1879,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1911,10 +1911,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1948,9 +1948,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -1979,10 +1979,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2014,9 +2014,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2046,10 +2046,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2084,9 +2084,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2119,9 +2119,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2154,9 +2154,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2191,9 +2191,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2226,9 +2226,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2263,9 +2263,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2298,9 +2298,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2333,8 +2333,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2363,9 +2363,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2398,8 +2398,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2428,9 +2428,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2463,8 +2463,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2493,9 +2493,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2526,8 +2526,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2556,9 +2556,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2587,8 +2587,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2617,9 +2617,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2648,8 +2648,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2679,9 +2679,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2707,9 +2707,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2741,9 +2741,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2770,9 +2770,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2806,9 +2806,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2834,9 +2834,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2868,9 +2868,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2897,9 +2897,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2933,9 +2933,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2961,9 +2961,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -2995,9 +2995,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3024,9 +3024,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3060,9 +3060,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3086,8 +3086,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3115,9 +3115,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3142,8 +3142,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3173,9 +3173,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3199,8 +3199,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3228,9 +3228,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3255,8 +3255,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3286,9 +3286,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3312,8 +3312,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3341,9 +3341,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3368,8 +3368,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3399,9 +3399,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3425,8 +3425,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3454,9 +3454,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3481,8 +3481,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3512,9 +3512,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3538,8 +3538,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3567,9 +3567,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3594,8 +3594,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3625,9 +3625,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3651,8 +3651,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3680,9 +3680,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3707,8 +3707,8 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) -(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */ + PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3740,9 +3740,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3777,9 +3777,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3812,9 +3812,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3851,9 +3851,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3886,9 +3886,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3925,9 +3925,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -3960,9 +3960,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4003,9 +4003,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4038,9 +4038,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4081,9 +4081,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4116,9 +4116,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4159,9 +4159,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4194,9 +4194,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4239,10 +4239,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4275,9 +4275,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4320,10 +4320,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4356,9 +4356,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4399,10 +4399,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4435,9 +4435,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4478,10 +4478,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4514,9 +4514,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4555,10 +4555,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4591,9 +4591,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4632,10 +4632,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4670,9 +4670,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4700,9 +4700,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4734,9 +4734,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4765,9 +4765,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4801,9 +4801,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4831,9 +4831,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4865,9 +4865,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4896,9 +4896,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4932,9 +4932,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4962,9 +4962,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -4996,9 +4996,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5027,9 +5027,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5063,9 +5063,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5093,9 +5093,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5127,9 +5127,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5158,9 +5158,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5194,9 +5194,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5224,9 +5224,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5258,9 +5258,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5289,9 +5289,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5325,9 +5325,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5355,9 +5355,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5389,9 +5389,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5420,9 +5420,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5456,9 +5456,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5488,10 +5488,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5523,9 +5523,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5556,10 +5556,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5593,9 +5593,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5625,10 +5625,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5660,9 +5660,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5693,10 +5693,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5730,9 +5730,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5762,10 +5762,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5797,9 +5797,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5830,10 +5830,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5867,9 +5867,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5899,10 +5899,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5934,9 +5934,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -5967,10 +5967,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6004,9 +6004,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6036,10 +6036,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6071,9 +6071,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6104,10 +6104,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6141,9 +6141,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6173,10 +6173,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6208,9 +6208,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, - PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */ + PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 @@ -6241,10 +6241,10 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(64) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM, - PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */ + PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) SELECT * FROM t1; a b 1 Original from partition p0 diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result index 9a62988087e..a34085675cf 100644 --- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -51,8 +51,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) t1#P#p0.ibd t1.frm t1.par @@ -88,9 +88,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1; a 1 diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index 8eb408d05d9..58c51f0ed3c 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` decimal(10,4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a @@ -54,8 +54,8 @@ t2 CREATE TABLE `t2` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567); select * from t2; a @@ -100,14 +100,14 @@ t3 CREATE TABLE `t3` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (floor(a)) + PARTITION BY RANGE (floor(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, - PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ + PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) 9*3 inserts; select count(*) from t3; count(*) @@ -127,14 +127,14 @@ t4 CREATE TABLE `t4` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ceiling(a)) + PARTITION BY LIST (ceiling(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, - PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */ + PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) 9*3 inserts; select count(*) from t4; count(*) diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index 2b214bd94cf..956923117a5 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` decimal(10,4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a @@ -54,8 +54,8 @@ t2 CREATE TABLE `t2` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567); select * from t2; a @@ -100,14 +100,14 @@ t3 CREATE TABLE `t3` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (floor(a)) + PARTITION BY RANGE (floor(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, - PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ + PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) 9*3 inserts; select count(*) from t3; count(*) @@ -127,14 +127,14 @@ t4 CREATE TABLE `t4` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ceiling(a)) + PARTITION BY LIST (ceiling(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, - PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */ + PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) 9*3 inserts; select count(*) from t4; count(*) diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index cfa27c8e112..ec306c42648 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -68,8 +68,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -525,9 +525,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -984,14 +984,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1509,14 +1509,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2010,14 +2010,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2472,14 +2472,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2934,9 +2934,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3393,14 +3393,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3858,14 +3858,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4316,8 +4316,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -(PARTITION part1 ENGINE = InnoDB) */ + PARTITION BY HASH (f_int1) +(PARTITION part1 ENGINE = InnoDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4770,11 +4770,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = InnoDB, - SUBPARTITION subpart12 ENGINE = InnoDB)) */ + SUBPARTITION subpart12 ENGINE = InnoDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 3d20dbb726a..30f3b8116f7 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -68,8 +68,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -534,9 +534,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -1002,14 +1002,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -1540,14 +1540,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2054,14 +2054,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -2529,14 +2529,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -3004,9 +3004,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -3472,14 +3472,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -3950,14 +3950,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -4421,8 +4421,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -(PARTITION part1 ENGINE = MyISAM) */ + PARTITION BY HASH (f_int1) +(PARTITION part1 ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -4882,11 +4882,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, - SUBPARTITION subpart12 ENGINE = MyISAM)) */ + SUBPARTITION subpart12 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD diff --git a/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result index 5fe5b7cbfcd..12996c0668a 100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_1_innodb.result @@ -128,10 +128,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = InnoDB) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = InnoDB) ALTER TABLE tp DROP INDEX a; ALTER TABLE t_10 DROP INDEX a; ALTER TABLE tp ADD UNIQUE INDEX USING BTREE (a,b); @@ -153,10 +153,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`,`b`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = InnoDB) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = InnoDB) DROP TABLE IF EXISTS t_10; DROP TABLE IF EXISTS t_100; DROP TABLE IF EXISTS t_1000; diff --git a/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result index 8a9ffd0479a..d6a45d7dc5f 100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_1_myisam.result @@ -128,10 +128,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = MyISAM) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = MyISAM) ALTER TABLE tp DROP INDEX a; ALTER TABLE t_10 DROP INDEX a; ALTER TABLE tp ADD UNIQUE INDEX USING BTREE (a,b); @@ -153,10 +153,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`,`b`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = MyISAM) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = MyISAM) DROP TABLE IF EXISTS t_10; DROP TABLE IF EXISTS t_100; DROP TABLE IF EXISTS t_1000; diff --git a/mysql-test/suite/parts/r/partition_exchange_archive.result b/mysql-test/suite/parts/r/partition_exchange_archive.result index 2918c2eed31..45f6571c70d 100644 --- a/mysql-test/suite/parts/r/partition_exchange_archive.result +++ b/mysql-test/suite/parts/r/partition_exchange_archive.result @@ -14,8 +14,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -80,8 +80,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=ARCHIVE AUTO_INCREMENT=22 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -175,9 +175,9 @@ tp CREATE TABLE `tp` ( `a` int(11) DEFAULT NULL, `b` varchar(55) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) SET DEBUG_SYNC= 'now SIGNAL goto_verification'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # select from t and select/update/delete/insert from tp should work @@ -208,9 +208,9 @@ tp CREATE TABLE `tp` ( `a` int(11) DEFAULT NULL, `b` varchar(55) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) SET DEBUG_SYNC= 'now SIGNAL goto_wait'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # Both tables should now be under exclusive lock, even SHOW should fail @@ -265,9 +265,9 @@ tp CREATE TABLE `tp` ( `a` int(11) DEFAULT NULL, `b` varchar(55) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) SELECT * FROM tp WHERE a = 99; a b 99 End of values @@ -292,9 +292,9 @@ tp CREATE TABLE `tp` ( `a` int(11) DEFAULT NULL, `b` varchar(55) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) SELECT * FROM t; a b 10 Ten diff --git a/mysql-test/suite/parts/r/partition_exchange_innodb.result b/mysql-test/suite/parts/r/partition_exchange_innodb.result index 3070f7c3932..97aef348c59 100644 --- a/mysql-test/suite/parts/r/partition_exchange_innodb.result +++ b/mysql-test/suite/parts/r/partition_exchange_innodb.result @@ -13,8 +13,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -86,8 +86,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -194,9 +194,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SET DEBUG_SYNC= 'now SIGNAL goto_verification'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # select from t and select/update/delete/insert from tp should work @@ -237,9 +237,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SET DEBUG_SYNC= 'now SIGNAL goto_wait'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # Both tables should now be under exclusive lock, even SHOW should fail @@ -312,9 +312,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM tp WHERE a = 99; a b 99 End of values @@ -346,9 +346,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t; a b 10 Ten diff --git a/mysql-test/suite/parts/r/partition_exchange_memory.result b/mysql-test/suite/parts/r/partition_exchange_memory.result index edd3667a484..9c270422e17 100644 --- a/mysql-test/suite/parts/r/partition_exchange_memory.result +++ b/mysql-test/suite/parts/r/partition_exchange_memory.result @@ -13,8 +13,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -86,8 +86,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -194,9 +194,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SET DEBUG_SYNC= 'now SIGNAL goto_verification'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # select from t and select/update/delete/insert from tp should work @@ -237,9 +237,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SET DEBUG_SYNC= 'now SIGNAL goto_wait'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # Both tables should now be under exclusive lock, even SHOW should fail @@ -312,9 +312,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SELECT * FROM tp WHERE a = 99; a b 99 End of values @@ -346,9 +346,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SELECT * FROM t; a b 10 Ten diff --git a/mysql-test/suite/parts/r/partition_exchange_myisam.result b/mysql-test/suite/parts/r/partition_exchange_myisam.result index 9ad0b9f2728..ecabe7bde1d 100644 --- a/mysql-test/suite/parts/r/partition_exchange_myisam.result +++ b/mysql-test/suite/parts/r/partition_exchange_myisam.result @@ -13,8 +13,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -86,8 +86,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -194,9 +194,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SET DEBUG_SYNC= 'now SIGNAL goto_verification'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # select from t and select/update/delete/insert from tp should work @@ -237,9 +237,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SET DEBUG_SYNC= 'now SIGNAL goto_wait'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # Both tables should now be under exclusive lock, even SHOW should fail @@ -312,9 +312,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM tp WHERE a = 99; a b 99 End of values @@ -346,9 +346,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t; a b 10 Ten diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result index d2f04a68629..d7f6e4bb4ac 100644 --- a/mysql-test/suite/parts/r/partition_float_innodb.result +++ b/mysql-test/suite/parts/r/partition_float_innodb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); select * from t2; a @@ -100,11 +100,11 @@ t1 CREATE TABLE `t1` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a @@ -138,8 +138,8 @@ t2 CREATE TABLE `t2` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t2; a diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result index 2d52d095989..f4b57fc271a 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); select * from t2; a @@ -100,11 +100,11 @@ t1 CREATE TABLE `t1` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a @@ -138,8 +138,8 @@ t2 CREATE TABLE `t2` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t2; a diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result index 7a51b80d5d7..9556aca2a96 100644 --- a/mysql-test/suite/parts/r/partition_int_innodb.result +++ b/mysql-test/suite/parts/r/partition_int_innodb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (255), (254), (253), (252); select * from t2; a @@ -78,8 +78,8 @@ t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a @@ -119,11 +119,11 @@ t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -155,8 +155,8 @@ t2 CREATE TABLE `t2` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (65535), (65534), (65533), (65532); select * from t2; a @@ -187,8 +187,8 @@ t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a @@ -228,11 +228,11 @@ t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -264,8 +264,8 @@ t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -296,8 +296,8 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a @@ -337,11 +337,11 @@ t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -373,8 +373,8 @@ t2 CREATE TABLE `t2` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (16777215), (16777214), (16777213), (16777212); select * from t2; a @@ -405,8 +405,8 @@ t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a @@ -446,11 +446,11 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a @@ -494,8 +494,8 @@ t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -526,8 +526,8 @@ t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index 4387bbfdd78..9eaa98af38f 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (255), (254), (253), (252); select * from t2; a @@ -78,8 +78,8 @@ t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a @@ -119,11 +119,11 @@ t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -155,8 +155,8 @@ t2 CREATE TABLE `t2` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (65535), (65534), (65533), (65532); select * from t2; a @@ -187,8 +187,8 @@ t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a @@ -228,11 +228,11 @@ t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -264,8 +264,8 @@ t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -296,8 +296,8 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a @@ -337,11 +337,11 @@ t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -373,8 +373,8 @@ t2 CREATE TABLE `t2` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (16777215), (16777214), (16777213), (16777212); select * from t2; a @@ -405,8 +405,8 @@ t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a @@ -446,11 +446,11 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a @@ -494,8 +494,8 @@ t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -526,8 +526,8 @@ t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result index 330258094ef..de888826906 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -271,11 +271,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, - PARTITION PartD ENGINE = ARCHIVE) */ + PARTITION PartD ENGINE = ARCHIVE) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -364,14 +364,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -392,10 +392,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -428,10 +428,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -507,11 +507,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, - PARTITION PartD ENGINE = ARCHIVE) */ + PARTITION PartD ENGINE = ARCHIVE) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -589,14 +589,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -620,12 +620,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -658,11 +658,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -738,11 +738,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, - PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -820,14 +820,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -851,12 +851,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, - PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ + PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -889,12 +889,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, - PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ + PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -961,11 +961,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, - PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result index 5b54e9c571f..dcc48f46251 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -271,11 +271,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, - PARTITION PartD ENGINE = InnoDB) */ + PARTITION PartD ENGINE = InnoDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -364,14 +364,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -392,10 +392,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -428,10 +428,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -507,11 +507,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, - PARTITION PartD ENGINE = InnoDB) */ + PARTITION PartD ENGINE = InnoDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -589,14 +589,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -620,12 +620,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -658,11 +658,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -738,11 +738,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -820,14 +820,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, - PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES IN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -851,12 +851,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -889,12 +889,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -961,11 +961,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, - PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -1004,10 +1004,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result index dd4bed89ea8..5451b5a6fd3 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -271,11 +271,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, - PARTITION PartD ENGINE = MEMORY) */ + PARTITION PartD ENGINE = MEMORY) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -364,14 +364,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -392,10 +392,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -428,10 +428,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -507,11 +507,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, - PARTITION PartD ENGINE = MEMORY) */ + PARTITION PartD ENGINE = MEMORY) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -589,14 +589,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -620,12 +620,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -658,11 +658,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -738,11 +738,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, - PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -820,14 +820,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, - PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES IN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -851,12 +851,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -889,12 +889,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -961,11 +961,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, - PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -1004,10 +1004,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result index b01279017fe..40399ae3312 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -271,11 +271,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, - PARTITION PartD ENGINE = MyISAM) */ + PARTITION PartD ENGINE = MyISAM) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -364,14 +364,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -392,10 +392,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -428,10 +428,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -507,11 +507,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, - PARTITION PartD ENGINE = MyISAM) */ + PARTITION PartD ENGINE = MyISAM) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -589,14 +589,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -620,12 +620,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -658,11 +658,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -738,11 +738,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -820,14 +820,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, - PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES IN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -851,12 +851,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -889,12 +889,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -961,11 +961,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, - PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -1004,10 +1004,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result index 66ba08cfbe0..40436328185 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, - PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ + PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, - PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ + PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, - PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ + PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result index e1c2d0a74bb..0aab26b189b 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, - PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES IN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result index ecd89689435..5e7da61802e 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, - PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES IN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result index deecf320d7d..505bf6403a6 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, - PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES IN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result index f3503889699..799e69af458 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, - PARTITION PartG ENGINE = ARCHIVE) */ + PARTITION PartG ENGINE = ARCHIVE) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, - PARTITION Partc ENGINE = ARCHIVE) */ + PARTITION Partc ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, - PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ + PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result index 50579e84d96..d25371615ef 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, - PARTITION PartG ENGINE = InnoDB) */ + PARTITION PartG ENGINE = InnoDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, - PARTITION Partc ENGINE = InnoDB) */ + PARTITION Partc ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, - PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ + PARTITION PartG VALUES IN (22) ENGINE = InnoDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, - PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ + PARTITION PartE VALUES IN (13) ENGINE = InnoDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = InnoDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = InnoDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result index e92aac28e79..076079ccb00 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, - PARTITION PartG ENGINE = MEMORY) */ + PARTITION PartG ENGINE = MEMORY) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, - PARTITION Partc ENGINE = MEMORY) */ + PARTITION Partc ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, - PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ + PARTITION PartG VALUES IN (22) ENGINE = MEMORY) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, - PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ + PARTITION PartE VALUES IN (13) ENGINE = MEMORY) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MEMORY, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MEMORY, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MEMORY) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result index 35c663caae3..e01f0e8d440 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, - PARTITION PartG ENGINE = MyISAM) */ + PARTITION PartG ENGINE = MyISAM) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, - PARTITION Partc ENGINE = MyISAM) */ + PARTITION Partc ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, - PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, - PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ + PARTITION PartG VALUES IN (22) ENGINE = MyISAM) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, - PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ + PARTITION PartE VALUES IN (13) ENGINE = MyISAM) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = MyISAM, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = MyISAM, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = MyISAM) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result index 78d15373924..ace37228d8d 100644 --- a/mysql-test/suite/parts/r/partition_special_innodb.result +++ b/mysql-test/suite/parts/r/partition_special_innodb.result @@ -13,11 +13,11 @@ t1 CREATE TABLE `t1` ( `d` enum('m','w') NOT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d) + PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -55,11 +55,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -105,11 +105,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) + PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -185,11 +185,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result index 9e82019e9bc..df184e385ae 100644 --- a/mysql-test/suite/parts/r/partition_special_myisam.result +++ b/mysql-test/suite/parts/r/partition_special_myisam.result @@ -13,11 +13,11 @@ t1 CREATE TABLE `t1` ( `d` enum('m','w') NOT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d) + PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -55,11 +55,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -105,11 +105,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) + PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -185,11 +185,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result index 767f023d04e..f8de7ca5249 100644 --- a/mysql-test/suite/parts/r/partition_syntax_innodb.result +++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result @@ -658,9 +658,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, - PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (1) ENGINE = InnoDB) DROP TABLE t1; # 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0) @@ -685,10 +685,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, PARTITION part2 VALUES IN (0) ENGINE = InnoDB, - PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */ + PARTITION part3 VALUES IN (1) ENGINE = InnoDB) DROP TABLE t1; @@ -719,7 +719,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) */ + PARTITION BY HASH (f_int1) DROP TABLE t1; # 4.1.2 no partition number, named partitions @@ -741,9 +741,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) DROP TABLE t1; # 4.1.3 variations on no partition/subpartition number, named partitions, @@ -826,7 +826,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, @@ -836,7 +836,7 @@ SUBPARTITION BY HASH (f_int1) SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = InnoDB, - SUBPARTITION subpart32 ENGINE = InnoDB)) */ + SUBPARTITION subpart32 ENGINE = InnoDB)) DROP TABLE t1; #------------------------------------------------------------------------ @@ -862,8 +862,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 DROP TABLE t1; CREATE TABLE t1 ( @@ -887,11 +887,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -912,8 +912,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 1 */ + PARTITION BY HASH (f_int1) +PARTITIONS 1 DROP TABLE t1; CREATE TABLE t1 ( @@ -937,11 +937,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -1681,9 +1681,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, - PARTITION part2 ENGINE = InnoDB) */ + PARTITION part2 ENGINE = InnoDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -1710,14 +1710,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, - SUBPARTITION subpart22 ENGINE = InnoDB)) */ + SUBPARTITION subpart22 ENGINE = InnoDB)) DROP TABLE t1; # 4.3.2 (positive) number of partition/subpartition , diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result index 97eabe7d2ce..e7ae727ea02 100644 --- a/mysql-test/suite/parts/r/partition_syntax_myisam.result +++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result @@ -658,9 +658,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, - PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (1) ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -693,10 +693,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, PARTITION part2 VALUES IN (0) ENGINE = MyISAM, - PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */ + PARTITION part3 VALUES IN (1) ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -737,7 +737,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) */ + PARTITION BY HASH (f_int1) unified filelist t1#P#p0.MYD @@ -765,9 +765,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -858,7 +858,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, @@ -868,7 +868,7 @@ SUBPARTITION BY HASH (f_int1) SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = MyISAM, - SUBPARTITION subpart32 ENGINE = MyISAM)) */ + SUBPARTITION subpart32 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD @@ -910,8 +910,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 unified filelist t1#P#p0.MYD @@ -943,11 +943,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -980,8 +980,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 1 */ + PARTITION BY HASH (f_int1) +PARTITIONS 1 unified filelist t1#P#p0.MYD @@ -1011,11 +1011,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) unified filelist t1#P#part1#SP#part1sp0.MYD @@ -1763,9 +1763,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, - PARTITION part2 ENGINE = MyISAM) */ + PARTITION part2 ENGINE = MyISAM) unified filelist t1#P#part1.MYD @@ -1800,14 +1800,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, - SUBPARTITION subpart22 ENGINE = MyISAM)) */ + SUBPARTITION subpart22 ENGINE = MyISAM)) unified filelist t1#P#part1#SP#subpart11.MYD diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result index 874b482cfb8..38bca0b931f 100644 --- a/mysql-test/suite/parts/r/rpl_partition.result +++ b/mysql-test/suite/parts/r/rpl_partition.result @@ -135,7 +135,7 @@ Create Table CREATE TABLE `t3` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, @@ -148,7 +148,7 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) include/check_slave_is_running.inc SELECT count(*) "Slave norm" FROM t1; Slave norm 500 diff --git a/mysql-test/suite/perfschema/r/part_table_io.result b/mysql-test/suite/perfschema/r/part_table_io.result index 2aa12851679..0fd8653734d 100644 --- a/mysql-test/suite/perfschema/r/part_table_io.result +++ b/mysql-test/suite/perfschema/r/part_table_io.result @@ -20,8 +20,8 @@ no_index_tab CREATE TABLE `no_index_tab` ( `a` varchar(255) NOT NULL, `b` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (b) -PARTITIONS 2 */ + PARTITION BY KEY (b) +PARTITIONS 2 insert into marker set a = 1; insert into test.no_index_tab set a = 'foo', b = 1; insert into marker set a = 1; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index f4648160bbd..815c2599a65 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -662,8 +662,8 @@ t16 CREATE TABLE `t16` ( `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** Show table on Slave **** connection slave; SHOW CREATE TABLE t16; @@ -678,8 +678,8 @@ t16 CREATE TABLE `t16` ( `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** DROP TABLE t16 *** connection master; DROP TABLE t16; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index f3863b27325..0d249834e70 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -662,8 +662,8 @@ t16 CREATE TABLE `t16` ( `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** Show table on Slave **** connection slave; SHOW CREATE TABLE t16; @@ -678,8 +678,8 @@ t16 CREATE TABLE `t16` ( `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** DROP TABLE t16 *** connection master; DROP TABLE t16; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index 86607217019..ea48173dc76 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -121,7 +121,7 @@ Create Table CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, @@ -134,7 +134,7 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) SELECT count(*) "Slave norm" FROM test.regular_tbl; Slave norm 500 SELECT count(*) "Slave bykey" FROM test.bykey_tbl; diff --git a/mysql-test/suite/rpl/r/rpl_partition_archive.result b/mysql-test/suite/rpl/r/rpl_partition_archive.result index b2640d724e4..4dfd38bcbc6 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_archive.result +++ b/mysql-test/suite/rpl/r/rpl_partition_archive.result @@ -62,9 +62,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=ARCHIVE AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( @@ -104,9 +104,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=ARCHIVE AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = ARCHIVE, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( diff --git a/mysql-test/suite/rpl/r/rpl_partition_innodb.result b/mysql-test/suite/rpl/r/rpl_partition_innodb.result index 382e09ac888..4494b757291 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_partition_innodb.result @@ -62,9 +62,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( @@ -106,9 +106,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = InnoDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( diff --git a/mysql-test/suite/rpl/r/rpl_partition_memory.result b/mysql-test/suite/rpl/r/rpl_partition_memory.result index 999f36fb47f..6073352210d 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_memory.result +++ b/mysql-test/suite/rpl/r/rpl_partition_memory.result @@ -62,9 +62,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MEMORY AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MEMORY) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( @@ -106,9 +106,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MEMORY AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = MEMORY, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MEMORY) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( diff --git a/mysql-test/suite/rpl/r/rpl_partition_myisam.result b/mysql-test/suite/rpl/r/rpl_partition_myisam.result index c760befed89..8d6cd8e3b77 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_partition_myisam.result @@ -62,9 +62,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( @@ -106,9 +106,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = MyISAM, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result index 37548cad4db..f2774d2fc62 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result @@ -28,13 +28,13 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(t)) + PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -49,13 +49,13 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(t)) + PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -116,13 +116,13 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(t)) + PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -137,13 +137,13 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (YEAR(t)) + PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, - PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ + PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -213,10 +213,10 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (id) + PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, - PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (412) ENGINE = MyISAM) connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -231,10 +231,10 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (id) + PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, - PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (412) ENGINE = MyISAM) connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -295,10 +295,10 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (id) + PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, - PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (412) ENGINE = MyISAM) connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -313,10 +313,10 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (id) + PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, - PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ + PARTITION p2 VALUES IN (412) ENGINE = MyISAM) connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -384,8 +384,8 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH ( YEAR(t)) -PARTITIONS 4 */ + PARTITION BY HASH ( YEAR(t)) +PARTITIONS 4 connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -400,8 +400,8 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH ( YEAR(t)) -PARTITIONS 4 */ + PARTITION BY HASH ( YEAR(t)) +PARTITIONS 4 connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -461,8 +461,8 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH ( YEAR(t)) -PARTITIONS 4 */ + PARTITION BY HASH ( YEAR(t)) +PARTITIONS 4 connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -477,8 +477,8 @@ t1 CREATE TABLE `t1` ( `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH ( YEAR(t)) -PARTITIONS 4 */ + PARTITION BY HASH ( YEAR(t)) +PARTITIONS 4 connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -547,8 +547,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -564,8 +564,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -627,8 +627,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`,`total`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -644,8 +644,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`,`total`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- @@ -707,8 +707,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`,`total`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection slave; SHOW CREATE TABLE t1; Table Create Table @@ -724,8 +724,8 @@ t1 CREATE TABLE `t1` ( `t` date DEFAULT NULL, PRIMARY KEY (`id`,`total`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY () -PARTITIONS 4 */ + PARTITION BY KEY () +PARTITIONS 4 connection master; "--- Insert into t1 --" as ""; --- Select from t1 on master --- diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.result b/mysql-test/suite/storage_engine/parts/truncate_table.result index e3b18d57989..fc409b805e2 100644 --- a/mysql-test/suite/storage_engine/parts/truncate_table.result +++ b/mysql-test/suite/storage_engine/parts/truncate_table.result @@ -14,8 +14,8 @@ t1 CREATE TABLE `t1` ( `c` char(8) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); SHOW CREATE TABLE t1; Table Create Table @@ -24,8 +24,8 @@ t1 CREATE TABLE `t1` ( `c` char(8) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE= AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 TRUNCATE TABLE t1; SHOW CREATE TABLE t1; Table Create Table @@ -34,8 +34,8 @@ t1 CREATE TABLE `t1` ( `c` char(8) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 INSERT INTO t1 (c) VALUES ('d'); SHOW CREATE TABLE t1; Table Create Table @@ -44,8 +44,8 @@ t1 CREATE TABLE `t1` ( `c` char(8) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE= AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 SELECT a,c FROM t1; a c 1 d diff --git a/sql/item.h b/sql/item.h index 7eff4faed26..f5b64be1672 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1522,15 +1522,6 @@ public: (*traverser)(this, arg); } - /* - This is used to get the most recent version of any function in - an item tree. The version is the version where a MySQL function - was introduced in. So any function which is added should use - this function and set the int_arg to maximum of the input data - and their own version info. - */ - virtual bool intro_version(void *int_arg) { return 0; } - virtual bool remove_dependence_processor(void * arg) { return 0; } virtual bool cleanup_processor(void *arg); virtual bool collect_item_field_processor(void * arg) { return 0; } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 1e905c44fdf..07b4ef92b2e 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -115,15 +115,6 @@ public: longlong val_int_endpoint(bool left_endp, bool *incl_endp); bool check_partition_func_processor(void *bool_arg) { return FALSE;} - bool intro_version(void *int_arg) - { - int *input_version= (int*)int_arg; - /* This function was introduced in 5.5 */ - int output_version= MY_MAX(*input_version, 50500); - *input_version= output_version; - return 0; - } - /* Only meaningful with date part and optional time part */ bool check_valid_arguments_processor(void *int_arg) { diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 6eac6dba68b..08afcb602a0 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -560,42 +560,6 @@ char *partition_info::create_default_partition_names(THD *thd, uint part_no, } -/* - Generate a version string for partition expression - This function must be updated every time there is a possibility for - a new function of a higher version number than 5.5.0. - - SYNOPSIS - set_show_version_string() - RETURN VALUES - None -*/ -void partition_info::set_show_version_string(String *packet) -{ - int version= 0; - if (column_list) - packet->append(STRING_WITH_LEN("\n/*!50500")); - else - { - if (part_expr) - part_expr->walk(&Item::intro_version, 0, &version); - if (subpart_expr) - subpart_expr->walk(&Item::intro_version, 0, &version); - if (version == 0) - { - /* No new functions in partition function */ - packet->append(STRING_WITH_LEN("\n/*!50100")); - } - else - { - char buf[65]; - char *buf_ptr= longlong10_to_str((longlong)version, buf, 10); - packet->append(STRING_WITH_LEN("\n/*!")); - packet->append(buf, (size_t)(buf_ptr - buf)); - } - } -} - /* Create a unique name for the subpartition as part_name'sp''subpart_no' diff --git a/sql/partition_info.h b/sql/partition_info.h index 99a71fea798..88193c44158 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -344,7 +344,6 @@ public: bool check_partition_field_length(); bool init_column_part(THD *thd); bool add_column_list_value(THD *thd, Item *item); - void set_show_version_string(String *packet); partition_element *get_part_elem(const char *partition_name, char *file_name, uint32 *part_id); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index da24eb2a5c3..31ab0073866 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2232,7 +2232,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, uint part_syntax_len; char *part_syntax; String comment_start; - table->part_info->set_show_version_string(&comment_start); + comment_start.append(STRING_WITH_LEN("\n")); if ((part_syntax= generate_partition_syntax(thd, table->part_info, &part_syntax_len, FALSE, @@ -2241,8 +2241,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, comment_start.c_ptr()))) { packet->append(comment_start); - if (packet->append(part_syntax, part_syntax_len) || - packet->append(STRING_WITH_LEN(" */"))) + if (packet->append(part_syntax, part_syntax_len)) error= 1; my_free(part_syntax); } diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result index ea1e63e39d0..0252fd905d8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result @@ -16,11 +16,11 @@ logs CREATE TABLE `logs` ( `timestamp` datetime DEFAULT NULL, `message` text ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -/*!50100 PARTITION BY RANGE (TO_DAYS(timestamp)) + PARTITION BY RANGE (TO_DAYS(timestamp)) (PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga, PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga, PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga, - PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) */ + PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start'); INSERT INTO logs VALUES('2015-01-31 23:59:59', 'Shutdown'); INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result index 8d8208f81a9..754c4f98402 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result @@ -16,11 +16,11 @@ logs CREATE TABLE `logs` ( `timestamp` datetime DEFAULT NULL, `message` text ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -/*!50100 PARTITION BY RANGE (TO_DAYS(timestamp)) +PARTITION BY RANGE (TO_DAYS(timestamp)) (PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga, PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga, PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga, - PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) */ + PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start'); INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start'); INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start'); diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff index 01bf3702a3f..22e3447e00a 100644 --- a/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff @@ -27,8 +27,8 @@ - `c` char(8) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE= DEFAULT CHARSET=latin1 --/*!50100 PARTITION BY HASH (a) --PARTITIONS 2 */ +- PARTITION BY HASH (a) +-PARTITIONS 2 -INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); -SHOW CREATE TABLE t1; -Table Create Table @@ -37,8 +37,8 @@ - `c` char(8) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE= AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 --/*!50100 PARTITION BY HASH (a) --PARTITIONS 2 */ +- PARTITION BY HASH (a) +-PARTITIONS 2 -TRUNCATE TABLE t1; -SHOW CREATE TABLE t1; -Table Create Table @@ -47,8 +47,8 @@ - `c` char(8) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE= DEFAULT CHARSET=latin1 --/*!50100 PARTITION BY HASH (a) --PARTITIONS 2 */ +- PARTITION BY HASH (a) +-PARTITIONS 2 -INSERT INTO t1 (c) VALUES ('d'); -SHOW CREATE TABLE t1; -Table Create Table @@ -57,8 +57,8 @@ - `c` char(8) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE= AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 --/*!50100 PARTITION BY HASH (a) --PARTITIONS 2 */ +- PARTITION BY HASH (a) +-PARTITIONS 2 -SELECT a,c FROM t1; -a c -1 d diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result index db89e478b90..e27a42a0af5 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result @@ -662,8 +662,8 @@ t16 CREATE TABLE `t16` ( `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** Show table on Slave **** connection slave; SHOW CREATE TABLE t16; @@ -678,8 +678,8 @@ t16 CREATE TABLE `t16` ( `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (c1) +PARTITIONS 4 *** DROP TABLE t16 *** connection master; DROP TABLE t16; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result index 37cacd8101f..d8344e088e2 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result @@ -62,9 +62,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( @@ -106,9 +106,9 @@ byrange_tbl CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) (PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result index e5a196f894b..57e69bbb007 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result @@ -115,7 +115,7 @@ Create Table CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) + PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = TokuDB, @@ -128,7 +128,7 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (80) ENGINE = TokuDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = TokuDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT count(*) "Slave norm" FROM test.regular_tbl; Slave norm 500 SELECT count(*) "Slave bykey" FROM test.bykey_tbl; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result index 6df54cac05a..61dba48febc 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result @@ -23,8 +23,8 @@ t CREATE TABLE `t` ( `y` int(11) NOT NULL, PRIMARY KEY (`x`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (x) -PARTITIONS 2 */ + PARTITION BY HASH (x) +PARTITIONS 2 ALTER TABLE t ADD CLUSTERING KEY(y); SHOW CREATE TABLE t; Table Create Table @@ -34,8 +34,8 @@ t CREATE TABLE `t` ( PRIMARY KEY (`x`), CLUSTERING KEY `y` (`y`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (x) -PARTITIONS 2 */ + PARTITION BY HASH (x) +PARTITIONS 2 DROP TABLE t; CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/ai_part.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/ai_part.result index 6bfe78bbef8..714b0d861c0 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/ai_part.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/ai_part.result @@ -10,8 +10,8 @@ foo CREATE TABLE `foo` ( `b` int(11) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 ALTER TABLE foo ADD KEY(b); SHOW CREATE TABLE foo; Table Create Table @@ -21,6 +21,6 @@ foo CREATE TABLE `foo` ( PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 DROP TABLE foo; diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/frm_discover_partition.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/frm_discover_partition.result index 4e49d3642d2..8087757395d 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/frm_discover_partition.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/frm_discover_partition.result @@ -7,8 +7,8 @@ foo CREATE TABLE `foo` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 CREATE TABLE bar LIKE foo; SHOW CREATE TABLE bar; Table Create Table @@ -16,8 +16,8 @@ bar CREATE TABLE `bar` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 ALTER TABLE foo ADD COLUMN a INT; SHOW CREATE TABLE foo; Table Create Table @@ -26,8 +26,8 @@ foo CREATE TABLE `foo` ( `a` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 FLUSH TABLES; SHOW CREATE TABLE foo; Table Create Table @@ -36,6 +36,6 @@ foo CREATE TABLE `foo` ( `a` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (id) -PARTITIONS 2 */ + PARTITION BY HASH (id) +PARTITIONS 2 DROP TABLE foo, bar; diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_part.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_part.result index 1c7ee865451..f8562bfc25c 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_part.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_part.result @@ -9,8 +9,8 @@ foo CREATE TABLE `foo` ( `b` int(11) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 ALTER TABLE foo ADD COLUMN c INT; SHOW CREATE TABLE foo; Table Create Table @@ -20,6 +20,6 @@ foo CREATE TABLE `foo` ( `c` int(11) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 2 */ + PARTITION BY HASH (a) +PARTITIONS 2 DROP TABLE foo; diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result index e8129e75f3e..1aa7b778aae 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result @@ -77,7 +77,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -95,7 +95,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ + PARTITION BY HASH (DAYOFYEAR(f_date)) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -111,7 +111,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) */ + PARTITION BY HASH (YEAR(f_date)) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -133,10 +133,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, - PARTITION part7 ENGINE = TokuDB) */ + PARTITION part7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -156,11 +156,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -177,7 +177,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, @@ -185,7 +185,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = TokuDB, PARTITION p5 ENGINE = TokuDB, PARTITION p6 ENGINE = TokuDB, - PARTITION p7 ENGINE = TokuDB) */ + PARTITION p7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -214,14 +214,14 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, PARTITION p4 ENGINE = TokuDB, PARTITION p5 ENGINE = TokuDB, - PARTITION p6 ENGINE = TokuDB) */ + PARTITION p6 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -237,13 +237,13 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, PARTITION p4 ENGINE = TokuDB, - PARTITION p5 ENGINE = TokuDB) */ + PARTITION p5 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -259,12 +259,12 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, - PARTITION p4 ENGINE = TokuDB) */ + PARTITION p4 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -280,11 +280,11 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -300,10 +300,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, - PARTITION part7 ENGINE = TokuDB) */ + PARTITION part7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -319,9 +319,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) + PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = TokuDB, - PARTITION part1 ENGINE = TokuDB) */ + PARTITION part1 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -337,8 +337,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (YEAR(f_date)) -(PARTITION p0 ENGINE = TokuDB) */ + PARTITION BY HASH (YEAR(f_date)) +(PARTITION p0 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; @@ -420,7 +420,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) */ + PARTITION BY KEY (f_int1) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -445,10 +445,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, - PARTITION part7 ENGINE = TokuDB) */ + PARTITION part7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -468,11 +468,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -492,7 +492,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, @@ -500,7 +500,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 ENGINE = TokuDB, PARTITION p5 ENGINE = TokuDB, PARTITION p6 ENGINE = TokuDB, - PARTITION p7 ENGINE = TokuDB) */ + PARTITION p7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -527,14 +527,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, PARTITION p4 ENGINE = TokuDB, PARTITION p5 ENGINE = TokuDB, - PARTITION p6 ENGINE = TokuDB) */ + PARTITION p6 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -553,13 +553,13 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, PARTITION p4 ENGINE = TokuDB, - PARTITION p5 ENGINE = TokuDB) */ + PARTITION p5 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -578,12 +578,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, PARTITION part2 ENGINE = TokuDB, - PARTITION p4 ENGINE = TokuDB) */ + PARTITION p4 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -602,11 +602,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, PARTITION part7 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -625,10 +625,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, PARTITION part1 ENGINE = TokuDB, - PARTITION part7 ENGINE = TokuDB) */ + PARTITION part7 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -647,9 +647,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) + PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = TokuDB, - PARTITION part1 ENGINE = TokuDB) */ + PARTITION part1 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; @@ -668,8 +668,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (f_int1) -(PARTITION p0 ENGINE = TokuDB) */ + PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = TokuDB) t1.frm t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result index 242ed55ac68..3207e5fda86 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result @@ -189,8 +189,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -413,8 +413,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 26 @@ -426,8 +426,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 1 @@ -444,8 +444,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 DROP TABLE t1; # Test with two threads connection default; @@ -715,8 +715,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (4); SHOW CREATE TABLE t1; Table Create Table @@ -724,8 +724,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -733,8 +733,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -742,8 +742,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 @@ -758,8 +758,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table @@ -767,8 +767,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -776,8 +776,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 0 @@ -799,8 +799,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -808,8 +808,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1; c1 1 @@ -820,8 +820,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table @@ -829,8 +829,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); @@ -853,8 +853,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table @@ -862,8 +862,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -872,8 +872,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; @@ -882,8 +882,8 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=TokuDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (c1) -PARTITIONS 2 */ + PARTITION BY HASH (c1) +PARTITIONS 2 SELECT * FROM t1 ORDER BY c1; c1 4 diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_bit_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_bit_tokudb.result index 6eec1bce210..cfd8155caf1 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_bit_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_bit_tokudb.result @@ -9,7 +9,7 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ + PARTITION BY KEY (a) drop table t1; create table t1 (a bit(0), primary key (a)) engine='TOKUDB' partition by key (a) ( @@ -21,9 +21,9 @@ t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 ENGINE = TokuDB, - PARTITION pa2 ENGINE = TokuDB) */ + PARTITION pa2 ENGINE = TokuDB) drop table t1; create table t1 (a bit(64), primary key (a)) engine='TOKUDB' partition by key (a) partitions 2; @@ -33,8 +33,8 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 2 */ + PARTITION BY KEY (a) +PARTITIONS 2 insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -61,11 +61,11 @@ t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), @@ -91,8 +91,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 insert into t2 values (b'0'), (b'1'); select hex(a) from t2; hex(a) @@ -104,8 +104,8 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -117,8 +117,8 @@ t2 CREATE TABLE `t2` ( `a` bit(1) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 4 */ + PARTITION BY KEY (a) +PARTITIONS 4 select hex(a) from t2; hex(a) 0 @@ -136,13 +136,13 @@ t3 CREATE TABLE `t3` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = TokuDB, PARTITION pa2 VALUES LESS THAN (16) ENGINE = TokuDB, PARTITION pa3 VALUES LESS THAN (64) ENGINE = TokuDB, - PARTITION pa4 VALUES LESS THAN (256) ENGINE = TokuDB) */ + PARTITION pa4 VALUES LESS THAN (256) ENGINE = TokuDB) 255 inserts; select hex(a) from t3 where a=b'01010101'; hex(a) @@ -419,12 +419,12 @@ t4 CREATE TABLE `t4` ( `a` bit(8) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = TokuDB, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = TokuDB, - PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = TokuDB) */ + PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = TokuDB) 32 inserts; select hex(a) from t4 where a=b'00000001'; hex(a) diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_char_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_char_tokudb.result index 178174872b5b4677ced96101368b1f0a397026ef..0d206906df3ee5378d9e1b2777bb6a2d0a3bbd89 100644 GIT binary patch delta 243 zcmaFX!ThM5dBY~g&4H^K87E)dEHPQCg?sWOA*;#pExn5q+88${bXqck7?XMXQzpBz zznfe*L6OPGd~+fP6DNwU&69)-grKsM6FDq5YpNbMg{#;s)e^-$IWPSqLdCSr1#uxv zKyw{8Pslc8+Waz?R}@*jKMzo?GSDbYg-ODjLsx!*yIN{<{+h2$FqchQZ_ErfXY<9) RDaKR WYAD$3gOGx0nB1^kYV*%+FL?k0XkS$T diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result index 8cec39930fc..a3517e91b0c 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -40,8 +40,8 @@ t2 CREATE TABLE `t2` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -137,11 +137,11 @@ t1 CREATE TABLE `t1` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -167,8 +167,8 @@ t2 CREATE TABLE `t2` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t2; a @@ -291,13 +291,13 @@ t3 CREATE TABLE `t3` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = TokuDB) 12 inserts; select count(*) from t3; count(*) @@ -331,13 +331,13 @@ t4 CREATE TABLE `t4` ( `a` date NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = TokuDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = TokuDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = TokuDB, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = TokuDB) 12 inserts; select count(*) from t4; count(*) @@ -369,11 +369,11 @@ t1 CREATE TABLE `t1` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -399,8 +399,8 @@ t2 CREATE TABLE `t2` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16'); select * from t2; a @@ -498,13 +498,13 @@ t3 CREATE TABLE `t3` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (second(a)) + PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = TokuDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = TokuDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = TokuDB, - PARTITION quarter4 VALUES LESS THAN (61) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES LESS THAN (61) ENGINE = TokuDB) 59 inserts; select count(*) from t3; count(*) @@ -585,13 +585,13 @@ t4 CREATE TABLE `t4` ( `a` time NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (second(a)) + PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = TokuDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = TokuDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = TokuDB, - PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = TokuDB) 59 inserts; select count(*) from t4; count(*) @@ -670,11 +670,11 @@ t1 CREATE TABLE `t1` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -700,8 +700,8 @@ t2 CREATE TABLE `t2` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16'); select * from t2; a @@ -799,13 +799,13 @@ t3 CREATE TABLE `t3` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (month(a)) + PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION quarter4 VALUES LESS THAN (13) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES LESS THAN (13) ENGINE = TokuDB) 12 inserts; select count(*) from t3; count(*) @@ -839,13 +839,13 @@ t4 CREATE TABLE `t4` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (month(a)) + PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = TokuDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = TokuDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = TokuDB, - PARTITION quarter4 VALUES IN (10,11,12) ENGINE = TokuDB) */ + PARTITION quarter4 VALUES IN (10,11,12) ENGINE = TokuDB) 12 inserts; select count(*) from t4; count(*) @@ -877,11 +877,11 @@ t1 CREATE TABLE `t1` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a @@ -907,8 +907,8 @@ t2 CREATE TABLE `t2` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 12 */ + PARTITION BY KEY (a) +PARTITIONS 12 insert into t2 values ('1975'), ('2020'), ('1980'), ('2000'); select * from t2; a diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result index beb499dd45a..98eba1276c8 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result @@ -56,8 +56,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0 -/*!50100 PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) t1.frm t1.par SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; @@ -90,9 +90,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM t1; a 1 diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_decimal_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_decimal_tokudb.result index 20d2ad2e293..7ec843191e9 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_decimal_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_decimal_tokudb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` decimal(10,4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a @@ -54,8 +54,8 @@ t2 CREATE TABLE `t2` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567); select * from t2; a @@ -100,14 +100,14 @@ t3 CREATE TABLE `t3` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (floor(a)) + PARTITION BY RANGE (floor(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = TokuDB, PARTITION pa4 VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION pa6 VALUES LESS THAN (6) ENGINE = TokuDB, PARTITION pa8 VALUES LESS THAN (8) ENGINE = TokuDB, - PARTITION pa10 VALUES LESS THAN (10) ENGINE = TokuDB) */ + PARTITION pa10 VALUES LESS THAN (10) ENGINE = TokuDB) 9*3 inserts; select count(*) from t3; count(*) @@ -127,14 +127,14 @@ t4 CREATE TABLE `t4` ( `a` decimal(18,9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (ceiling(a)) + PARTITION BY LIST (ceiling(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = TokuDB, PARTITION pa4 VALUES IN (3,4) ENGINE = TokuDB, PARTITION pa6 VALUES IN (5,6) ENGINE = TokuDB, PARTITION pa8 VALUES IN (7,8) ENGINE = TokuDB, - PARTITION pa10 VALUES IN (9,10) ENGINE = TokuDB) */ + PARTITION pa10 VALUES IN (9,10) ENGINE = TokuDB) 9*3 inserts; select count(*) from t4; count(*) diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result index 8837049119a..c14e895f8f2 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result @@ -68,8 +68,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -525,9 +525,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -984,14 +984,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1509,14 +1509,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2010,14 +2010,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2472,14 +2472,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2934,9 +2934,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3393,14 +3393,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3858,14 +3858,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4316,8 +4316,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -(PARTITION part1 ENGINE = TokuDB) */ + PARTITION BY HASH (f_int1) +(PARTITION part1 ENGINE = TokuDB) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4770,11 +4770,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = TokuDB, - SUBPARTITION subpart12 ENGINE = TokuDB)) */ + SUBPARTITION subpart12 ENGINE = TokuDB)) # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_1_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_1_tokudb.result index 78005c5abb0..da13bf5bc5b 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_1_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_1_tokudb.result @@ -128,10 +128,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`) USING BTREE ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION p1 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = TokuDB) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = TokuDB) ALTER TABLE tp DROP INDEX a; ALTER TABLE t_10 DROP INDEX a; ALTER TABLE tp ADD UNIQUE INDEX USING BTREE (a,b); @@ -153,10 +153,10 @@ tp CREATE TABLE `tp` ( PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`,`b`) USING BTREE ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION p1 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p2 VALUES LESS THAN (1000) ENGINE = TokuDB) */ + PARTITION p2 VALUES LESS THAN (1000) ENGINE = TokuDB) DROP TABLE IF EXISTS t_10; DROP TABLE IF EXISTS t_100; DROP TABLE IF EXISTS t_1000; diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result index 7e48fcc5386..11c75321b4b 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result @@ -13,8 +13,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -86,8 +86,8 @@ tp CREATE TABLE `tp` ( `b` varchar(24) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) -PARTITIONS 4 */ + PARTITION BY HASH (a) +PARTITIONS 4 SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( @@ -194,9 +194,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SET DEBUG_SYNC= 'now SIGNAL goto_verification'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # select from t and select/update/delete/insert from tp should work @@ -237,9 +237,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SET DEBUG_SYNC= 'now SIGNAL goto_wait'; SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress'; # Both tables should now be under exclusive lock, even SHOW should fail @@ -312,9 +312,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM tp WHERE a = 99; a b 99 End of values @@ -346,9 +346,9 @@ tp CREATE TABLE `tp` ( `b` varchar(55) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM t; a b 10 Ten diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_float_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_float_tokudb.result index e24be66ba86..4f75249a21c 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_float_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_float_tokudb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` float NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); select * from t2; a @@ -100,11 +100,11 @@ t1 CREATE TABLE `t1` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a @@ -138,8 +138,8 @@ t2 CREATE TABLE `t2` ( `a` double NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 10 */ + PARTITION BY KEY (a) +PARTITIONS 10 insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t2; a diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_int_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_int_tokudb.result index 2c3e7f6e093..581b5a72a0e 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_int_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_int_tokudb.result @@ -10,11 +10,11 @@ t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -46,8 +46,8 @@ t2 CREATE TABLE `t2` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (255), (254), (253), (252); select * from t2; a @@ -78,8 +78,8 @@ t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a @@ -119,11 +119,11 @@ t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -155,8 +155,8 @@ t2 CREATE TABLE `t2` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (65535), (65534), (65533), (65532); select * from t2; a @@ -187,8 +187,8 @@ t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a @@ -228,11 +228,11 @@ t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -264,8 +264,8 @@ t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -296,8 +296,8 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a @@ -337,11 +337,11 @@ t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -373,8 +373,8 @@ t2 CREATE TABLE `t2` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (16777215), (16777214), (16777213), (16777212); select * from t2; a @@ -405,8 +405,8 @@ t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a @@ -446,11 +446,11 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a @@ -494,8 +494,8 @@ t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 8 */ + PARTITION BY KEY (a) +PARTITIONS 8 insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -526,8 +526,8 @@ t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) -PARTITIONS 7 */ + PARTITION BY KEY (a) +PARTITIONS 7 insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc0_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc0_tokudb.result index 1442a99bbbb..7ee2018a661 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc0_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc0_tokudb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -271,11 +271,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, - PARTITION PartD ENGINE = TokuDB) */ + PARTITION PartD ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -364,14 +364,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -392,10 +392,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -428,10 +428,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -507,11 +507,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, - PARTITION PartD ENGINE = TokuDB) */ + PARTITION PartD ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -589,14 +589,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, PARTITION partE VALUES LESS THAN (16) ENGINE = TokuDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = TokuDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -620,12 +620,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -658,11 +658,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = TokuDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -738,11 +738,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -820,14 +820,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, PARTITION partE VALUES IN (16) ENGINE = TokuDB, PARTITION Partf VALUES IN (19) ENGINE = TokuDB, - PARTITION PartG VALUES IN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES IN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -851,12 +851,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -889,12 +889,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = TokuDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = TokuDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -961,11 +961,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, - PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -1004,10 +1004,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = TokuDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = TokuDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc10_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc10_tokudb.result index 84d350fcdfa..28aa690fea4 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc10_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc10_tokudb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of EXCHANGE PARTITION WITH TABLE # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY @@ -121,10 +121,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -200,11 +200,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, - PARTITION PartD ENGINE = TokuDB) */ + PARTITION PartD ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -293,14 +293,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -321,10 +321,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -357,10 +357,10 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -436,11 +436,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, - PARTITION PartD ENGINE = TokuDB) */ + PARTITION PartD ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -518,14 +518,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, PARTITION partE VALUES LESS THAN (16) ENGINE = TokuDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = TokuDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -549,12 +549,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -587,11 +587,11 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = TokuDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -667,11 +667,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB) */ + PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -749,14 +749,14 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, PARTITION partE VALUES IN (16) ENGINE = TokuDB, PARTITION Partf VALUES IN (19) ENGINE = TokuDB, - PARTITION PartG VALUES IN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES IN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -780,12 +780,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -818,12 +818,12 @@ Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = TokuDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = TokuDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -890,11 +890,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, - PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB) */ + PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB) DROP TABLE tablea; # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; @@ -933,10 +933,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = TokuDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = TokuDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc1_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc1_tokudb.result index 0a882a532e5..63ecc04b812 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc1_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_mgm_lc1_tokudb.result @@ -56,14 +56,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -84,10 +84,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of EXCHANGE PARTITION WITH TABLE SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME TABLE_ROWS @@ -112,10 +112,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) SELECT * FROM TableB; a 10 @@ -156,10 +156,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -192,10 +192,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -264,10 +264,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) + PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -355,14 +355,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, PARTITION Partc ENGINE = TokuDB, PARTITION PartD ENGINE = TokuDB, PARTITION partE ENGINE = TokuDB, PARTITION Partf ENGINE = TokuDB, - PARTITION PartG ENGINE = TokuDB) */ + PARTITION PartG ENGINE = TokuDB) ALTER TABLE TableA COALESCE PARTITION 4; SELECT * FROM TableA; a @@ -383,10 +383,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION parta ENGINE = TokuDB, PARTITION partB ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Should not work on HASH/KEY ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO @@ -419,10 +419,10 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -491,10 +491,10 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (a) + PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = TokuDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = TokuDB, - PARTITION Partc ENGINE = TokuDB) */ + PARTITION Partc ENGINE = TokuDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -571,14 +571,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, PARTITION partE VALUES LESS THAN (16) ENGINE = TokuDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = TokuDB, - PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES LESS THAN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -602,12 +602,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (7) ENGINE = TokuDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = TokuDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = TokuDB, - PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS # Error since it must reorganize a consecutive range ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO @@ -640,11 +640,11 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = TokuDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -713,11 +713,11 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = TokuDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = TokuDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = TokuDB, - PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) */ + PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = TokuDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -794,14 +794,14 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, PARTITION partE VALUES IN (16) ENGINE = TokuDB, PARTITION Partf VALUES IN (19) ENGINE = TokuDB, - PARTITION PartG VALUES IN (22) ENGINE = TokuDB) */ + PARTITION PartG VALUES IN (22) ENGINE = TokuDB) ALTER TABLE TableA DROP PARTITION partE, PartG; ALTER TABLE TableA DROP PARTITION Partf; ALTER TABLE TableA ADD PARTITION @@ -825,12 +825,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = TokuDB, PARTITION partB VALUES IN (2,10,11) ENGINE = TokuDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of REORGANIZE PARTITIONS ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO (PARTITION Partc VALUES IN (1,7) @@ -863,12 +863,12 @@ Table Create Table TableA CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = TokuDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = TokuDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of RENAME TABLE RENAME TABLE TableA to TableB; SELECT * FROM TableB; @@ -928,12 +928,12 @@ Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (a) + PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = TokuDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = TokuDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = TokuDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = TokuDB, - PARTITION PartE VALUES IN (13) ENGINE = TokuDB) */ + PARTITION PartE VALUES IN (13) ENGINE = TokuDB) # Test of REMOVE PARTITIONING ALTER TABLE TableA REMOVE PARTITIONING; SELECT * FROM TableA; @@ -971,10 +971,10 @@ t1 CREATE TABLE `t1` ( `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=TokuDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) + PARTITION BY RANGE (a) (PARTITION LT1000 VALUES LESS THAN (1000) ENGINE = TokuDB, PARTITION LT2000 VALUES LESS THAN (2000) ENGINE = TokuDB, - PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION MAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT * FROM t1 ORDER BY a; a b 1 First diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result index 2ebcef1f005..79274aa903b 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result @@ -13,11 +13,11 @@ t1 CREATE TABLE `t1` ( `d` enum('m','w') NOT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d) + PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -55,11 +55,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -105,11 +105,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) + PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -185,11 +185,11 @@ t1 CREATE TABLE `t1` ( `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) + PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = TokuDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = TokuDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = TokuDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) */ + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = TokuDB) insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result index 13b8a133628..1b5d2870cda 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result @@ -658,9 +658,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = TokuDB, - PARTITION part3 VALUES IN (1) ENGINE = TokuDB) */ + PARTITION part3 VALUES IN (1) ENGINE = TokuDB) DROP TABLE t1; # 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0) @@ -685,10 +685,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST (MOD(f_int1,2)) + PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = TokuDB, PARTITION part2 VALUES IN (0) ENGINE = TokuDB, - PARTITION part3 VALUES IN (1) ENGINE = TokuDB) */ + PARTITION part3 VALUES IN (1) ENGINE = TokuDB) DROP TABLE t1; @@ -719,7 +719,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) */ + PARTITION BY HASH (f_int1) DROP TABLE t1; # 4.1.2 no partition number, named partitions @@ -741,9 +741,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) DROP TABLE t1; # 4.1.3 variations on no partition/subpartition number, named partitions, @@ -826,7 +826,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = TokuDB, @@ -836,7 +836,7 @@ SUBPARTITION BY HASH (f_int1) SUBPARTITION subpart22 ENGINE = TokuDB), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = TokuDB, - SUBPARTITION subpart32 ENGINE = TokuDB)) */ + SUBPARTITION subpart32 ENGINE = TokuDB)) DROP TABLE t1; #------------------------------------------------------------------------ @@ -862,8 +862,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 2 */ + PARTITION BY HASH (f_int1) +PARTITIONS 2 DROP TABLE t1; CREATE TABLE t1 ( @@ -887,11 +887,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = TokuDB) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = TokuDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -912,8 +912,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) -PARTITIONS 1 */ + PARTITION BY HASH (f_int1) +PARTITIONS 1 DROP TABLE t1; CREATE TABLE t1 ( @@ -937,11 +937,11 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = TokuDB) */ + PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = TokuDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -1681,9 +1681,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (f_int1) + PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = TokuDB, - PARTITION part2 ENGINE = TokuDB) */ + PARTITION part2 ENGINE = TokuDB) DROP TABLE t1; CREATE TABLE t1 ( @@ -1710,14 +1710,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (f_int1) + PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = TokuDB, SUBPARTITION subpart12 ENGINE = TokuDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = TokuDB, - SUBPARTITION subpart22 ENGINE = TokuDB)) */ + SUBPARTITION subpart22 ENGINE = TokuDB)) DROP TABLE t1; # 4.3.2 (positive) number of partition/subpartition , From 0ed291e61cd43ca7dcd6147f2f2d7a45f1dbeb14 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 28 Nov 2016 11:27:47 +0100 Subject: [PATCH 035/135] cleanup: parser: s/USER/USER_SYM/ --- sql/lex.h | 6 +++--- sql/sql_yacc.yy | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sql/lex.h b/sql/lex.h index 114bafeee18..c40aa8f546d 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -646,7 +646,7 @@ static SYMBOL symbols[] = { { "UPGRADE", SYM(UPGRADE_SYM)}, { "USAGE", SYM(USAGE)}, { "USE", SYM(USE_SYM)}, - { "USER", SYM(USER)}, + { "USER", SYM(USER_SYM)}, { "USER_RESOURCES", SYM(RESOURCES)}, { "USE_FRM", SYM(USE_FRM)}, { "USING", SYM(USING)}, @@ -714,7 +714,7 @@ static SYMBOL sql_functions[] = { { "PERCENT_RANK", SYM(PERCENT_RANK_SYM)}, { "RANK", SYM(RANK_SYM)}, { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)}, - { "SESSION_USER", SYM(USER)}, + { "SESSION_USER", SYM(USER_SYM)}, { "STD", SYM(STD_SYM)}, { "STDDEV", SYM(STD_SYM)}, { "STDDEV_POP", SYM(STD_SYM)}, @@ -724,7 +724,7 @@ static SYMBOL sql_functions[] = { { "SUBSTRING", SYM(SUBSTRING)}, { "SUM", SYM(SUM_SYM)}, { "SYSDATE", SYM(SYSDATE)}, - { "SYSTEM_USER", SYM(USER)}, + { "SYSTEM_USER", SYM(USER_SYM)}, { "TRIM", SYM(TRIM)}, { "VARIANCE", SYM(VARIANCE_SYM)}, { "VAR_POP", SYM(VARIANCE_SYM)}, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 77cd06a465a..766caeaccb7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1683,7 +1683,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token UPDATE_SYM /* SQL-2003-R */ %token UPGRADE_SYM %token USAGE /* SQL-2003-N */ -%token USER /* SQL-2003-R */ +%token USER_SYM /* SQL-2003-R */ %token USE_FRM %token USE_SYM %token USING /* SQL-2003-R */ @@ -2632,7 +2632,7 @@ create: Lex->create_view_suid= TRUE; } view_or_trigger_or_sp_or_event { } - | create_or_replace USER opt_if_not_exists clear_privileges grant_list + | create_or_replace USER_SYM opt_if_not_exists clear_privileges grant_list opt_require_clause opt_resource_options { if (Lex->set_command_with_check(SQLCOM_CREATE_USER, $1 | $3)) @@ -2675,7 +2675,7 @@ server_options_list: ; server_option: - USER TEXT_STRING_sys + USER_SYM TEXT_STRING_sys { MYSQL_YYABORT_UNLESS(Lex->server_options.username.str == 0); Lex->server_options.username= $2; @@ -7289,7 +7289,7 @@ alter: lex->server_options.reset($3); } OPTIONS_SYM '(' server_options_list ')' { } /* ALTER USER foo is allowed for MySQL compatibility. */ - | ALTER opt_if_exists USER clear_privileges grant_list + | ALTER opt_if_exists USER_SYM clear_privileges grant_list opt_require_clause opt_resource_options { Lex->create_info.set($2); @@ -8242,7 +8242,7 @@ rename: } table_to_table_list {} - | RENAME USER clear_privileges rename_list + | RENAME USER_SYM clear_privileges rename_list { Lex->sql_command = SQLCOM_RENAME_USER; } @@ -9654,7 +9654,7 @@ function_call_keyword: if ($$ == NULL) MYSQL_YYABORT; } - | USER '(' ')' + | USER_SYM '(' ')' { $$= new (thd->mem_root) Item_func_user(thd); if ($$ == NULL) @@ -12189,7 +12189,7 @@ drop: lex->set_command(SQLCOM_DROP_PROCEDURE, $3); lex->spname= $4; } - | DROP USER opt_if_exists clear_privileges user_list + | DROP USER_SYM opt_if_exists clear_privileges user_list { Lex->set_command(SQLCOM_DROP_USER, $3); } @@ -13039,14 +13039,14 @@ show_param: lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER; lex->spname= $3; } - | CREATE USER + | CREATE USER_SYM { Lex->sql_command= SQLCOM_SHOW_CREATE_USER; if (!(Lex->grant_user= (LEX_USER*)thd->alloc(sizeof(LEX_USER)))) MYSQL_YYABORT; Lex->grant_user->user= current_user; } - | CREATE USER user + | CREATE USER_SYM user { Lex->sql_command= SQLCOM_SHOW_CREATE_USER; Lex->grant_user= $3; @@ -13492,7 +13492,7 @@ kill_expr: { Lex->value_list.push_front($$, thd->mem_root); } - | USER user + | USER_SYM user { Lex->users_list.push_back($2, thd->mem_root); Lex->kill_type= KILL_TYPE_USER; @@ -14912,7 +14912,7 @@ keyword_sp: | UNDOFILE_SYM {} | UNKNOWN_SYM {} | UNTIL_SYM {} - | USER {} + | USER_SYM {} | USE_FRM {} | VARIABLES {} | VIEW_SYM {} @@ -15817,7 +15817,7 @@ object_privilege: | SHOW VIEW_SYM { Lex->grant |= SHOW_VIEW_ACL; } | CREATE ROUTINE_SYM { Lex->grant |= CREATE_PROC_ACL; } | ALTER ROUTINE_SYM { Lex->grant |= ALTER_PROC_ACL; } - | CREATE USER { Lex->grant |= CREATE_USER_ACL; } + | CREATE USER_SYM { Lex->grant |= CREATE_USER_ACL; } | EVENT_SYM { Lex->grant |= EVENT_ACL;} | TRIGGER_SYM { Lex->grant |= TRIGGER_ACL; } | CREATE TABLESPACE { Lex->grant |= CREATE_TABLESPACE_ACL; } From 5b716bc2e0cec40780f6276e2f577f5eedf058e3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 25 Nov 2015 08:02:52 +0100 Subject: [PATCH 036/135] cleanup: reorder TABLE members --- sql/sql_insert.cc | 2 +- sql/sql_load.cc | 2 +- sql/table.cc | 2 +- sql/table.h | 31 ++++++++++++++++--------------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8555ccd4806..88787acea18 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1518,7 +1518,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, if (!table) table= table_list->table; - if (table->s->virtual_stored_fields) + if (table->s->has_virtual_stored_fields) thd->lex->unit.insert_table_with_stored_vcol= table; if (!select_insert) diff --git a/sql/sql_load.cc b/sql/sql_load.cc index b1167534491..6bfe01ef6df 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -410,7 +410,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->prepare_triggers_for_insert_stmt_or_event(); table->mark_columns_needed_for_insert(); - if (table->s->virtual_stored_fields) + if (table->s->has_virtual_stored_fields) thd->lex->unit.insert_table_with_stored_vcol= table; uint tot_length=0; diff --git a/sql/table.cc b/sql/table.cc index 3bc1fee273b..d4d5d02e939 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2233,7 +2233,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, DBUG_ASSERT(!reg_field->vcol_info); reg_field->vcol_info= vcol_info; share->virtual_fields++; - share->virtual_stored_fields= true; // For insert/load data + share->has_virtual_stored_fields=true; // For insert/load data break; case 2: // Default expression vcol_info->stored_in_db= 1; diff --git a/sql/table.h b/sql/table.h index bc30b00ac45..cf73a1ca12c 100644 --- a/sql/table.h +++ b/sql/table.h @@ -644,17 +644,22 @@ struct TABLE_SHARE the record then this value is 0. */ uint null_bytes_for_compare; - uint fields; /* Number of fields */ - /* Number of stored fields, generated-only virtual fields are not included */ - uint stored_fields; + uint fields; /* number of fields */ + uint stored_fields; /* number of stored fields, purely virtual not included */ + uint virtual_fields; /* number of purely virtual fields */ + uint null_fields; /* number of null fields */ + uint blob_fields; /* number of blob fields */ + uint varchar_fields; /* number of varchar fields */ + uint default_fields; /* number of default fields */ + + uint default_expressions; + uint table_check_constraints, field_check_constraints; + uint rec_buff_length; /* Size of table->record[] buffer */ uint keys, key_parts; uint ext_key_parts; /* Total number of key parts in extended keys */ uint max_key_length, max_unique_length, total_key_length; uint uniques; /* Number of UNIQUE index */ - uint null_fields; /* number of null fields */ - uint blob_fields; /* number of blob fields */ - uint varchar_fields; /* number of varchar fields */ uint db_create_options; /* Create options from database */ uint db_options_in_use; /* Options in use */ uint db_record_offset; /* if HA_REC_IN_SEQ */ @@ -668,10 +673,7 @@ struct TABLE_SHARE uint open_errno; /* error from open_table_def() */ uint column_bitmap_size; uchar frm_version; - uint virtual_fields; - uint default_expressions; - uint table_check_constraints, field_check_constraints; - uint default_fields; /* Number of default fields */ + bool use_ext_keys; /* Extended keys can be used */ bool null_field_first; bool system; /* Set if system table (one record) */ @@ -682,7 +684,7 @@ struct TABLE_SHARE bool table_creation_was_logged; bool non_determinstic_insert; bool vcols_need_refixing; - bool virtual_stored_fields; + bool has_virtual_stored_fields; bool check_set_initialized; bool has_update_default_function; ulong table_map_id; /* for row-based replication */ @@ -1029,7 +1031,6 @@ public: uint32 instance; /** Table cache instance this TABLE is belonging to */ THD *in_use; /* Which thread uses this */ - Field **field; /* Pointer to fields */ uchar *record[2]; /* Pointer to records */ uchar *write_row_record; /* Used as optimisation in @@ -1059,11 +1060,11 @@ public: key_map keys_in_use_for_order_by; KEY *key_info; /* data of keys in database */ + Field **field; /* Pointer to fields */ + Field **vfield; /* Pointer to virtual fields*/ + Field **default_field; /* Fields with non-constant DEFAULT */ Field *next_number_field; /* Set if next_number is activated */ Field *found_next_number_field; /* Set on open */ - Field **vfield; /* Pointer to virtual fields*/ - /* Fields that are updated automatically on INSERT or UPDATE. */ - Field **default_field; Virtual_column_info **check_constraints; /* Table's triggers, 0 if there are no of them */ From 9bcfd27b7a5fb01fdc4855fd8e8e4fafc35d9f74 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 28 Nov 2015 18:25:05 +0100 Subject: [PATCH 037/135] cleanup: remove dead (half-merged) code from partition_info.* --- sql/partition_info.cc | 299 ------------------------------------------ sql/partition_info.h | 51 +------ sql/sql_trigger.cc | 29 ---- 3 files changed, 1 insertion(+), 378 deletions(-) diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 08afcb602a0..74c09b8a3c6 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -253,7 +253,6 @@ bool partition_info::set_partition_bitmaps(TABLE_LIST *table_list) DBUG_ASSERT(bitmaps_are_initialized); DBUG_ASSERT(table); - is_pruning_completed= false; if (!bitmaps_are_initialized) DBUG_RETURN(TRUE); @@ -280,239 +279,6 @@ bool partition_info::set_partition_bitmaps(TABLE_LIST *table_list) } -/** - Checks if possible to do prune partitions on insert. - - @param thd Thread context - @param duplic How to handle duplicates - @param update In case of ON DUPLICATE UPDATE, default function fields - @param update_fields In case of ON DUPLICATE UPDATE, which fields to update - @param fields Listed fields - @param empty_values True if values is empty (only defaults) - @param[out] prune_needs_default_values Set on return if copying of default - values is needed - @param[out] can_prune_partitions Enum showing if possible to prune - @param[inout] used_partitions If possible to prune the bitmap - is initialized and cleared - - @return Operation status - @retval false Success - @retval true Failure -*/ - -bool partition_info::can_prune_insert(THD* thd, - enum_duplicates duplic, - COPY_INFO &update, - List &update_fields, - List &fields, - bool empty_values, - enum_can_prune *can_prune_partitions, - bool *prune_needs_default_values, - MY_BITMAP *used_partitions) -{ - uint32 *bitmap_buf; - uint bitmap_bytes; - uint num_partitions= 0; - *can_prune_partitions= PRUNE_NO; - DBUG_ASSERT(bitmaps_are_initialized); - DBUG_ENTER("partition_info::can_prune_insert"); - - if (table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION) - DBUG_RETURN(false); - - /* - If under LOCK TABLES pruning will skip start_stmt instead of external_lock - for unused partitions. - - Cannot prune if there are BEFORE INSERT triggers that changes any - partitioning column, since they may change the row to be in another - partition. - */ - if (is_fields_updated_in_triggers(TRG_EVENT_INSERT, TRG_ACTION_BEFORE)) - DBUG_RETURN(false); - - if (table->found_next_number_field) - { - /* - If the field is used in the partitioning expression, we cannot prune. - TODO: If all rows have not null values and - is not 0 (with NO_AUTO_VALUE_ON_ZERO sql_mode), then pruning is possible! - */ - if (bitmap_is_set(&full_part_field_set, - table->found_next_number_field->field_index)) - DBUG_RETURN(false); - } - - /* - If updating a field in the partitioning expression, we cannot prune. - - Note: TIMESTAMP_AUTO_SET_ON_INSERT is handled by converting Item_null - to the start time of the statement. Which will be the same as in - write_row(). So pruning of TIMESTAMP DEFAULT CURRENT_TIME will work. - But TIMESTAMP_AUTO_SET_ON_UPDATE cannot be pruned if the timestamp - column is a part of any part/subpart expression. - */ - if (duplic == DUP_UPDATE) - { - /* - TODO: add check for static update values, which can be pruned. - */ - if (is_field_in_part_expr(update_fields)) - DBUG_RETURN(false); - - /* - Cannot prune if there are BEFORE UPDATE triggers that changes any - partitioning column, since they may change the row to be in another - partition. - */ - if (is_fields_updated_in_triggers(TRG_EVENT_UPDATE, TRG_ACTION_BEFORE)) - DBUG_RETURN(false); - } - - /* - If not all partitioning fields are given, - we also must set all non given partitioning fields - to get correct defaults. - TODO: If any gain, we could enhance this by only copy the needed default - fields by - 1) check which fields needs to be set. - 2) only copy those fields from the default record. - */ - *prune_needs_default_values= false; - if (fields.elements) - { - if (!is_full_part_expr_in_fields(fields)) - *prune_needs_default_values= true; - } - else if (empty_values) - { - *prune_needs_default_values= true; // like 'INSERT INTO t () VALUES ()' - } - else - { - /* - In case of INSERT INTO t VALUES (...) we must get values for - all fields in table from VALUES (...) part, so no defaults - are needed. - */ - } - - /* Pruning possible, have to initialize the used_partitions bitmap. */ - num_partitions= lock_partitions.n_bits; - bitmap_bytes= bitmap_buffer_size(num_partitions); - if (!(bitmap_buf= (uint32*) thd->alloc(bitmap_bytes))) - { - mem_alloc_error(bitmap_bytes); - DBUG_RETURN(true); - } - /* Also clears all bits. */ - if (my_bitmap_init(used_partitions, bitmap_buf, num_partitions, false)) - { - /* purecov: begin deadcode */ - /* Cannot happen, due to pre-alloc. */ - mem_alloc_error(bitmap_bytes); - DBUG_RETURN(true); - /* purecov: end */ - } - /* - If no partitioning field in set (e.g. defaults) check pruning only once. - */ - if (fields.elements && - !is_field_in_part_expr(fields)) - *can_prune_partitions= PRUNE_DEFAULTS; - else - *can_prune_partitions= PRUNE_YES; - - DBUG_RETURN(false); -} - - -/** - Mark the partition, the record belongs to, as used. - - @param fields Fields to set - @param values Values to use - @param info COPY_INFO used for default values handling - @param copy_default_values True if we should copy default values - @param used_partitions Bitmap to set - - @returns Operational status - @retval false Success - @retval true Failure -*/ - -bool partition_info::set_used_partition(List &fields, - List &values, - COPY_INFO &info, - bool copy_default_values, - MY_BITMAP *used_partitions) -{ - THD *thd= table->in_use; - uint32 part_id; - longlong func_value; - Dummy_error_handler error_handler; - bool ret= true; - DBUG_ENTER("set_partition"); - DBUG_ASSERT(thd); - - /* Only allow checking of constant values */ - List_iterator_fast v(values); - Item *item; - thd->push_internal_handler(&error_handler); - while ((item= v++)) - { - if (!item->const_item()) - goto err; - } - - if (copy_default_values) - restore_record(table,s->default_values); - - if (fields.elements || !values.elements) - { - if (fill_record(thd, table, fields, values, false, !copy_default_values)) - goto err; - } - else - { - /* All fields has a value */ - if (fill_record(thd, table, table->field, values, false, false)) - goto err; - } - DBUG_ASSERT(!table->auto_increment_field_not_null); - - /* - Evaluate DEFAULT functions like CURRENT_TIMESTAMP. - TODO: avoid setting non partitioning fields default value, to avoid - overhead. Not yet done, since mostly only one DEFAULT function per - table, or at least very few such columns. - */ -// if (info.function_defaults_apply_on_columns(&full_part_field_set)) -// info.set_function_defaults(table); - - { - /* - This function is used in INSERT; 'values' are supplied by user, - or are default values, not values read from a table, so read_set is - irrelevant. - */ - my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); - const int rc= get_partition_id(this, &part_id, &func_value); - dbug_tmp_restore_column_map(table->read_set, old_map); - if (rc) - goto err; - } - - DBUG_PRINT("info", ("Insert into partition %u", part_id)); - bitmap_set_bit(used_partitions, part_id); - ret= false; - -err: - thd->pop_internal_handler(); - DBUG_RETURN(ret); -} - - /* Create a memory area where default partition names are stored and fill it up with the names. @@ -2167,71 +1933,6 @@ void partition_info::report_part_expr_error(bool use_subpart_expr) } -/** - Check if fields are in the partitioning expression. - - @param fields List of Items (fields) - - @return True if any field in the fields list is used by a partitioning expr. - @retval true At least one field in the field list is found. - @retval false No field is within any partitioning expression. -*/ - -bool partition_info::is_field_in_part_expr(List &fields) -{ - List_iterator it(fields); - Item *item; - Item_field *field; - DBUG_ENTER("is_fields_in_part_expr"); - while ((item= it++)) - { - field= item->field_for_view_update(); - DBUG_ASSERT(field->field->table == table); - if (bitmap_is_set(&full_part_field_set, field->field->field_index)) - DBUG_RETURN(true); - } - DBUG_RETURN(false); -} - - -/** - Check if all partitioning fields are included. -*/ - -bool partition_info::is_full_part_expr_in_fields(List &fields) -{ - Field **part_field= full_part_field_array; - DBUG_ASSERT(*part_field); - DBUG_ENTER("is_full_part_expr_in_fields"); - /* - It is very seldom many fields in full_part_field_array, so it is OK - to loop over all of them instead of creating a bitmap fields argument - to compare with. - */ - do - { - List_iterator it(fields); - Item *item; - Item_field *field; - bool found= false; - - while ((item= it++)) - { - field= item->field_for_view_update(); - DBUG_ASSERT(field->field->table == table); - if (*part_field == field->field) - { - found= true; - break; - } - } - if (!found) - DBUG_RETURN(false); - } while (*(++part_field)); - DBUG_RETURN(true); -} - - /* Create a new column value in current list with maxvalue Called from parser diff --git a/sql/partition_info.h b/sql/partition_info.h index 88193c44158..d4c180ddcdd 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -242,15 +242,6 @@ public: bool is_auto_partitioned; bool has_null_value; bool column_list; // COLUMNS PARTITIONING, 5.5+ - /** - True if pruning has been completed and can not be pruned any further, - even if there are subqueries or stored programs in the condition. - - Some times it is needed to run prune_partitions() a second time to prune - read partitions after tables are locked, when subquery and - stored functions might have been evaluated. - */ - bool is_pruning_completed; partition_info() : get_partition_id(NULL), get_part_partition_id(NULL), @@ -284,7 +275,7 @@ public: list_of_part_fields(FALSE), list_of_subpart_fields(FALSE), linear_hash_ind(FALSE), fixed(FALSE), is_auto_partitioned(FALSE), - has_null_value(FALSE), column_list(FALSE), is_pruning_completed(false) + has_null_value(FALSE), column_list(FALSE) { all_fields_in_PF.clear_all(); all_fields_in_PPF.clear_all(); @@ -348,46 +339,8 @@ public: char *file_name, uint32 *part_id); void report_part_expr_error(bool use_subpart_expr); - bool set_used_partition(List &fields, - List &values, - COPY_INFO &info, - bool copy_default_values, - MY_BITMAP *used_partitions); - /** - PRUNE_NO - Unable to prune. - PRUNE_DEFAULTS - Partitioning field is only set to - DEFAULT values, only need to check - pruning for one row where the DEFAULTS - values are set. - PRUNE_YES - Pruning is possible, calculate the used partition set - by evaluate the partition_id on row by row basis. - */ - enum enum_can_prune {PRUNE_NO=0, PRUNE_DEFAULTS, PRUNE_YES}; - bool can_prune_insert(THD *thd, - enum_duplicates duplic, - COPY_INFO &update, - List &update_fields, - List &fields, - bool empty_values, - enum_can_prune *can_prune_partitions, - bool *prune_needs_default_values, - MY_BITMAP *used_partitions); bool has_same_partitioning(partition_info *new_part_info); private: - bool is_fields_updated_in_triggers(trg_event_type event_type, - trg_action_time_type action_time_type) - { - if (table->triggers) - { - Trigger *t; - for (t= table->triggers->get_trigger(event_type, action_time_type); - t; - t= t->next) - if (t->is_fields_updated_in_trigger(&full_part_field_set)) - return true; - } - return false; - } static int list_part_cmp(const void* a, const void* b); bool set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no); @@ -399,8 +352,6 @@ private: const char *part_name); bool prune_partition_bitmaps(TABLE_LIST *table_list); bool add_named_partition(const char *part_name, uint length); - bool is_field_in_part_expr(List &fields); - bool is_full_part_expr_in_fields(List &fields); public: bool has_unique_name(partition_element *element); }; diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index b5a90d28dd0..14812d2f73b 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -2249,35 +2249,6 @@ add_tables_and_routines_for_triggers(THD *thd, } -/** - Check if any of the marked fields are used in the trigger. - - @param used_fields Bitmap over fields to check - @param event_type Type of event triggers for which we are going to inspect - @param action_time Type of trigger action time we are going to inspect -*/ - -bool Trigger::is_fields_updated_in_trigger(MY_BITMAP *used_fields) -{ - Item_trigger_field *trg_field; - sp_head *sp= body; - DBUG_ASSERT(used_fields->n_bits == base->trigger_table->s->fields); - - for (trg_field= sp->m_trg_table_fields.first; trg_field; - trg_field= trg_field->next_trg_field) - { - /* We cannot check fields which does not present in table. */ - if (trg_field->field_idx != (uint)-1) - { - if (bitmap_is_set(used_fields, trg_field->field_idx) && - trg_field->get_settable_routine_parameter()) - return true; - } - } - return false; -} - - /** Mark fields of subject table which we read/set in its triggers as such. From 3a3017a5664e868d94df483c1cfc7c9876ae79d2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 15 Nov 2016 19:00:00 +0100 Subject: [PATCH 038/135] cleanup: set_thd_proc_info() the stage is changed from 'old_stage' to 'new_stage', not the other way around --- sql/sql_class.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 8fabc8f593e..86090e251e9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -540,13 +540,13 @@ const char *set_thd_proc_info(THD *thd_arg, const char *info, PSI_stage_info old_stage; PSI_stage_info new_stage; - old_stage.m_key= 0; - old_stage.m_name= info; + new_stage.m_key= 0; + new_stage.m_name= info; - set_thd_stage_info(thd_arg, & old_stage, & new_stage, + set_thd_stage_info(thd_arg, & new_stage, & old_stage, calling_function, calling_file, calling_line); - return new_stage.m_name; + return old_stage.m_name; } extern "C" From d2408e43f912d91de3c982330d62f717e63efbc5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 1 Apr 2016 18:42:15 +0200 Subject: [PATCH 039/135] cleanup: fix a comment --- include/my_base.h | 2 +- sql/sql_parse.cc | 4 ++-- sql/sql_select.cc | 2 +- sql/structs.h | 13 +++++++------ sql/table.cc | 14 ++++---------- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index f5842685f9d..84b2e28d340 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -566,7 +566,7 @@ typedef ulong key_part_map; #define HA_STATE_KEY_CHANGED 128 #define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */ #define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ -#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ +#define HA_STATE_ROW_CHANGED 1024 /* To invalidate ROW cache */ #define HA_STATE_EXTEND_BLOCK 2048 #define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a2a4ed2b77e..d80706e6796 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4167,7 +4167,7 @@ end_with_restore_list: DBUG_ASSERT(select_lex->offset_limit == 0); unit->set_limit(select_lex); MYSQL_UPDATE_START(thd->query()); - res= (up_result= mysql_update(thd, all_tables, + res= up_result= mysql_update(thd, all_tables, select_lex->item_list, lex->value_list, select_lex->where, @@ -4175,7 +4175,7 @@ end_with_restore_list: select_lex->order_list.first, unit->select_limit_cnt, lex->duplicates, lex->ignore, - &found, &updated)); + &found, &updated); MYSQL_UPDATE_DONE(res, found, updated); /* mysql_update return 2 if we need to switch to multi-update */ if (up_result != 2) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 168e0af5d38..63a86bae054 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1926,7 +1926,7 @@ JOIN::optimize_inner() /* It's necessary to check const part of HAVING cond as there is a chance that some cond parts may become - const items after make_join_statisctics(for example + const items after make_join_statistics(for example when Item is a reference to cost table field from outer join). This check is performed only for those conditions diff --git a/sql/structs.h b/sql/structs.h index e51f3e0fe3a..144e12ca06c 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -64,9 +64,11 @@ typedef struct st_keyfile_info { /* used with ha_info() */ typedef struct st_key_part_info { /* Info about a key part */ - Field *field; - uint offset; /* offset in record (from 0) */ - uint null_offset; /* Offset to null_bit in record */ + Field *field; /* the Field object for the indexed + prefix of the original table Field. + NOT necessarily the original Field */ + uint offset; /* Offset in record (from 0) */ + uint null_offset; /* Offset to null_bit in record */ /* Length of key part in bytes, excluding NULL flag and length bytes */ uint16 length; /* @@ -77,9 +79,8 @@ typedef struct st_key_part_info { /* Info about a key part */ */ uint16 store_length; uint16 key_type; - /* Fieldnr begins counting from 1 */ - uint16 fieldnr; /* Fieldnum in UNIREG */ - uint16 key_part_flag; /* 0 or HA_REVERSE_SORT */ + uint16 fieldnr; /* Fieldnr begins counting from 1 */ + uint16 key_part_flag; /* 0 or HA_REVERSE_SORT */ uint8 type; uint8 null_bit; /* Position to null_bit */ } KEY_PART_INFO ; diff --git a/sql/table.cc b/sql/table.cc index d4d5d02e939..9a2cad8c128 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2674,10 +2674,10 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, Unpack the definition of a virtual column from its linear representation @param thd The thread object - @param mem_root Where to allocate memory + @param mem_root Where to allocate memory @param table The table containing the virtual column + @param field Field if this is a DEFAULT or AS, otherwise NULL @param vcol The Virtual_column object - @param field Field if this is a DEFAULT or AS, otherwise NULL @param[out] error_reported Flag to inform the caller that no other error messages are to be generated @@ -2696,10 +2696,8 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, Before passing 'vcol_expr' to the parser the function wraps it in parentheses and prepends a special keyword. - @retval - Virtual_column_info* If a success - @retval - NULL Error + @retval Virtual_column_info* Success + @retval NULL Error */ Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, @@ -2820,10 +2818,6 @@ static bool check_vcol_forward_refs(Field *field, Virtual_column_info *vcol) return res; } -/* - Read data from a binary .frm file from MySQL 3.23 - 5.0 into TABLE_SHARE -*/ - /* Open a table based on a TABLE_SHARE From 98be2d853e96f564d0570ade6e54333816efaacc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 12:25:45 +0100 Subject: [PATCH 040/135] cleanup: old (harmless?) typo fixed --- sql/item_create.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_create.cc b/sql/item_create.cc index ceb3c1cbbce..a506ab948d1 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -6365,7 +6365,7 @@ Create_func_weekofyear Create_func_weekofyear::s_singleton; Item* Create_func_weekofyear::create_1_arg(THD *thd, Item *arg1) { - Item *i1= new (thd->mem_root) Item_int(thd, (char*) "0", 3, 1); + Item *i1= new (thd->mem_root) Item_int(thd, (char*) "3", 3, 1); return new (thd->mem_root) Item_func_week(thd, arg1, i1); } From 605cf619ba6dd025d0f6b100f40f0cd152ee3e3c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 9 Jan 2016 00:02:56 +0100 Subject: [PATCH 041/135] cleanup: extra_rec_buf_length --- sql/ha_partition.cc | 12 ------------ sql/ha_partition.h | 6 ------ sql/handler.h | 1 - sql/table.cc | 12 +++++------- sql/unireg.cc | 2 -- 5 files changed, 5 insertions(+), 28 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 400ca6129d6..31cffe75e55 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -8440,18 +8440,6 @@ uint ha_partition::max_supported_keys() const } -uint ha_partition::extra_rec_buf_length() const -{ - handler **file; - uint max= (*m_file)->extra_rec_buf_length(); - - for (file= m_file, file++; *file; file++) - if (max < (*file)->extra_rec_buf_length()) - max= (*file)->extra_rec_buf_length(); - return max; -} - - uint ha_partition::min_record_length(uint options) const { handler **file; diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 3ea8d4a855d..70cd3760783 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1009,12 +1009,6 @@ public: virtual uint max_supported_key_parts() const; virtual uint max_supported_key_length() const; virtual uint max_supported_key_part_length() const; - - /* - The extra record buffer length is the maximum needed by all handlers. - The minimum record length is the maximum of all involved handlers. - */ - virtual uint extra_rec_buf_length() const; virtual uint min_record_length(uint options) const; /* diff --git a/sql/handler.h b/sql/handler.h index c1f6cb5b162..a74e61479fd 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2951,7 +2951,6 @@ public: virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; } bool has_transactions() { return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; } - virtual uint extra_rec_buf_length() const { return 0; } /** This method is used to analyse the error to see whether the error diff --git a/sql/table.cc b/sql/table.cc index 9a2cad8c128..0f3906406d3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -932,7 +932,7 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share, if ((strpos[10] & MYSQL57_GENERATED_FIELD)) { /* Skip virtual (not stored) generated field */ - bool stored_in_db= (bool) (uint) (vcol_screen_pos[3]); + bool stored_in_db= vcol_screen_pos[3]; vcol_screen_pos+= (uint2korr(vcol_screen_pos + 1) + MYSQL57_GCOL_HEADER_SIZE); if (! stored_in_db) @@ -982,7 +982,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint interval_count, interval_parts, read_length, int_length; uint db_create_options, keys, key_parts, n_length; uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count; - uint extra_rec_buf_length; uint i; bool use_hash, mysql57_null_bits= 0; char *keynames, *names, *comment_pos; @@ -1400,8 +1399,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (share->db_plugin && !plugin_equals(share->db_plugin, se_plugin)) goto err; // wrong engine (someone changed the frm under our feet?) - extra_rec_buf_length= uint2korr(frm_image+59); - rec_buff_length= ALIGN_SIZE(share->reclength + 1 + extra_rec_buf_length); + rec_buff_length= ALIGN_SIZE(share->reclength + 1); share->rec_buff_length= rec_buff_length; if (!(record= (uchar *) alloc_root(&share->mem_root, rec_buff_length))) @@ -1638,7 +1636,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, vcol_info= new (&share->mem_root) Virtual_column_info(); vcol_info_length= uint2korr(vcol_screen_pos + 1); DBUG_ASSERT(vcol_info_length); - vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[3]; + vcol_info->stored_in_db= vcol_screen_pos[3]; if (!(vcol_info->expr_str.str= (char *)memdup_root(&share->mem_root, vcol_screen_pos + MYSQL57_GCOL_HEADER_SIZE, @@ -1673,7 +1671,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, else if ((uint)vcol_screen_pos[0] != 1) goto err; - vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[2]; + vcol_info->stored_in_db= vcol_screen_pos[2]; vcol_expr_length= vcol_info_length - (uint)(FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id)); if (!(vcol_info->expr_str.str= @@ -3731,7 +3729,7 @@ void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo, int4store(fileinfo+51, tmp); int4store(fileinfo+55, create_info->extra_size); /* - 59-60 is reserved for extra_rec_buf_length, + 59-60 is unused since 10.2.4 61 for default_part_db_type */ int2store(fileinfo+62, create_info->key_block_size); diff --git a/sql/unireg.cc b/sql/unireg.cc index 2d83ca54edb..0199d3aa9c1 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -284,8 +284,6 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, DBUG_PRINT("info", ("part_db_type = %d", fileinfo[61])); } - int2store(fileinfo+59,db_file->extra_rec_buf_length()); - memcpy(frm_ptr, fileinfo, FRM_HEADER_SIZE); pos+= key_buff_length; From 590d473760433afde9f52cae43850898970805a8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 12 Nov 2016 15:17:18 +0100 Subject: [PATCH 042/135] cleanup: my_printf_error(ER_xxx, ER(ER_xxx), ... ) only use my_print_error when the error message is not ER(error_code) --- mysys/my_error.c | 2 +- sql/field.cc | 14 ++++++-------- sql/log.cc | 8 ++------ sql/log_event.cc | 4 +--- sql/sql_table.cc | 22 +++++++--------------- sql/sql_yacc.yy | 3 +-- 6 files changed, 18 insertions(+), 35 deletions(-) diff --git a/mysys/my_error.c b/mysys/my_error.c index c0698b19a20..f9614e07c6a 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -131,7 +131,7 @@ void my_error(uint nr, myf MyFlags, ...) Print an error message. @note - Goes through the (sole) function registered in error_handler_hook + Just like my_error, but for cases when the error message is not ER(error) @param error error number @param format format string diff --git a/sql/field.cc b/sql/field.cc index 751df5725b5..572633c0469 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8566,14 +8566,12 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs) geom_type != Field::GEOM_GEOMETRYCOLLECTION && (uint32) geom_type != wkb_type) { - my_printf_error(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, - ER_THD(get_thd(), ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - MYF(0), - Geometry::ci_collection[geom_type]->m_name.str, - Geometry::ci_collection[wkb_type]->m_name.str, - field_name, - (ulong) table->in_use->get_stmt_da()-> - current_row_for_warning()); + my_error(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, MYF(0), + Geometry::ci_collection[geom_type]->m_name.str, + Geometry::ci_collection[wkb_type]->m_name.str, + field_name, + (ulong) table->in_use->get_stmt_da()-> + current_row_for_warning()); goto err_exit; } diff --git a/sql/log.cc b/sql/log.cc index 9f43e363e50..d2fc98b80ef 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2765,9 +2765,7 @@ int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name, { THD *thd= current_thd; if (thd) - my_printf_error(ER_NO_UNIQUE_LOGFILE, - ER_THD(thd, ER_NO_UNIQUE_LOGFILE), - MYF(ME_FATALERROR), log_name); + my_error(ER_NO_UNIQUE_LOGFILE, MYF(ME_FATALERROR), log_name); sql_print_error(ER_DEFAULT(ER_NO_UNIQUE_LOGFILE), log_name); return 1; } @@ -5165,9 +5163,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock) /* handle reopening errors */ if (error) { - my_printf_error(ER_CANT_OPEN_FILE, - ER_THD_OR_DEFAULT(current_thd, ER_CANT_OPEN_FILE), - MYF(ME_FATALERROR), file_to_open, error); + my_error(ER_CANT_OPEN_FILE, MYF(ME_FATALERROR), file_to_open, error); close_on_error= TRUE; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 422928495a5..3b4d5e8f9a4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -11710,9 +11710,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi) For the cases in which a 'BINLOG' statement is set to execute in a user session */ - my_printf_error(ER_SLAVE_FATAL_ERROR, - ER_THD(thd, ER_SLAVE_FATAL_ERROR), - MYF(0), buf); + my_error(ER_SLAVE_FATAL_ERROR, MYF(0), buf); } my_free(memory); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index d112d29d10a..e1dccf029e9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2511,8 +2511,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, table->table ? (long) table->table->s : (long) -1)); DBUG_EXECUTE_IF("bug43138", - my_printf_error(ER_BAD_TABLE_ERROR, - ER_THD(thd, ER_BAD_TABLE_ERROR), MYF(0), + my_error(ER_BAD_TABLE_ERROR, MYF(0), table->table_name);); } DEBUG_SYNC(thd, "rm_table_no_locks_before_binlog"); @@ -2524,12 +2523,9 @@ err: { DBUG_ASSERT(errors); if (errors == 1 && was_view) - my_printf_error(ER_IT_IS_A_VIEW, ER_THD(thd, ER_IT_IS_A_VIEW), MYF(0), - wrong_tables.c_ptr_safe()); + my_error(ER_IT_IS_A_VIEW, MYF(0), wrong_tables.c_ptr_safe()); else if (errors > 1 || !thd->is_error()) - my_printf_error(ER_BAD_TABLE_ERROR, ER_THD(thd, ER_BAD_TABLE_ERROR), - MYF(0), - wrong_tables.c_ptr_safe()); + my_error(ER_BAD_TABLE_ERROR, MYF(0), wrong_tables.c_ptr_safe()); error= 1; } @@ -2909,8 +2905,7 @@ int prepare_create_field(Column_definition *sql_field, #ifdef HAVE_SPATIAL if (!(table_flags & HA_CAN_GEOMETRY)) { - my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED), - MYF(0), "GEOMETRY"); + my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "GEOMETRY"); DBUG_RETURN(1); } sql_field->pack_flag=FIELDFLAG_GEOM | @@ -2923,7 +2918,7 @@ int prepare_create_field(Column_definition *sql_field, (*blob_columns)++; break; #else - my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0), + my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); DBUG_RETURN(1); #endif /*HAVE_SPATIAL*/ @@ -2938,8 +2933,7 @@ int prepare_create_field(Column_definition *sql_field, if ((sql_field->length / sql_field->charset->mbmaxlen) > MAX_FIELD_CHARLENGTH) { - my_printf_error(ER_TOO_BIG_FIELDLENGTH, ER(ER_TOO_BIG_FIELDLENGTH), - MYF(0), sql_field->field_name, + my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name, static_cast(MAX_FIELD_CHARLENGTH)); DBUG_RETURN(1); } @@ -3850,9 +3844,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (!my_strcasecmp(system_charset_info, column->field_name.str, dup_column->field_name.str)) { - my_printf_error(ER_DUP_FIELDNAME, - ER_THD(thd, ER_DUP_FIELDNAME),MYF(0), - column->field_name.str); + my_error(ER_DUP_FIELDNAME, MYF(0), column->field_name.str); DBUG_RETURN(TRUE); } } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 766caeaccb7..782aaef108c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -134,8 +134,7 @@ static void my_parse_error_intern(THD *thd, const char *err_text, /* Push an error into the error stack */ ErrConvString err(yytext, strlen(yytext), thd->variables.character_set_client); - my_printf_error(ER_PARSE_ERROR, ER_THD(thd, ER_PARSE_ERROR), MYF(0), - err_text, err.ptr(), lip->yylineno); + my_error(ER_PARSE_ERROR, MYF(0), err_text, err.ptr(), lip->yylineno); } From 46ae210422c58963786e26af94152e591bb1a098 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 13:04:36 +0100 Subject: [PATCH 043/135] cleanup: my_strerror --- include/my_sys.h | 2 +- storage/innobase/handler/ha_innodb.cc | 12 +++++------- strings/my_vsnprintf.c | 5 +++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index 528950f4e22..a5ad8f0c057 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -698,7 +698,7 @@ extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); extern int my_fclose(FILE *fd,myf MyFlags); extern int my_vfprintf(FILE *stream, const char* format, va_list args); -extern void my_strerror(char *buf, size_t len, int nr); +extern const char* my_strerror(char *buf, size_t len, int nr); extern int my_fprintf(FILE *stream, const char* format, ...); extern File my_fileno(FILE *fd); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 234a8447504..2de0104fea6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2619,11 +2619,10 @@ innobase_mysql_tmpfile( char errbuf[MYSYS_STRERROR_SIZE]; DBUG_PRINT("error",("Got error %d on dup",fd2)); set_my_errno(errno); - my_strerror(errbuf, sizeof(errbuf), my_errno); my_error(EE_OUT_OF_FILERESOURCES, MYF(0), - "ib*", my_errno, - errbuf); + "ib*", errno, + my_strerror(errbuf, sizeof(errbuf), errno)); } my_close(fd, MYF(MY_WME)); } @@ -16092,8 +16091,7 @@ ha_innobase::info_low( char errbuf[MYSYS_STRERROR_SIZE]; thd = ha_thd(); - my_strerror(errbuf, sizeof(errbuf), - errno); + push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, @@ -16105,8 +16103,8 @@ ha_innobase::info_low( " the free space to zero." " (errno: %d - %s)", ib_table->name.m_name, errno, - errbuf); - + my_strerror(errbuf, sizeof(errbuf), + errno)); stats.delete_length = 0; } else { diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index ad270bd9b64..b2ff1e0fa2c 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -790,7 +790,7 @@ int my_fprintf(FILE *stream, const char* format, ...) @param nr Error number */ -void my_strerror(char *buf, size_t len, int nr) +const char* my_strerror(char *buf, size_t len, int nr) { char *msg= NULL; @@ -802,7 +802,7 @@ void my_strerror(char *buf, size_t len, int nr) "Internal error/check (Not system error)" : "Internal error < 0 (Not system error)"), len-1); - return; + return buf; } /* @@ -843,4 +843,5 @@ void my_strerror(char *buf, size_t len, int nr) */ if (!buf[0]) strmake(buf, "unknown error", len - 1); + return buf; } From 03a0623f1e50c94048d23b05ec0411243f73f9f5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 13 Jan 2016 13:42:46 +0100 Subject: [PATCH 044/135] cleanup: rename a method --- sql/field.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/field.h b/sql/field.h index 65c4843be82..40dff170dac 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1393,7 +1393,7 @@ public: - If field is char/varchar/.. and is not part of write set. TRUE - If field is char/varchar/.. and is part of write set. */ - virtual bool is_updatable() const { return FALSE; } + virtual bool is_varchar_and_in_write_set() const { return FALSE; } /* Check whether the field can be used as a join attribute in hash join */ virtual bool hash_join_is_possible() { return TRUE; } @@ -1702,7 +1702,7 @@ public: int store_decimal(const my_decimal *d); uint32 max_data_length() const; - bool is_updatable() const + bool is_varchar_and_in_write_set() const { DBUG_ASSERT(table && table->write_set); return bitmap_is_set(table->write_set, field_index); @@ -3204,7 +3204,8 @@ public: int store_field(Field *from) { // Be sure the value is stored from->val_str(&value); - if (table->copy_blobs || (!value.is_alloced() && from->is_updatable())) + if (table->copy_blobs || + (!value.is_alloced() && from->is_varchar_and_in_write_set())) value.copy(); return store(value.ptr(), value.length(), from->charset()); } From 4210538122e6e868848c703dab6c1b0d59733d28 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 13 Jan 2016 17:43:54 +0100 Subject: [PATCH 045/135] cleanup: avoid Field::field_index prefer x->field over table->field[x->field->field_index] --- sql/item_subselect.cc | 2 +- sql/item_subselect.h | 4 ++-- sql/sql_load.cc | 2 +- sql/sql_select.cc | 2 +- sql/sql_statistics.cc | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index e90efbd82be..f7105086e55 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -6186,7 +6186,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts, Check if the first and only indexed column contains NULL in the curent row, and add the row number to the corresponding key. */ - if (tmp_table->field[merge_keys[i]->get_field_idx(0)]->is_null()) + if (merge_keys[i]->get_field(0)->is_null()) merge_keys[i]->set_null(cur_rownum); else merge_keys[i]->add_key(cur_rownum); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 83340573e8a..823dbc6c281 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -1236,10 +1236,10 @@ public: uint get_column_count() { return key_column_count; } uint get_keyid() { return keyid; } - uint get_field_idx(uint i) + Field *get_field(uint i) { DBUG_ASSERT(i < key_column_count); - return key_columns[i]->field->field_index; + return key_columns[i]->field; } rownum_t get_min_null_row() { return min_null_row; } rownum_t get_max_null_row() { return max_null_row; } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 6bfe01ef6df..e306097afbe 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -881,7 +881,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, while ((sql_field= (Item_field*) it++)) { - if (table->field[sql_field->field->field_index] == table->next_number_field) + if (sql_field->field == table->next_number_field) auto_increment_field_not_null= true; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 63a86bae054..ea24223c8eb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7490,7 +7490,7 @@ double table_multi_eq_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, if (!s->keyuse) return sel; - Item_equal *item_equal; + Item_equal *item_equal; List_iterator_fast it(cond_equal->current_level); TABLE *table= s->table; table_map table_bit= table->map; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 83c7db8b510..e557a009686 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3591,7 +3591,7 @@ double get_column_avg_frequency(Field * field) return res; } - Column_statistics *col_stats= table->s->field[field->field_index]->read_stats; + Column_statistics *col_stats= field->read_stats; if (!col_stats) res= table->stat_records(); @@ -3629,7 +3629,7 @@ double get_column_range_cardinality(Field *field, { double res; TABLE *table= field->table; - Column_statistics *col_stats= table->field[field->field_index]->read_stats; + Column_statistics *col_stats= field->read_stats; double tab_records= table->stat_records(); if (!col_stats) From db3f110864f05132b86b996089f69105d69a7ecf Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 9 Mar 2016 12:32:35 +0100 Subject: [PATCH 046/135] cleanup: remove unused Field::utype values and FIELDFLAG_xxx constants --- sql/field.cc | 2 +- sql/field.h | 29 +++++++++++++---------------- sql/sql_table.cc | 4 ---- sql/table.cc | 2 +- sql/unireg.cc | 22 +++------------------- sql/unireg.h | 4 ---- 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 572633c0469..2a807ae599b 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -80,7 +80,7 @@ const char field_separator=','; NOTE: to avoid 256*256 table, gap in table types numeration is skiped following #defines describe that gap and how to canculate number of fields - and index of field in thia array. + and index of field in this array. */ #define FIELDTYPE_TEAR_FROM (MYSQL_TYPE_BIT + 1) #define FIELDTYPE_TEAR_TO (MYSQL_TYPE_NEWDECIMAL - 1) diff --git a/sql/field.h b/sql/field.h index 40dff170dac..52e0d2ea6d7 100644 --- a/sql/field.h +++ b/sql/field.h @@ -709,10 +709,14 @@ public: in more clean way with transition to new text based .frm format. See also comment for Field_timestamp::Field_timestamp(). */ - enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL, - CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD, - BIT_FIELD, TIMESTAMP_OLD_FIELD, CAPITALIZE, BLOB_FIELD, - TIMESTAMP_DN_FIELD, TIMESTAMP_UN_FIELD, TIMESTAMP_DNUN_FIELD}; + enum utype { + NONE=0, + NEXT_NUMBER=15, // AUTO_INCREMENT + TIMESTAMP_OLD_FIELD=18, // TIMESTAMP created before 4.1.3 + TIMESTAMP_DN_FIELD=21, // TIMESTAMP DEFAULT NOW() + TIMESTAMP_UN_FIELD=22, // TIMESTAMP ON UPDATE NOW() + TIMESTAMP_DNUN_FIELD=23 // TIMESTAMP DEFAULT NOW() ON UPDATE NOW() + }; enum geometry_type { GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3, @@ -3905,19 +3909,13 @@ bool check_expression(Virtual_column_info *vcol, const char *type, #define FIELDFLAG_GEOM 2048 // mangled with decimals! #define FIELDFLAG_TREAT_BIT_AS_CHAR 4096 /* use Field_bit_as_char */ - -#define FIELDFLAG_LEFT_FULLSCREEN 8192 -#define FIELDFLAG_RIGHT_FULLSCREEN 16384 -#define FIELDFLAG_FORMAT_NUMBER 16384 // predit: ###,,## in output +#define FIELDFLAG_LONG_DECIMAL 8192 #define FIELDFLAG_NO_DEFAULT 16384 /* sql */ -#define FIELDFLAG_SUM ((uint) 32768)// predit: +#fieldflag #define FIELDFLAG_MAYBE_NULL ((uint) 32768)// sql #define FIELDFLAG_HEX_ESCAPE ((uint) 0x10000) #define FIELDFLAG_PACK_SHIFT 3 #define FIELDFLAG_DEC_SHIFT 8 -#define FIELDFLAG_MAX_DEC 63 -#define FIELDFLAG_NUM_SCREEN_TYPE 0x7F01 -#define FIELDFLAG_ALFA_SCREEN_TYPE 0x7800 +#define FIELDFLAG_MAX_DEC 63 #define MTYP_TYPENR(type) (type & 127) /* Remove bits from type */ @@ -3933,10 +3931,9 @@ bool check_expression(Virtual_column_info *vcol, const char *type, #define f_is_bitfield(x) (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD) #define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB) #define f_is_geom(x) (((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM) -#define f_is_equ(x) ((x) & (1+2+FIELDFLAG_PACK+31*256)) -#define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT) -#define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL) -#define f_no_default(x) (x & FIELDFLAG_NO_DEFAULT) +#define f_settype(x) (((int) (x)) << FIELDFLAG_PACK_SHIFT) +#define f_maybe_null(x) ((x) & FIELDFLAG_MAYBE_NULL) +#define f_no_default(x) ((x) & FIELDFLAG_NO_DEFAULT) #define f_bit_as_char(x) ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR) #define f_is_hex_escape(x) ((x) & FIELDFLAG_HEX_ESCAPE) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e1dccf029e9..632290703be 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2898,7 +2898,6 @@ int prepare_create_field(Column_definition *sql_field, if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->length=8; // Unireg field length - sql_field->unireg_check=Field::BLOB_FIELD; (*blob_columns)++; break; case MYSQL_TYPE_GEOMETRY: @@ -2914,7 +2913,6 @@ int prepare_create_field(Column_definition *sql_field, if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->length=8; // Unireg field length - sql_field->unireg_check=Field::BLOB_FIELD; (*blob_columns)++; break; #else @@ -2950,7 +2948,6 @@ int prepare_create_field(Column_definition *sql_field, FIELDFLAG_INTERVAL; if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; - sql_field->unireg_check=Field::INTERVAL_FIELD; if (check_duplicates_in_interval("ENUM",sql_field->field_name, sql_field->interval, sql_field->charset, &dup_val_count)) @@ -2961,7 +2958,6 @@ int prepare_create_field(Column_definition *sql_field, FIELDFLAG_BITFIELD; if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; - sql_field->unireg_check=Field::BIT_FIELD; if (check_duplicates_in_interval("SET",sql_field->field_name, sql_field->interval, sql_field->charset, &dup_val_count)) diff --git a/sql/table.cc b/sql/table.cc index 0f3906406d3..2aaa05b5ae6 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1724,7 +1724,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, /* Remove >32 decimals from old files */ if (share->mysql_version < 100200) - pack_flag&= ~(FIELDFLAG_LEFT_FULLSCREEN); + pack_flag&= ~FIELDFLAG_LONG_DECIMAL; if (interval_nr && charset->mbminlen > 1) { diff --git a/sql/unireg.cc b/sql/unireg.cc index 0199d3aa9c1..66fde186b5b 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -592,7 +592,7 @@ static bool pack_header(THD *thd, uchar *forminfo, HA_CREATE_INFO *create_info, ulong data_offset, handler *file) { - uint length,int_count,int_length,no_empty, int_parts; + uint length,int_count,int_length, int_parts; uint time_stamp_pos,null_fields; uint table_options= create_info->table_options; size_t reclength, totlength, n_length, com_length, expression_length; @@ -606,7 +606,7 @@ static bool pack_header(THD *thd, uchar *forminfo, totlength= 0L; reclength= data_offset; - no_empty=int_count=int_parts=int_length=time_stamp_pos=null_fields=0; + int_count=int_parts=int_length=time_stamp_pos=null_fields=0; com_length= 0; n_length=2L; create_info->field_check_constraints= 0; @@ -640,13 +640,6 @@ static bool pack_header(THD *thd, uchar *forminfo, totlength+= field->length; com_length+= field->comment.length; - if (MTYP_TYPENR(field->unireg_check) == Field::NOEMPTY || - field->unireg_check & MTYP_NOEMPTY_BIT) - { - field->unireg_check= (Field::utype) ((uint) field->unireg_check | - MTYP_NOEMPTY_BIT); - no_empty++; - } /* We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE as auto-update field. @@ -745,7 +738,7 @@ static bool pack_header(THD *thd, uchar *forminfo, int2store(forminfo+258,create_fields.elements); int2store(forminfo+260,0); // Screen length, not used anymore int2store(forminfo+262,totlength); - int2store(forminfo+264,no_empty); + int2store(forminfo+264,0); // unused int2store(forminfo+266,reclength); int2store(forminfo+268,n_length); int2store(forminfo+270,int_count); @@ -998,7 +991,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, uint reclength, ulong data_offset) { int error= 0; - Field::utype type; uint null_count; uchar *null_pos; TABLE table; @@ -1061,8 +1053,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, if (field->sql_type == MYSQL_TYPE_BIT && !f_bit_as_char(field->pack_flag)) null_count+= field->length & 7; - type= (Field::utype) MTYP_TYPENR(field->unireg_check); - if (field->default_value && !field->has_default_expression()) { int res= field->default_value->expr_item->save_in_field(regfield, 1); @@ -1081,12 +1071,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, regfield->set_notnull(); regfield->store((longlong) 1, TRUE); } - else if (type == Field::YES) // Old unireg type - regfield->store(ER_THD(thd, ER_YES),(uint) strlen(ER_THD(thd, ER_YES)), - system_charset_info); - else if (type == Field::NO) // Old unireg type - regfield->store(ER_THD(thd, ER_NO), (uint) strlen(ER_THD(thd, ER_NO)), - system_charset_info); else regfield->reset(); } diff --git a/sql/unireg.h b/sql/unireg.h index 8e74519862e..4a287853438 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -142,10 +142,6 @@ */ #define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2) -#define SC_INFO_LENGTH 4 /* Form format constant */ -#define TE_INFO_LENGTH 3 -#define MTYP_NOEMPTY_BIT 128 - /* Minimum length pattern before Turbo Boyer-Moore is used for SELECT "text" LIKE "%pattern%", excluding the two From b2c8d55c228d560959a031d641959e86f0274c75 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 14 Nov 2016 20:24:03 +0100 Subject: [PATCH 047/135] cleanup: unused open_table_from_share() flags --- sql/handler.h | 7 ------- sql/lock.cc | 1 - sql/opt_subselect.cc | 2 +- sql/sql_base.cc | 14 ++++---------- sql/sql_select.cc | 2 +- sql/table.cc | 7 +------ sql/temporary_tables.cc | 9 ++------- sql/unireg.h | 35 ++++++++++++----------------------- storage/oqgraph/ha_oqgraph.cc | 5 ++--- 9 files changed, 23 insertions(+), 59 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index a74e61479fd..8cc1f3973d9 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -370,16 +370,9 @@ enum enum_alter_inplace_result { */ #define HA_OPEN_KEYFILE 1 -#define HA_OPEN_RNDFILE 2 -#define HA_GET_INDEX 4 -#define HA_GET_INFO 8 /* do a ha_info() after open */ #define HA_READ_ONLY 16 /* File opened as readonly */ /* Try readonly if can't open with read and write */ #define HA_TRY_READ_ONLY 32 -#define HA_WAIT_IF_LOCKED 64 /* Wait if locked on open */ -#define HA_ABORT_IF_LOCKED 128 /* skip if locked on open.*/ -#define HA_BLOCK_LOCK 256 /* unlock when reading some records */ -#define HA_OPEN_TEMPORARY 512 /* Some key definitions */ #define HA_KEY_NULL_LENGTH 1 diff --git a/sql/lock.cc b/sql/lock.cc index 8aebc1f30d9..2de2a80c95a 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -411,7 +411,6 @@ static int lock_external(THD *thd, TABLE **tables, uint count) } else { - (*tables)->db_stat &= ~ HA_BLOCK_LOCK; (*tables)->current_lock= lock_type; } } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index a09826ac2f0..a9222cbca42 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4000,7 +4000,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) table->alias.set("weedout-tmp", sizeof("weedout-tmp")-1, table_alias_charset); table->reginfo.lock_type=TL_WRITE; /* Will be updated */ - table->db_stat=HA_OPEN_KEYFILE+HA_OPEN_RNDFILE; + table->db_stat=HA_OPEN_KEYFILE; table->map=1; table->temp_pool_slot = temp_pool_slot; table->copy_blobs= 1; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e1d788ba367..6e448c00748 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1855,12 +1855,8 @@ retry_share: goto err_lock; error= open_table_from_share(thd, share, alias, - (uint) (HA_OPEN_KEYFILE | - HA_OPEN_RNDFILE | - HA_GET_INDEX | - HA_TRY_READ_ONLY), - (READ_KEYINFO | COMPUTE_TYPES | - EXTRA_RECORD), + HA_OPEN_KEYFILE | HA_TRY_READ_ONLY, + EXTRA_RECORD, thd->open_options, table, FALSE); if (error) @@ -2694,10 +2690,8 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list) DBUG_ASSERT(! share->is_view); if (open_table_from_share(thd, share, table_list->alias, - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX | - HA_TRY_READ_ONLY), - READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, + HA_OPEN_KEYFILE | HA_TRY_READ_ONLY, + EXTRA_RECORD, ha_open_options | HA_OPEN_FOR_REPAIR, entry, FALSE) || ! entry->file || (entry->file->is_crashed() && entry->file->ha_check_and_repair(thd))) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ea24223c8eb..e76b6a5a48a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17133,7 +17133,7 @@ bool open_tmp_table(TABLE *table) table->db_stat= 0; return 1; } - table->db_stat= HA_OPEN_KEYFILE+HA_OPEN_RNDFILE; + table->db_stat= HA_OPEN_KEYFILE; (void) table->file->extra(HA_EXTRA_QUICK); /* Faster */ if (!table->is_created()) { diff --git a/sql/table.cc b/sql/table.cc index 2aaa05b5ae6..1e3bc161c6f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3261,13 +3261,8 @@ partititon_err: /* The table struct is now initialized; Open the table */ if (db_stat) { - if (db_stat & HA_OPEN_TEMPORARY) - ha_open_flags|= HA_OPEN_TMP_TABLE; - else if ((db_stat & HA_WAIT_IF_LOCKED) || - (specialflag & SPECIAL_WAIT_IF_LOCKED)) + if (specialflag & SPECIAL_WAIT_IF_LOCKED) ha_open_flags|= HA_OPEN_WAIT_IF_LOCKED; - else if (db_stat & (HA_ABORT_IF_LOCKED | HA_GET_INFO)) - ha_open_flags|= HA_OPEN_ABORT_IF_LOCKED; else ha_open_flags|= HA_OPEN_IGNORE_IF_LOCKED; diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 9a85c09b08e..c05fc632a94 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1116,13 +1116,8 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share, } if (open_table_from_share(this, share, alias, - (open_in_engine) ? - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX) : 0, - (uint) (READ_KEYINFO | COMPUTE_TYPES | - EXTRA_RECORD), - ha_open_options, - table, + open_in_engine ? (uint)HA_OPEN_KEYFILE : 0, + EXTRA_RECORD, ha_open_options, table, open_in_engine ? false : true)) { my_free(table); diff --git a/sql/unireg.h b/sql/unireg.h index 4a287853438..b1cab841092 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -83,64 +83,53 @@ /* Defines for use with openfrm, openprt and openfrd */ -#define READ_ALL 1 /* openfrm: Read all parameters */ -#define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */ -#define READ_KEYINFO 4 /* L{s nyckeldata fr}n filen */ -#define EXTRA_RECORD 8 /* Reserve space for an extra record */ -#define DONT_OPEN_TABLES 8 /* Don't open database-files (frd) */ -#define DONT_OPEN_MASTER_REG 16 /* Don't open first reg-file (prt) */ -#define EXTRA_LONG_RECORD 16 /* Plats f|r dubbel s|k-record */ -#define COMPUTE_TYPES 32 /* Kontrollera type f|r f{ltena */ -#define SEARCH_PRG 64 /* S|k efter registret i 'prg_dev' */ -#define READ_USED_NAMES 128 /* L{s anv{nda formul{rnamn */ -#define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */ -#define READ_SCREENS 1024 /* Read screens, info and helpfile */ -#define DELAYED_OPEN 4096 /* Open table later */ -#define OPEN_VIEW 8192 /* Allow open on view */ -#define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view, - but do not parse view itself */ +#define READ_ALL (1 << 0) /* openfrm: Read all parameters */ +#define EXTRA_RECORD (1 << 3) /* Reserve space for an extra record */ +#define DELAYED_OPEN (1 << 12) /* Open table later */ +#define OPEN_VIEW_NO_PARSE (1 << 14) /* Open frm only if it's a view, + but do not parse view itself */ /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to open FRM file only to get necessary data. */ -#define OPEN_FRM_FILE_ONLY 32768 +#define OPEN_FRM_FILE_ONLY (1 << 15) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to process tables only to get necessary data. Views are not processed. */ -#define OPEN_TABLE_ONLY (OPEN_FRM_FILE_ONLY*2) +#define OPEN_TABLE_ONLY (1 << 16) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to process views only to get necessary data. Tables are not processed. */ -#define OPEN_VIEW_ONLY (OPEN_TABLE_ONLY*2) +#define OPEN_VIEW_ONLY (1 << 17) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that we need to open a view using open_normal_and_derived_tables() function. */ -#define OPEN_VIEW_FULL (OPEN_VIEW_ONLY*2) +#define OPEN_VIEW_FULL (1 << 18) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that I_S table uses optimization algorithm. */ -#define OPTIMIZE_I_S_TABLE (OPEN_VIEW_FULL*2) +#define OPTIMIZE_I_S_TABLE (1 << 19) /** This flag is used to instruct tdc_open_view() to check metadata version. */ -#define CHECK_METADATA_VERSION (OPEN_TRIGGER_ONLY*2) +#define CHECK_METADATA_VERSION (1 << 20) /* The flag means that we need to process trigger files only. */ -#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2) +#define OPEN_TRIGGER_ONLY (1 << 21) /* Minimum length pattern before Turbo Boyer-Moore is used diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 6e6377b7068..b55619a6fa5 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -623,9 +623,8 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) } if (enum open_frm_error err= open_table_from_share(thd, share, "", - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX | HA_TRY_READ_ONLY), - READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, + (uint) (HA_OPEN_KEYFILE | HA_TRY_READ_ONLY), + EXTRA_RECORD, thd->open_options, edges, FALSE)) { open_table_error(share, err, EMFILE); // NOTE - EMFILE is probably bogus, it reports as too many open files (!) From 4aab0588541499d97ad1882ccb4481052dd2f62d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 11 Oct 2016 16:10:47 +0200 Subject: [PATCH 048/135] cleanup: spatial indexes in MyISAM In spatial indexes there can be only one keyseg. Make it explicit in the code, don't pretend that this can work with the arbitrary number of keysegs. --- storage/myisam/mi_create.c | 5 +++-- storage/myisam/mi_open.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 88b9da6f8a9..dbf2343c2a6 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -273,7 +273,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, so we only need to decrease keydef->keysegs. (see recreate_table() in mi_check.c) */ - keydef->keysegs-=sp_segs-1; + keydef->keysegs= 1; } for (j=0, keyseg=keydef->seg ; (int) j < keydef->keysegs ; @@ -287,7 +287,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, goto err_no_lock; } } - keydef->keysegs+=sp_segs; + DBUG_ASSERT(keydef->keysegs == 1); + keydef->keysegs= sp_segs + 1; key_length+=SPLEN*sp_segs; length++; /* At least one length byte */ min_key_length_skip+=SPLEN*2*SPDIMS; diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index b8cbefe6ac2..9c3a6bf5a2f 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -377,8 +377,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) { #ifdef HAVE_SPATIAL uint sp_segs=SPDIMS*2; - share->keyinfo[i].seg=pos-sp_segs; - share->keyinfo[i].keysegs--; + share->keyinfo[i].seg= pos - sp_segs; + DBUG_ASSERT(share->keyinfo[i].keysegs == sp_segs + 1); + share->keyinfo[i].keysegs= sp_segs; #else my_errno=HA_ERR_UNSUPPORTED; goto err; From 163478db4512237ca67574fe008ddea5970e67dd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 23 Oct 2016 14:04:57 +0200 Subject: [PATCH 049/135] cleanup: InnoDB: is_partition() --- storage/innobase/handler/ha_innodb.cc | 61 ++++++++++++--------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2de0104fea6..400c408c065 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -281,6 +281,26 @@ void set_my_errno(int err) errno = err; } + +/** Checks whether the file name belongs to a partition of a table. +@param[in] file_name file name +@return pointer to the end of the table name part of the file name, or NULL */ +static +char* +is_partition( +/*=========*/ + char* file_name) +{ + /* We look for pattern #P# to see if the table is partitioned + MariaDB table. */ +#ifdef _WIN32 + return strstr(file_name, "#p#"); +#else + return strstr(file_name, "#P#"); +#endif /* _WIN32 */ +} + + /** Return the InnoDB ROW_FORMAT enum value @param[in] row_format row_format from "innodb_default_row_format" @return InnoDB ROW_FORMAT value from rec_format_t enum. */ @@ -6715,7 +6735,6 @@ ha_innobase::open( dict_table_t* ib_table; char norm_name[FN_REFLEN]; THD* thd; - char* is_part = NULL; dict_err_ignore_t ignore_err = DICT_ERR_IGNORE_NONE; DBUG_ENTER("ha_innobase::open"); @@ -6745,13 +6764,7 @@ ha_innobase::open( m_upd_buf = NULL; m_upd_buf_size = 0; - /* We look for pattern #P# to see if the table is partitioned - MySQL table. */ -#ifdef _WIN32 - is_part = strstr(norm_name, "#p#"); -#else - is_part = strstr(norm_name, "#P#"); -#endif /* _WIN32 */ + char* is_part = is_partition(norm_name); /* Check whether FOREIGN_KEY_CHECKS is set to 0. If so, the table can be opened even if some FK indexes are missing. If not, the table @@ -14546,12 +14559,7 @@ ha_innobase::delete_table( if (err == DB_TABLE_NOT_FOUND && innobase_get_lower_case_table_names() == 1) { - char* is_part = NULL; -#ifdef __WIN__ - is_part = strstr(norm_name, "#p#"); -#else - is_part = strstr(norm_name, "#P#"); -#endif /* __WIN__ */ + char* is_part = is_partition(norm_name); if (is_part) { char par_case_name[FN_REFLEN]; @@ -14616,11 +14624,7 @@ ha_innobase::delete_table( native innodb partitioning is completed */ if (err == DB_TABLE_NOT_FOUND && innobase_get_lower_case_table_names() == 1) { -#ifdef _WIN32 - char* is_part = strstr(norm_name, "#p#"); -#else - char* is_part = strstr(norm_name, "#P#"); -#endif /* _WIN32 */ + char* is_part = is_partition(norm_name); if (is_part != NULL) { char par_case_name[FN_REFLEN]; @@ -15213,12 +15217,7 @@ innobase_rename_table( if (error != DB_SUCCESS) { if (error == DB_TABLE_NOT_FOUND && innobase_get_lower_case_table_names() == 1) { - char* is_part = NULL; -#ifdef _WIN32 - is_part = strstr(norm_from, "#p#"); -#else - is_part = strstr(norm_from, "#P#"); -#endif /* _WIN32 */ + char* is_part = is_partition(norm_from); if (is_part) { char par_case_name[FN_REFLEN]; @@ -23526,11 +23525,7 @@ innobase_init_vc_templ( /* For partition table, remove the partition name and use the "main" table name to build the template */ -#ifdef _WIN32 - char* is_part = strstr(tbname, "#p#"); -#else - char* is_part = strstr(tbname, "#P#"); -#endif /* _WIN32 */ + char* is_part = is_partition(tbname); if (is_part != NULL) { *is_part = '\0'; @@ -23581,11 +23576,7 @@ innobase_rename_vc_templ( /* For partition table, remove the partition name and use the "main" table name to build the template */ -#ifdef _WIN32 - char* is_part = strstr(tbname, "#p#"); -#else - char* is_part = strstr(tbname, "#P#"); -#endif /* _WIN32 */ + char* is_part = is_partition(tbname); if (is_part != NULL) { *is_part = '\0'; From 7459f0c03a972fb1fab481490d3c6c52d3dfa4df Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 1 Apr 2016 19:51:57 +0200 Subject: [PATCH 050/135] cleanup: don't update_virtual_fields from READ_RECORD it was done only in some access methods, not in all, so the caller had to update_virtual_fields anyway. --- mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result | 2 -- sql/records.cc | 4 ---- 2 files changed, 6 deletions(-) diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index 2e6dbc38b6f..a6f69edab1a 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -2619,7 +2619,6 @@ a b -1 18446744073709551615 Warnings: Note 1105 Cast to unsigned converted negative integer to it's positive complement -Note 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # Convert() @@ -2641,7 +2640,6 @@ a b -1 18446744073709551615 Warnings: Note 1105 Cast to unsigned converted negative integer to it's positive complement -Note 1105 Cast to unsigned converted negative integer to it's positive complement drop table t1; set sql_warnings = 0; # diff --git a/sql/records.cc b/sql/records.cc index e7a4ab836c0..fccfa751c7e 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -358,8 +358,6 @@ static int rr_quick(READ_RECORD *info) break; } } - if (info->table->vfield) - update_virtual_fields(info->thd, info->table); return tmp; } @@ -483,8 +481,6 @@ int rr_sequential(READ_RECORD *info) break; } } - if (!tmp && info->table->vfield) - update_virtual_fields(info->thd, info->table); return tmp; } From a632df9de012e7f316c8f4f83938ac721cbeb2b0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 15 Nov 2016 16:07:37 +0100 Subject: [PATCH 051/135] improve Item_field::register_field_in_read_map() make it to work when read_set == vcol_set, that is, when the caller wants to get a one complete bitmap of all fields a particular vcol depends on. --- sql/item.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 009662252d8..567ad643050 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -901,17 +901,15 @@ bool Item_field::find_item_in_field_list_processor(void *arg) bool Item_field::register_field_in_read_map(void *arg) { TABLE *table= (TABLE *) arg; + int res= 0; + if (field->vcol_info && + !bitmap_fast_test_and_set(field->table->vcol_set, field->field_index)) + { + res= field->vcol_info->expr_item->walk(&Item::register_field_in_read_map,1,arg); + } if (field->table == table || !table) bitmap_set_bit(field->table->read_set, field->field_index); - if (field->vcol_info && - !bitmap_is_set(field->table->vcol_set, field->field_index)) - { - /* Ensure that the virtual fields is updated on read or write */ - bitmap_set_bit(field->table->vcol_set, field->field_index); - return field->vcol_info->expr_item->walk(&Item::register_field_in_read_map, - 1, arg); - } - return 0; + return res; } /* From 10089493bdc3f7b782d01fa8d2f3221449965458 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 1 Apr 2016 18:40:31 +0200 Subject: [PATCH 052/135] cleanup: update_virtual_fields() --- sql/sql_base.cc | 17 +++--------- sql/sql_delete.cc | 4 +-- sql/sql_update.cc | 11 +++----- sql/table.cc | 66 +++++++++++++++++++++++++++++++++-------------- sql/table.h | 6 ++--- 5 files changed, 57 insertions(+), 47 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6e448c00748..86f2b24829f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7837,9 +7837,7 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, /* Update virtual fields */ thd->abort_on_warning= FALSE; if (vcol_table && vcol_table->vfield && - update_virtual_fields(thd, vcol_table, - vcol_table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE)) + update_virtual_fields(thd, vcol_table, VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= save_abort_on_warning; thd->no_errors= save_no_errors; @@ -7990,9 +7988,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, if (item_field && table->vfield) { DBUG_ASSERT(table == item_field->field->table); - result= update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE); + result= update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE); } } } @@ -8085,9 +8081,7 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List &values, /* Update virtual fields */ thd->abort_on_warning= FALSE; if (table->vfield && - update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE)) + update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= abort_on_warning_saved; DBUG_RETURN(thd->is_error()); @@ -8141,10 +8135,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, Field **ptr, { DBUG_ASSERT(table == (*ptr)->table); if (table->vfield) - result= update_virtual_fields(thd, table, - table->triggers ? - VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE); + result= update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE); } return result; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 4f9afca2f6d..a4e43f87bd0 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -561,9 +561,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { explain->tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_READ); + update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); // thd->is_error() is tested to disallow delete row on error if (!select || select->skip_record(thd) > 0) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b452e4fe6ae..3a4bffeb454 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -619,9 +619,7 @@ int mysql_update(THD *thd, { explain->buf_tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_READ); + update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || (error= select->skip_record(thd)) > 0) { @@ -738,9 +736,7 @@ int mysql_update(THD *thd, { explain->tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_READ); + update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || select->skip_record(thd) > 0) { @@ -2411,8 +2407,7 @@ int multi_update::do_updates() (error= table->update_default_fields(1, ignore))) goto err2; if (table->vfield && - update_virtual_fields(thd, table, - (table->triggers ? VCOL_UPDATE_ALL : VCOL_UPDATE_FOR_WRITE))) + update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE)) goto err2; if ((error= cur_table->view_check_option(thd, ignore)) != VIEW_CHECK_OK) diff --git a/sql/table.cc b/sql/table.cc index 1e3bc161c6f..ad7e3e17cad 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6200,6 +6200,7 @@ void TABLE::mark_auto_increment_column() void TABLE::mark_columns_needed_for_delete() { + bool need_signal= false; mark_columns_per_binlog_row_image(); if (triggers) @@ -6212,7 +6213,7 @@ void TABLE::mark_columns_needed_for_delete() if ((*reg_field)->flags & PART_KEY_FLAG) bitmap_set_bit(read_set, (*reg_field)->field_index); } - file->column_bitmaps_signal(); + need_signal= true; } if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) { @@ -6226,11 +6227,17 @@ void TABLE::mark_columns_needed_for_delete() else { mark_columns_used_by_index_no_reset(s->primary_key, read_set); - file->column_bitmaps_signal(); + need_signal= true; } } if (check_constraints) + { mark_check_constraint_columns_for_read(); + need_signal= true; + } + + if (need_signal) + file->column_bitmaps_signal(); } @@ -6255,6 +6262,7 @@ void TABLE::mark_columns_needed_for_delete() void TABLE::mark_columns_needed_for_update() { DBUG_ENTER("mark_columns_needed_for_update"); + bool need_signal= false; mark_columns_per_binlog_row_image(); @@ -6270,7 +6278,7 @@ void TABLE::mark_columns_needed_for_update() if (merge_keys.is_overlapping((*reg_field)->part_of_key)) bitmap_set_bit(read_set, (*reg_field)->field_index); } - file->column_bitmaps_signal(); + need_signal= true; } if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) { @@ -6284,16 +6292,19 @@ void TABLE::mark_columns_needed_for_update() else { mark_columns_used_by_index_no_reset(s->primary_key, read_set); - file->column_bitmaps_signal(); + need_signal= true; } } if (default_field) mark_default_fields_for_write(FALSE); /* Mark all virtual columns needed for update */ if (vfield) - mark_virtual_columns_for_write(FALSE); + need_signal|= mark_virtual_columns_for_write(FALSE); if (check_constraints) + { mark_check_constraint_columns_for_read(); + need_signal= true; + } /* If a timestamp field settable on UPDATE is present then to avoid wrong @@ -6302,7 +6313,12 @@ void TABLE::mark_columns_needed_for_update() */ if ((file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) && default_field && s->has_update_default_function) + { bitmap_union(read_set, write_set); + need_signal= true; + } + if (need_signal) + file->column_bitmaps_signal(); DBUG_VOID_RETURN; } @@ -6505,7 +6521,7 @@ bool TABLE::mark_virtual_col(Field *field) through columns from write_set it is also marked in vcol_set, and, besides, it is added to write_set. - @return void + @return whether a bitmap was updated @note Let table t1 have columns a,b,c and let column c be a stored virtual @@ -6518,7 +6534,7 @@ bool TABLE::mark_virtual_col(Field *field) be added to read_set either. */ -void TABLE::mark_virtual_columns_for_write(bool insert_fl) +bool TABLE::mark_virtual_columns_for_write(bool insert_fl) { Field **vfield_ptr, *tmp_vfield; bool bitmap_updated= FALSE; @@ -6554,6 +6570,7 @@ void TABLE::mark_virtual_columns_for_write(bool insert_fl) } if (bitmap_updated) file->column_bitmaps_signal(); + return bitmap_updated; } /* @@ -7247,12 +7264,6 @@ bool is_simple_order(ORDER *order) @details The function computes the values of the virtual columns of the table and stores them in the table record buffer. - If vcol_update_mode is set to VCOL_UPDATE_ALL then all virtual column are - computed. - If vcol_update_mode is set to VCOL_UPDATE_FOR_WRITE then all - fields that are set in vcol_set are updated. - If vcol_update_mode is set to VCOL_UPDATE_FOR_READ then all - fields that are set in vcol_set and are not stored are updated. @retval 0 Success @@ -7265,8 +7276,8 @@ int update_virtual_fields(THD *thd, TABLE *table, { DBUG_ENTER("update_virtual_fields"); Field **vfield_ptr, *vfield; - int error __attribute__ ((unused))= 0; - DBUG_ASSERT(table && table->vfield); + DBUG_ASSERT(table); + DBUG_ASSERT(table->vfield); thd->reset_arena_for_cached_items(table->expr_arena); /* Iterate over virtual fields in the table */ @@ -7276,13 +7287,28 @@ int update_virtual_fields(THD *thd, TABLE *table, Virtual_column_info *vcol_info= vfield->vcol_info; DBUG_ASSERT(vcol_info); DBUG_ASSERT(vcol_info->expr_item); - if ((bitmap_is_set(table->vcol_set, vfield->field_index) && - (vcol_update_mode == VCOL_UPDATE_FOR_WRITE || - !vcol_info->stored_in_db)) || - vcol_update_mode == VCOL_UPDATE_ALL) + + bool update; + switch (vcol_update_mode) { + case VCOL_UPDATE_FOR_READ_WRITE: + if (table->triggers) + { + update= true; + break; + } + case VCOL_UPDATE_FOR_READ: + update= !vcol_info->stored_in_db + && bitmap_is_set(table->vcol_set, vfield->field_index); + break; + case VCOL_UPDATE_FOR_WRITE: + update= table->triggers || bitmap_is_set(table->vcol_set, vfield->field_index); + break; + } + + if (update) { /* Compute the actual value of the virtual fields */ - error= vcol_info->expr_item->save_in_field(vfield, 0); + vcol_info->expr_item->save_in_field(vfield, 0); DBUG_PRINT("info", ("field '%s' - updated", vfield->field_name)); } else diff --git a/sql/table.h b/sql/table.h index cf73a1ca12c..e05fa903773 100644 --- a/sql/table.h +++ b/sql/table.h @@ -326,8 +326,8 @@ enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP }; enum enum_vcol_update_mode { VCOL_UPDATE_FOR_READ= 0, - VCOL_UPDATE_FOR_WRITE, - VCOL_UPDATE_ALL + VCOL_UPDATE_FOR_READ_WRITE, + VCOL_UPDATE_FOR_WRITE }; @@ -1307,7 +1307,7 @@ public: void mark_columns_needed_for_insert(void); void mark_columns_per_binlog_row_image(void); bool mark_virtual_col(Field *field); - void mark_virtual_columns_for_write(bool insert_fl); + bool mark_virtual_columns_for_write(bool insert_fl); void mark_default_fields_for_write(bool insert_fl); void mark_columns_used_by_check_constraints(void); void mark_check_constraint_columns_for_read(void); From 8b6c0542db908bba548bdb217d78bae25d4522ca Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 21 Nov 2016 16:16:52 +0100 Subject: [PATCH 053/135] bugfix: stored column depends on virtual depends on updated TABLE::mark_virtual_col() was polluting table->vcol_set and that confused the following mark_virtual_col() --- mysql-test/suite/vcol/r/update.result | 10 +++++++ mysql-test/suite/vcol/t/update.test | 12 +++++++++ sql/table.cc | 39 +++++++++++++++------------ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 mysql-test/suite/vcol/r/update.result create mode 100644 mysql-test/suite/vcol/t/update.test diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result new file mode 100644 index 00000000000..d56f85c1f1c --- /dev/null +++ b/mysql-test/suite/vcol/r/update.result @@ -0,0 +1,10 @@ +create table t1 (a int, b int as (a+1), c int as (b+1) stored); +insert t1 set a=1; +select * from t1; +a b c +1 2 3 +update t1 set a=2; +select * from t1; +a b c +2 3 4 +drop table t1; diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test new file mode 100644 index 00000000000..35dbab83bfc --- /dev/null +++ b/mysql-test/suite/vcol/t/update.test @@ -0,0 +1,12 @@ +# +# Test how UPDATE detects what columns need to be read (or generated) in a row +# +# stored column depends on virtual column depends on updated column. +# this tests TABLE::mark_virtual_columns_for_write() +# +create table t1 (a int, b int as (a+1), c int as (b+1) stored); +insert t1 set a=1; +select * from t1; +update t1 set a=2; +select * from t1; +drop table t1; diff --git a/sql/table.cc b/sql/table.cc index ad7e3e17cad..8bc2ef35bcf 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6537,7 +6537,7 @@ bool TABLE::mark_virtual_col(Field *field) bool TABLE::mark_virtual_columns_for_write(bool insert_fl) { Field **vfield_ptr, *tmp_vfield; - bool bitmap_updated= FALSE; + bool bitmap_updated= false; for (vfield_ptr= vfield; *vfield_ptr; vfield_ptr++) { @@ -6546,25 +6546,30 @@ bool TABLE::mark_virtual_columns_for_write(bool insert_fl) bitmap_updated= mark_virtual_col(tmp_vfield); else if (tmp_vfield->vcol_info->stored_in_db) { - bool mark_fl= insert_fl; - if (!mark_fl) - { - MY_BITMAP *save_read_set; - Item *vcol_item= tmp_vfield->vcol_info->expr_item; - DBUG_ASSERT(vcol_item); - bitmap_clear_all(&tmp_set); - save_read_set= read_set; - read_set= &tmp_set; - vcol_item->walk(&Item::register_field_in_read_map, 1, 0); - read_set= save_read_set; - bitmap_intersect(&tmp_set, write_set); - mark_fl= !bitmap_is_clear_all(&tmp_set); - } - if (mark_fl) + if (insert_fl) { bitmap_set_bit(write_set, tmp_vfield->field_index); mark_virtual_col(tmp_vfield); - bitmap_updated= TRUE; + bitmap_updated= true; + } + else + { + MY_BITMAP *save_read_set= read_set, *save_vcol_set= vcol_set; + Item *vcol_item= tmp_vfield->vcol_info->expr_item; + DBUG_ASSERT(vcol_item); + bitmap_clear_all(&tmp_set); + read_set= vcol_set= &tmp_set; + vcol_item->walk(&Item::register_field_in_read_map, 1, 0); + read_set= save_read_set; + vcol_set= save_vcol_set; + if (bitmap_is_overlapping(&tmp_set, write_set)) + { + bitmap_set_bit(write_set, tmp_vfield->field_index); + bitmap_set_bit(vcol_set, tmp_vfield->field_index); + bitmap_union(read_set, &tmp_set); + bitmap_union(vcol_set, &tmp_set); + bitmap_updated= true; + } } } } From 9a3ec79b53ea1916211b4134375ebde5fb7c914c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Nov 2016 21:47:48 +0100 Subject: [PATCH 054/135] cleanup: TABLE::update_virtual_fields Make update_virtual_fields() a method of TABLE, to be consistent with TABLE::update_default_fields(). --- sql/filesort.cc | 4 ++-- sql/sql_base.cc | 8 +++---- sql/sql_base.h | 2 -- sql/sql_delete.cc | 2 +- sql/sql_handler.cc | 2 +- sql/sql_join_cache.cc | 6 ++--- sql/sql_select.cc | 6 ++--- sql/sql_table.cc | 4 ++-- sql/sql_update.cc | 6 ++--- sql/table.cc | 38 ++++++++++++++------------------ sql/table.h | 1 + storage/oqgraph/oqgraph_thunk.cc | 12 +++++----- 12 files changed, 43 insertions(+), 48 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index ae51fb94e64..e2f18f99135 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -785,7 +785,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, if ((error= select->quick->get_next())) break; if (!error && sort_form->vfield) - update_virtual_fields(thd, sort_form); + sort_form->update_virtual_fields(VCOL_UPDATE_FOR_READ); file->position(sort_form->record[0]); DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE);); } @@ -794,7 +794,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, { error= file->ha_rnd_next(sort_form->record[0]); if (!error && sort_form->vfield) - update_virtual_fields(thd, sort_form); + sort_form->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (!flag) { my_store_ptr(ref_pos,ref_length,record); // Position to row diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 86f2b24829f..9bd0c062cdc 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7837,7 +7837,7 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, /* Update virtual fields */ thd->abort_on_warning= FALSE; if (vcol_table && vcol_table->vfield && - update_virtual_fields(thd, vcol_table, VCOL_UPDATE_FOR_WRITE)) + vcol_table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= save_abort_on_warning; thd->no_errors= save_no_errors; @@ -7988,7 +7988,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, if (item_field && table->vfield) { DBUG_ASSERT(table == item_field->field->table); - result= update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE); + result= table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); } } } @@ -8081,7 +8081,7 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List &values, /* Update virtual fields */ thd->abort_on_warning= FALSE; if (table->vfield && - update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE)) + table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= abort_on_warning_saved; DBUG_RETURN(thd->is_error()); @@ -8135,7 +8135,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, Field **ptr, { DBUG_ASSERT(table == (*ptr)->table); if (table->vfield) - result= update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE); + result= table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); } return result; diff --git a/sql/sql_base.h b/sql/sql_base.h index bdfbe400e54..2c0e6850d04 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -288,8 +288,6 @@ TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, const char *table_name, bool no_error); -int update_virtual_fields(THD *thd, TABLE *table, - enum enum_vcol_update_mode vcol_update_mode= VCOL_UPDATE_FOR_READ); int dynamic_column_error_message(enum_dyncol_func_result rc); /* open_and_lock_tables with optional derived handling */ diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index a4e43f87bd0..d0da7f9dc2d 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -561,7 +561,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { explain->tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); // thd->is_error() is tested to disallow delete row on error if (!select || select->skip_record(thd) > 0) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 405e7ce8c38..bab33919e03 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -931,7 +931,7 @@ retry: } /* Generate values for virtual fields */ if (table->vfield) - update_virtual_fields(thd, table); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (cond && !cond->val_int()) { if (thd->is_error()) diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index d5883b1304e..71721336722 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -3383,7 +3383,7 @@ int JOIN_TAB_SCAN::next() { join_tab->tracker->r_rows++; if (table->vfield) - update_virtual_fields(thd, table); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } while (!err && select && (skip_rc= select->skip_record(thd)) <= 0) @@ -3399,7 +3399,7 @@ int JOIN_TAB_SCAN::next() { join_tab->tracker->r_rows++; if (table->vfield) - update_virtual_fields(thd, table); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } } @@ -3924,7 +3924,7 @@ int JOIN_TAB_SCAN_MRR::next() (uchar *) (*ptr) <= cache->end_pos); */ if (join_tab->table->vfield) - update_virtual_fields(join->thd, join_tab->table); + join_tab->table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } return rc; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e76b6a5a48a..ed121191209 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -18444,7 +18444,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, join_tab->tracker->r_rows++; if (join_tab->table->vfield) - update_virtual_fields(join->thd, join_tab->table); + join_tab->table->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (select_cond) { @@ -18897,7 +18897,7 @@ join_read_system(JOIN_TAB *tab) return -1; } if (table->vfield) - update_virtual_fields(tab->join->thd, table); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); store_record(table,record[1]); } else if (!table->status) // Only happens with left join @@ -18944,7 +18944,7 @@ join_read_const(JOIN_TAB *tab) return -1; } if (table->vfield) - update_virtual_fields(tab->join->thd, table); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); store_record(table,record[1]); } else if (!(table->status & ~STATUS_NULL_ROW)) // Only happens with left join diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 632290703be..710d7decc25 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9789,7 +9789,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, break; } if (from->vfield) - update_virtual_fields(thd, from); + from->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (++thd->progress.counter >= time_to_report_progress) { time_to_report_progress+= MY_HOW_OFTEN_TO_WRITE/10; @@ -9819,7 +9819,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, if (to->default_field) to->update_default_fields(0, ignore); if (to->vfield) - update_virtual_fields(thd, to, VCOL_UPDATE_FOR_WRITE); + to->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); /* This will set thd->is_error() if fatal failure */ if (to->verify_constraints(ignore) == VIEW_CHECK_SKIP) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 3a4bffeb454..1ae90a31ebf 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -619,7 +619,7 @@ int mysql_update(THD *thd, { explain->buf_tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || (error= select->skip_record(thd)) > 0) { @@ -736,7 +736,7 @@ int mysql_update(THD *thd, { explain->tracker.on_record_read(); if (table->vfield) - update_virtual_fields(thd, table, VCOL_UPDATE_FOR_READ_WRITE); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || select->skip_record(thd) > 0) { @@ -2407,7 +2407,7 @@ int multi_update::do_updates() (error= table->update_default_fields(1, ignore))) goto err2; if (table->vfield && - update_virtual_fields(thd, table, VCOL_UPDATE_FOR_WRITE)) + table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) goto err2; if ((error= cur_table->view_check_option(thd, ignore)) != VIEW_CHECK_OK) diff --git a/sql/table.cc b/sql/table.cc index 8bc2ef35bcf..092ec79f21b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -7262,9 +7262,7 @@ bool is_simple_order(ORDER *order) /* @brief Compute values for virtual columns used in query - @param thd Thread handle - @param table The TABLE object - @param vcol_update_mode Specifies what virtual column are computed + @param update_mode Specifies what virtual column are computed @details The function computes the values of the virtual columns of the table and @@ -7276,52 +7274,50 @@ bool is_simple_order(ORDER *order) >0 Error occurred when storing a virtual field value */ -int update_virtual_fields(THD *thd, TABLE *table, - enum enum_vcol_update_mode vcol_update_mode) +int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) { - DBUG_ENTER("update_virtual_fields"); - Field **vfield_ptr, *vfield; - DBUG_ASSERT(table); - DBUG_ASSERT(table->vfield); + DBUG_ENTER("TABLE::update_virtual_fields"); + Field **vfield_ptr, *vf; + DBUG_ASSERT(vfield); - thd->reset_arena_for_cached_items(table->expr_arena); + in_use->reset_arena_for_cached_items(expr_arena); /* Iterate over virtual fields in the table */ - for (vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) + for (vfield_ptr= vfield; *vfield_ptr; vfield_ptr++) { - vfield= (*vfield_ptr); - Virtual_column_info *vcol_info= vfield->vcol_info; + vf= (*vfield_ptr); + Virtual_column_info *vcol_info= vf->vcol_info; DBUG_ASSERT(vcol_info); DBUG_ASSERT(vcol_info->expr_item); bool update; - switch (vcol_update_mode) { + switch (update_mode) { case VCOL_UPDATE_FOR_READ_WRITE: - if (table->triggers) + if (triggers) { update= true; break; } case VCOL_UPDATE_FOR_READ: update= !vcol_info->stored_in_db - && bitmap_is_set(table->vcol_set, vfield->field_index); + && bitmap_is_set(vcol_set, vf->field_index); break; case VCOL_UPDATE_FOR_WRITE: - update= table->triggers || bitmap_is_set(table->vcol_set, vfield->field_index); + update= triggers || bitmap_is_set(vcol_set, vf->field_index); break; } if (update) { /* Compute the actual value of the virtual fields */ - vcol_info->expr_item->save_in_field(vfield, 0); - DBUG_PRINT("info", ("field '%s' - updated", vfield->field_name)); + vcol_info->expr_item->save_in_field(vf, 0); + DBUG_PRINT("info", ("field '%s' - updated", vf->field_name)); } else { - DBUG_PRINT("info", ("field '%s' - skipped", vfield->field_name)); + DBUG_PRINT("info", ("field '%s' - skipped", vf->field_name)); } } - thd->reset_arena_for_cached_items(0); + in_use->reset_arena_for_cached_items(0); DBUG_RETURN(0); } diff --git a/sql/table.h b/sql/table.h index e05fa903773..14b6a26c650 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1421,6 +1421,7 @@ public: uint actual_n_key_parts(KEY *keyinfo); ulong actual_key_flags(KEY *keyinfo); + int update_virtual_fields(enum_vcol_update_mode update_mode); int update_default_fields(bool update, bool ignore_errors); void reset_default_fields(); inline ha_rows stat_records() { return used_stat_records; } diff --git a/storage/oqgraph/oqgraph_thunk.cc b/storage/oqgraph/oqgraph_thunk.cc index 0ffd5cca414..128e6191d98 100644 --- a/storage/oqgraph/oqgraph_thunk.cc +++ b/storage/oqgraph/oqgraph_thunk.cc @@ -194,7 +194,7 @@ int oqgraph3::cursor::restore_position() } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); table.file->position(table.record[0]); @@ -207,7 +207,7 @@ int oqgraph3::cursor::restore_position() } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); if ((_origid && vertex_id(_graph->_source->val_int()) != *_origid) || (_destid && vertex_id(_graph->_target->val_int()) != *_destid)) @@ -232,7 +232,7 @@ int oqgraph3::cursor::restore_position() } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); } _graph->_cursor= this; @@ -311,7 +311,7 @@ int oqgraph3::cursor::seek_next() } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); _graph->_stale= true; if ((_origid && vertex_id(_graph->_source->val_int()) != *_origid) || @@ -346,7 +346,7 @@ int oqgraph3::cursor::seek_prev() } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); _graph->_stale= true; if ((_origid && vertex_id(_graph->_source->val_int()) != *_origid) || @@ -508,7 +508,7 @@ int oqgraph3::cursor::seek_to( } if (table.vfield) - update_virtual_fields(table.in_use, &table); + table.update_virtual_fields(VCOL_UPDATE_FOR_READ); if ((_origid && vertex_id(_graph->_source->val_int()) != *_origid) || (_destid && vertex_id(_graph->_target->val_int()) != *_destid)) From 65e53c8bc6727c4d5909864052d4c6e6c967e870 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 18 Oct 2016 10:17:55 +0200 Subject: [PATCH 055/135] cleanup: Field_blob::get_ptr() and declare few other Field getters to be 'const' --- sql/field.cc | 11 ++++----- sql/field.h | 46 +++++++++++++++++------------------ sql/sql_insert.cc | 4 +-- sql/sql_join_cache.cc | 2 +- storage/archive/ha_archive.cc | 3 +-- 5 files changed, 30 insertions(+), 36 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 2a807ae599b..be6259e6a11 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7883,7 +7883,7 @@ void Field_blob::store_length(uchar *i_ptr, uint i_packlength, uint32 i_number) } -uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg) +uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg) const { return (uint32)read_lowendian(pos, packlength_arg); } @@ -7898,8 +7898,7 @@ int Field_blob::copy_value(Field_blob *from) DBUG_ASSERT(field_charset == from->charset()); int rc= 0; uint32 length= from->get_length(); - uchar *data; - from->get_ptr(&data); + uchar *data= from->get_ptr(); if (packlength < from->packlength) { set_if_smaller(length, Field_blob::max_data_length()); @@ -8146,7 +8145,7 @@ uint Field_blob::get_key_image(uchar *buff,uint length, imagetype type_arg) bzero(buff, image_length); return image_length; } - get_ptr(&blob); + blob= get_ptr(); gobj= Geometry::construct(&buffer, (char*) blob, blob_length); if (!gobj || gobj->get_mbr(&mbr, &dummy)) bzero(buff, image_length); @@ -8161,7 +8160,7 @@ uint Field_blob::get_key_image(uchar *buff,uint length, imagetype type_arg) } #endif /*HAVE_SPATIAL*/ - get_ptr(&blob); + blob= get_ptr(); uint local_char_length= length / field_charset->mbmaxlen; local_char_length= my_charpos(field_charset, blob, blob + blob_length, local_char_length); @@ -8320,7 +8319,7 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) */ if (length > 0) { - get_ptr((uchar**) &from); + from= get_ptr(); memcpy(to+packlength, from,length); } ptr=save; // Restore org row pointer diff --git a/sql/field.h b/sql/field.h index 52e0d2ea6d7..4292f3ffc8a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1265,7 +1265,7 @@ public: virtual uint max_packed_col_length(uint max_length) { return max_length;} - uint offset(uchar *record) + uint offset(uchar *record) const { return (uint) (ptr - record); } @@ -3266,30 +3266,29 @@ public: { store_length(ptr, packlength, number); } - inline uint32 get_length(uint row_offset= 0) + inline uint32 get_length(uint row_offset= 0) const { return get_length(ptr+row_offset, this->packlength); } - uint32 get_length(const uchar *ptr, uint packlength); - uint32 get_length(const uchar *ptr_arg) + uint32 get_length(const uchar *ptr, uint packlength) const; + uint32 get_length(const uchar *ptr_arg) const { return get_length(ptr_arg, this->packlength); } - inline void get_ptr(uchar **str) - { - memcpy(str, ptr+packlength, sizeof(uchar*)); - } - inline void get_ptr(uchar **str, uint row_offset) - { - memcpy(str, ptr+packlength+row_offset, sizeof(char*)); - } + inline uchar *get_ptr() const { return get_ptr(0); } + inline uchar *get_ptr(my_ptrdiff_t row_offset) const + { + uchar *s; + memcpy(&s, ptr + packlength + row_offset, sizeof(uchar*)); + return s; + } inline void set_ptr(uchar *length, uchar *data) - { - memcpy(ptr,length,packlength); - memcpy(ptr+packlength, &data,sizeof(char*)); - } + { + memcpy(ptr,length,packlength); + memcpy(ptr+packlength, &data,sizeof(char*)); + } void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data) - { - uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*); - store_length(ptr_ofs, packlength, length); - memcpy(ptr_ofs+packlength, &data, sizeof(char*)); - } + { + uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*); + store_length(ptr_ofs, packlength, length); + memcpy(ptr_ofs+packlength, &data, sizeof(char*)); + } inline void set_ptr(uint32 length, uchar *data) { set_ptr_offset(0, length, data); @@ -3303,8 +3302,7 @@ public: void sql_type(String &str) const; inline bool copy() { - uchar *tmp; - get_ptr(&tmp); + uchar *tmp= get_ptr(); if (value.copy((char*) tmp, get_length(), charset())) { Field_blob::reset(); @@ -3320,7 +3318,7 @@ public: uint packed_col_length(const uchar *col_ptr, uint length); uint max_packed_col_length(uint max_length); void free() { value.free(); } - inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); } + inline void clear_temporary() { bzero((uchar*) &value, sizeof(value)); } uint size_of() const { return sizeof(*this); } bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 88787acea18..aa5b5ac756b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3126,9 +3126,7 @@ static void free_delayed_insert_blobs(register TABLE *table) { if ((*ptr)->flags & BLOB_FLAG) { - uchar *str; - ((Field_blob *) (*ptr))->get_ptr(&str); - my_free(str); + my_free(((Field_blob *) (*ptr))->get_ptr()); ((Field_blob *) (*ptr))->reset(); } } diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 71721336722..7c134aba551 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -1304,7 +1304,7 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full) uint blob_len= blob_field->get_length(); (*copy_ptr)->blob_length= blob_len; len+= blob_len; - blob_field->get_ptr(&(*copy_ptr)->str); + (*copy_ptr)->str= blob_field->get_ptr(); } } } diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index c322c8eee54..9d6d100c1b8 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -383,8 +383,7 @@ unsigned int ha_archive::pack_row_v1(uchar *record) uint32 length= ((Field_blob *) table->field[*blob])->get_length(); if (length) { - uchar *data_ptr; - ((Field_blob *) table->field[*blob])->get_ptr(&data_ptr); + uchar *data_ptr= ((Field_blob *) table->field[*blob])->get_ptr(); memcpy(pos, data_ptr, length); pos+= length; } From d4170f64fccb7750dc2dec65e7a008852a7585f7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 19:03:51 +0100 Subject: [PATCH 056/135] cleanup: set_field_ptr() --- sql/ha_partition.cc | 4 +-- sql/sql_partition.cc | 61 ++++++++++---------------------------------- sql/sql_partition.h | 1 - sql/table.cc | 12 +++++++++ sql/table.h | 2 ++ 5 files changed, 30 insertions(+), 50 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 31cffe75e55..a54d406f9eb 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -7959,7 +7959,7 @@ void ha_partition::append_row_to_str(String &str) { Field **field_ptr; if (!is_rec0) - set_field_ptr(m_part_info->full_part_field_array, rec, + table->move_fields(m_part_info->full_part_field_array, rec, table->record[0]); /* No primary key, use full partition field array. */ for (field_ptr= m_part_info->full_part_field_array; @@ -7973,7 +7973,7 @@ void ha_partition::append_row_to_str(String &str) field_unpack(&str, field, rec, 0, false); } if (!is_rec0) - set_field_ptr(m_part_info->full_part_field_array, table->record[0], + table->move_fields(m_part_info->full_part_field_array, table->record[0], rec); } } diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a2bc5000ec6..09dbf9d76af 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -293,10 +293,10 @@ int get_parts_for_update(const uchar *old_data, uchar *new_data, DBUG_ENTER("get_parts_for_update"); DBUG_ASSERT(new_data == rec0); // table->record[0] - set_field_ptr(part_field_array, old_data, rec0); + part_info->table->move_fields(part_field_array, old_data, rec0); error= part_info->get_partition_id(part_info, old_part_id, &old_func_value); - set_field_ptr(part_field_array, rec0, old_data); + part_info->table->move_fields(part_field_array, rec0, old_data); if (unlikely(error)) // Should never happen { DBUG_ASSERT(0); @@ -321,10 +321,10 @@ int get_parts_for_update(const uchar *old_data, uchar *new_data, future use. It will be tested by ensuring that the above condition is false in one test situation before pushing the code. */ - set_field_ptr(part_field_array, new_data, rec0); + part_info->table->move_fields(part_field_array, new_data, rec0); error= part_info->get_partition_id(part_info, new_part_id, new_func_value); - set_field_ptr(part_field_array, rec0, new_data); + part_info->table->move_fields(part_field_array, rec0, new_data); if (unlikely(error)) { DBUG_RETURN(error); @@ -375,9 +375,9 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0, else { Field **part_field_array= part_info->full_part_field_array; - set_field_ptr(part_field_array, buf, rec0); + part_info->table->move_fields(part_field_array, buf, rec0); error= part_info->get_partition_id(part_info, part_id, &func_value); - set_field_ptr(part_field_array, rec0, buf); + part_info->table->move_fields(part_field_array, rec0, buf); if (unlikely(error)) { DBUG_RETURN(error); @@ -3787,9 +3787,9 @@ static int get_sub_part_id_from_key(const TABLE *table,uchar *buf, else { Field **part_field_array= part_info->subpart_field_array; - set_field_ptr(part_field_array, buf, rec0); + part_info->table->move_fields(part_field_array, buf, rec0); res= part_info->get_subpartition_id(part_info, part_id); - set_field_ptr(part_field_array, rec0, buf); + part_info->table->move_fields(part_field_array, rec0, buf); } DBUG_RETURN(res); } @@ -3833,10 +3833,10 @@ bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info, else { Field **part_field_array= part_info->part_field_array; - set_field_ptr(part_field_array, buf, rec0); + part_info->table->move_fields(part_field_array, buf, rec0); result= part_info->get_part_partition_id(part_info, part_id, &func_value); - set_field_ptr(part_field_array, rec0, buf); + part_info->table->move_fields(part_field_array, rec0, buf); } DBUG_RETURN(result); } @@ -3882,10 +3882,10 @@ void get_full_part_id_from_key(const TABLE *table, uchar *buf, else { Field **part_field_array= part_info->full_part_field_array; - set_field_ptr(part_field_array, buf, rec0); + part_info->table->move_fields(part_field_array, buf, rec0); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); - set_field_ptr(part_field_array, rec0, buf); + part_info->table->move_fields(part_field_array, rec0, buf); } part_spec->end_part= part_spec->start_part; if (unlikely(result)) @@ -3935,7 +3935,7 @@ bool verify_data_with_partition(TABLE *table, TABLE *part_table, bitmap_union(table->read_set, &part_info->full_part_field_set); old_rec= part_table->record[0]; part_table->record[0]= table->record[0]; - set_field_ptr(part_info->full_part_field_array, table->record[0], old_rec); + part_info->table->move_fields(part_info->full_part_field_array, table->record[0], old_rec); if ((error= file->ha_rnd_init(TRUE))) { file->print_error(error, MYF(0)); @@ -3970,7 +3970,7 @@ bool verify_data_with_partition(TABLE *table, TABLE *part_table, } while (TRUE); (void) file->ha_rnd_end(); err: - set_field_ptr(part_info->full_part_field_array, old_rec, + part_info->table->move_fields(part_info->full_part_field_array, old_rec, table->record[0]); part_table->record[0]= old_rec; if (error) @@ -7211,39 +7211,6 @@ err: } #endif - -/* - Prepare for calling val_int on partition function by setting fields to - point to the record where the values of the PF-fields are stored. - - SYNOPSIS - set_field_ptr() - ptr Array of fields to change ptr - new_buf New record pointer - old_buf Old record pointer - - DESCRIPTION - Set ptr in field objects of field array to refer to new_buf record - instead of previously old_buf. Used before calling val_int and after - it is used to restore pointers to table->record[0]. - This routine is placed outside of partition code since it can be useful - also for other programs. -*/ - -void set_field_ptr(Field **ptr, const uchar *new_buf, - const uchar *old_buf) -{ - my_ptrdiff_t diff= (new_buf - old_buf); - DBUG_ENTER("set_field_ptr"); - - do - { - (*ptr)->move_field_offset(diff); - } while (*(++ptr)); - DBUG_VOID_RETURN; -} - - /* Prepare for calling val_int on partition function by setting fields to point to the record where the values of the PF-fields are stored. diff --git a/sql/sql_partition.h b/sql/sql_partition.h index b225c14fc53..c2665a8366b 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -288,7 +288,6 @@ void create_subpartition_name(char *out, const char *in1, const char *in2, const char *in3, uint name_variant); -void set_field_ptr(Field **ptr, const uchar *new_buf, const uchar *old_buf); void set_key_field_ptr(KEY *key_info, const uchar *new_buf, const uchar *old_buf); diff --git a/sql/table.cc b/sql/table.cc index 092ec79f21b..3ca391d3538 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6633,6 +6633,18 @@ void TABLE::mark_default_fields_for_write(bool is_insert) DBUG_VOID_RETURN; } +void TABLE::move_fields(Field **ptr, const uchar *to, const uchar *from) +{ + my_ptrdiff_t diff= to - from; + if (diff) + { + do + { + (*ptr)->move_field_offset(diff); + } while (*(++ptr)); + } +} + /** @brief diff --git a/sql/table.h b/sql/table.h index 14b6a26c650..cd2d3af95ad 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1419,6 +1419,8 @@ public: my_ptrdiff_t default_values_offset() const { return (my_ptrdiff_t) (s->default_values - record[0]); } + void move_fields(Field **ptr, const uchar *to, const uchar *from); + uint actual_n_key_parts(KEY *keyinfo); ulong actual_key_flags(KEY *keyinfo); int update_virtual_fields(enum_vcol_update_mode update_mode); From acfc3ba54ba0eb2e11fe909c7d638e1e0c810dc2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 11 Nov 2016 13:31:34 +0100 Subject: [PATCH 057/135] cleanup: remove ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED --- sql/sql_class.cc | 179 ----------------------------------------------- 1 file changed, 179 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 86090e251e9..88534e78c10 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -267,185 +267,6 @@ bool Foreign_key::validate(List &table_fields) /**************************************************************************** ** Thread specific functions ****************************************************************************/ -#ifdef ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED -/** - Get reference to scheduler data object - - @param thd THD object - - @retval Scheduler data object on THD -*/ -void *thd_get_scheduler_data(THD *thd) -{ - return thd->scheduler.data; -} - -/** - Set reference to Scheduler data object for THD object - - @param thd THD object - @param psi Scheduler data object to set on THD -*/ -void thd_set_scheduler_data(THD *thd, void *data) -{ - thd->scheduler.data= data; -} - -/** - Get reference to Performance Schema object for THD object - - @param thd THD object - - @retval Performance schema object for thread on THD -*/ -PSI_thread *thd_get_psi(THD *thd) -{ - return thd->scheduler.m_psi; -} - -/** - Get net_wait_timeout for THD object - - @param thd THD object - - @retval net_wait_timeout value for thread on THD -*/ -ulong thd_get_net_wait_timeout(THD* thd) -{ - return thd->variables.net_wait_timeout; -} - -/** - Set reference to Performance Schema object for THD object - - @param thd THD object - @param psi Performance schema object for thread -*/ -void thd_set_psi(THD *thd, PSI_thread *psi) -{ - thd->scheduler.m_psi= psi; -} - -/** - Set the state on connection to killed - - @param thd THD object -*/ -void thd_set_killed(THD *thd) -{ - thd->killed= KILL_CONNECTION; -} - -/** - Set thread stack in THD object - - @param thd Thread object - @param stack_start Start of stack to set in THD object -*/ -void thd_set_thread_stack(THD *thd, char *stack_start) -{ - thd->thread_stack= stack_start; -} - -/** - Close the socket used by this connection - - @param thd THD object -*/ -void thd_close_connection(THD *thd) -{ - if (thd->net.vio) - vio_close(thd->net.vio); -} - -/** - Lock data that needs protection in THD object - - @param thd THD object -*/ -void thd_lock_data(THD *thd) -{ - mysql_mutex_lock(&thd->LOCK_thd_data); -} - -/** - Unlock data that needs protection in THD object - - @param thd THD object -*/ -void thd_unlock_data(THD *thd) -{ - mysql_mutex_unlock(&thd->LOCK_thd_data); -} - -/** - Support method to check if connection has already started transcaction - - @param client_cntx Low level client context - - @retval TRUE if connection already started transaction -*/ -bool thd_is_transaction_active(THD *thd) -{ - return thd->transaction.is_active(); -} - -/** - Check if there is buffered data on the socket representing the connection - - @param thd THD object -*/ -int thd_connection_has_data(THD *thd) -{ - Vio *vio= thd->net.vio; - return vio->has_data(vio); -} - -/** - Set reading/writing on socket, used by SHOW PROCESSLIST - - @param thd THD object - @param val Value to set it to (0 or 1) -*/ -void thd_set_net_read_write(THD *thd, uint val) -{ - thd->net.reading_or_writing= val; -} - -/** - Get reading/writing on socket from THD object - @param thd THD object - - @retval net.reading_or_writing value for thread on THD. -*/ -uint thd_get_net_read_write(THD *thd) -{ - return thd->net.reading_or_writing; -} - -/** - Set reference to mysys variable in THD object - - @param thd THD object - @param mysys_var Reference to set -*/ -void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var) -{ - thd->set_mysys_var(mysys_var); -} - -/** - Get socket file descriptor for this connection - - @param thd THD object - - @retval Socket of the connection -*/ -my_socket thd_get_fd(THD *thd) -{ - return mysql_socket_getfd(thd->net.vio->mysql_socket); -} -#endif /* ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED */ /** Get current THD object from thread local data From b634bd50edbef972294e970f800a957ac7f0200d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 24 Nov 2016 14:55:01 +0100 Subject: [PATCH 058/135] cleanup: move all Item processors together --- sql/item.h | 161 +++++++++++++++++------------------------------------ 1 file changed, 52 insertions(+), 109 deletions(-) diff --git a/sql/item.h b/sql/item.h index f5b64be1672..556a03076c8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1522,58 +1522,41 @@ public: (*traverser)(this, arg); } - virtual bool remove_dependence_processor(void * arg) { return 0; } + /*========= Item processors, to be used with Item::walk() ========*/ + virtual bool remove_dependence_processor(void *arg) { return 0; } virtual bool cleanup_processor(void *arg); - virtual bool collect_item_field_processor(void * arg) { return 0; } - virtual bool add_field_to_set_processor(void * arg) { return 0; } + virtual bool cleanup_excluding_const_fields_processor(void *arg) { return cleanup_processor(arg); } + virtual bool collect_item_field_processor(void *arg) { return 0; } + virtual bool collect_outer_ref_processor(void *arg) {return 0; } + virtual bool check_inner_refs_processor(void *arg) { return 0; } virtual bool find_item_in_field_list_processor(void *arg) { return 0; } virtual bool find_item_processor(void *arg); - virtual bool change_context_processor(void *context) { return 0; } - virtual bool reset_query_id_processor(void *query_id_arg) { return 0; } + virtual bool change_context_processor(void *arg) { return 0; } + virtual bool reset_query_id_processor(void *arg) { return 0; } virtual bool is_expensive_processor(void *arg) { return 0; } + + // FIXME reduce the number of "add field to bitmap" processors + virtual bool add_field_to_set_processor(void *arg) { return 0; } virtual bool register_field_in_read_map(void *arg) { return 0; } virtual bool register_field_in_write_map(void *arg) { return 0; } + virtual bool register_field_in_bitmap(void *arg) { return 0; } + virtual bool update_table_bitmaps_processor(void *arg) { return 0; } + virtual bool enumerate_field_refs_processor(void *arg) { return 0; } virtual bool mark_as_eliminated_processor(void *arg) { return 0; } virtual bool eliminate_subselect_processor(void *arg) { return 0; } virtual bool set_fake_select_as_master_processor(void *arg) { return 0; } - virtual bool update_table_bitmaps_processor(void *arg) { return 0; } virtual bool view_used_tables_processor(void *arg) { return 0; } - virtual bool eval_not_null_tables(void *opt_arg) { return 0; } - virtual bool is_subquery_processor (void *opt_arg) { return 0; } + virtual bool eval_not_null_tables(void *arg) { return 0; } + virtual bool is_subquery_processor(void *arg) { return 0; } virtual bool count_sargable_conds(void *arg) { return 0; } - virtual bool limit_index_condition_pushdown_processor(void *opt_arg) - { - return FALSE; - } - virtual bool exists2in_processor(void *opt_arg) { return 0; } - virtual bool find_selective_predicates_list_processor(void *opt_arg) - { return 0; } - virtual bool exclusive_dependence_on_table_processor(void *map) - { return 0; } - virtual bool exclusive_dependence_on_grouping_fields_processor(void *arg) - { return 0; } - virtual bool cleanup_excluding_const_fields_processor(void *arg) - { return cleanup_processor(arg); } - - virtual Item *get_copy(THD *thd, MEM_ROOT *mem_root)=0; - - /* To call bool function for all arguments */ - struct bool_func_call_args - { - Item *original_func_item; - void (Item::*bool_function)(); - }; - - /* - The next function differs from the previous one that a bitmap to be updated - is passed as uchar *arg. - */ - virtual bool register_field_in_bitmap(void *arg) { return 0; } - - bool cache_const_expr_analyzer(uchar **arg); - Item* cache_const_expr_transformer(THD *thd, uchar *arg); - + virtual bool limit_index_condition_pushdown_processor(void *arg) { return 0; } + virtual bool exists2in_processor(void *arg) { return 0; } + virtual bool find_selective_predicates_list_processor(void *arg) { return 0; } + virtual bool exclusive_dependence_on_table_processor(void *arg) { return 0; } + virtual bool exclusive_dependence_on_grouping_fields_processor(void *arg) { return 0; } + virtual bool switch_to_nullable_fields_processor(void *arg) { return 0; } + virtual bool find_function_processor (void *arg) { return 0; } /* Check if a partition function is allowed SYNOPSIS @@ -1625,21 +1608,39 @@ public: assumes that there are no multi-byte collations amongst the partition fields. */ - virtual bool check_partition_func_processor(void *bool_arg) { return TRUE;} - /* - @brief - Processor used to mark virtual columns used in partitioning expression + virtual bool check_partition_func_processor(void *arg) { return 1;} + virtual bool vcol_in_partition_func_processor(void *arg) { return 0; } + /** Processor used to check acceptability of an item in the defining + expression for a virtual column - @param - arg always ignored + @param arg always ignored - @retval - FALSE always + @retval 0 the item is accepted in the definition of a virtual column + @retval 1 otherwise */ - virtual bool vcol_in_partition_func_processor(void *arg) + struct vcol_func_processor_result { - return FALSE; + uint errors; /* Bits of possible errors */ + const char *name; /* Not supported function */ + }; + virtual bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE); } + virtual bool check_field_expression_processor(void *arg) { return 0; } + + /* + Check if an expression value has allowed arguments, like DATE/DATETIME + for date functions. Also used by partitioning code to reject + timezone-dependent expressions in a (sub)partitioning function. + */ + virtual bool check_valid_arguments_processor(void *arg) { return 0; } + /*============== End of Item processor list ======================*/ + + virtual Item *get_copy(THD *thd, MEM_ROOT *mem_root)=0; + + bool cache_const_expr_analyzer(uchar **arg); + Item* cache_const_expr_transformer(THD *thd, uchar *arg); virtual Item* propagate_equal_fields(THD*, const Context &, COND_EQUAL *) { @@ -1651,42 +1652,9 @@ public: COND_EQUAL *cond, Item **place); - /* - @brief - Processor used to check acceptability of an item in the defining - expression for a virtual column - - @param - arg always ignored - - @retval - FALSE the item is accepted in the definition of a virtual column - @retval - TRUE otherwise - */ - struct vcol_func_processor_result - { - uint errors; /* Bits of possible errors */ - const char *name; /* Not supported function */ - }; - virtual bool check_vcol_func_processor(void *arg) - { - return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE); - } - - virtual bool check_field_expression_processor(void *arg) { return FALSE; } - /* arg points to REPLACE_EQUAL_FIELD_ARG object */ virtual Item *replace_equal_field(THD *thd, uchar *arg) { return this; } - /* - Check if an expression value has allowed arguments, like DATE/DATETIME - for date functions. Also used by partitioning code to reject - timezone-dependent expressions in a (sub)partitioning function. - */ - virtual bool check_valid_arguments_processor(void *bool_arg) - { - return FALSE; - } + struct Collect_deps_prm { List *parameters; @@ -1696,31 +1664,6 @@ public: int nest_level; bool collect; }; - /** - Collect outer references - */ - virtual bool collect_outer_ref_processor(void *arg) {return FALSE; } - - /** - Find a function of a given type - - @param arg the function type to search (enum Item_func::Functype) - @return - @retval TRUE the function type we're searching for is found - @retval FALSE the function type wasn't found - - @description - This function can be used (together with Item::walk()) to find functions - in an item tree fragment. - */ - virtual bool find_function_processor (void *arg) - { - return FALSE; - } - - virtual bool check_inner_refs_processor(void *arg) { return FALSE; } - - virtual bool switch_to_nullable_fields_processor(void *arg) { return FALSE; } /* For SP local variable returns pointer to Item representing its From 961fc6a673ea3691f41f3d1f9eabfac799047fc4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 24 Nov 2016 16:08:35 +0100 Subject: [PATCH 059/135] cleanup: T_REP/T_REP_BY_SORT/T_REP_PARALLEL in MyISAM always set them according to the repair method used --- storage/myisam/ha_myisam.cc | 4 ++-- storage/myisam/mi_check.c | 8 ++++---- storage/myisam/myisamchk.c | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index b5371a2b0c3..dbb72eac4c5 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1031,9 +1031,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) continue; } param.testflag&= ~T_QUICK; - if ((param.testflag & T_REP_BY_SORT)) + if ((param.testflag & (T_REP_BY_SORT | T_REP_PARALLEL))) { - param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP; + param.testflag= (param.testflag & ~T_REP_ANY) | T_REP; sql_print_information("Retrying repair of: '%s' with keycache", table->s->path.str); continue; diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 57ac5bdca97..99d90e5648b 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2207,7 +2207,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info, printf("- recovering (with sort) MyISAM-table '%s'\n",name); printf("Data records: %s\n", llstr(start_records,llbuff)); } - param->testflag|=T_REP; /* for easy checking */ + param->testflag|=T_REP_BY_SORT; /* for easy checking */ param->retry_repair= 0; param->warning_printed= param->error_printed= param->note_printed= 0; @@ -2637,7 +2637,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, printf("- parallel recovering (with sort) MyISAM-table '%s'\n",name); printf("Data records: %s\n", llstr(start_records,llbuff)); } - param->testflag|=T_REP; /* for easy checking */ + param->testflag|=T_REP_PARALLEL; /* for easy checking */ param->retry_repair= 0; param->warning_printed= 0; param->error_printed= 0; @@ -3555,7 +3555,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) if (sort_param->calc_checksum) info->checksum= (*info->s->calc_check_checksum)(info, sort_param->record); - if ((param->testflag & (T_EXTEND | T_REP)) || searching) + if ((param->testflag & (T_EXTEND | T_REP_ANY)) || searching) { if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff, sort_param->find_length, @@ -4509,7 +4509,7 @@ void update_auto_increment_key(HA_CHECK *param, MI_INFO *info, DBUG_VOID_RETURN; } if (!(param->testflag & T_SILENT) && - !(param->testflag & T_REP)) + !(param->testflag & T_REP_ANY)) printf("Updating MyISAM file: %s\n", param->isam_file_name); /* We have to use an allocated buffer instead of info->rec_buff as diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 7835ab83531..c206b562d72 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -94,11 +94,10 @@ int main(int argc, char **argv) (void) fflush(stderr); if ((check_param.error_printed | check_param.warning_printed) && (check_param.testflag & T_FORCE_CREATE) && - (!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS | - T_SORT_INDEX)))) + (!(check_param.testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX)))) { ulonglong old_testflag=check_param.testflag; - if (!(check_param.testflag & T_REP)) + if (!(check_param.testflag & T_REP_ANY)) check_param.testflag|= T_REP_BY_SORT; check_param.testflag&= ~T_EXTEND; /* Don't needed */ error|=myisamchk(&check_param, argv[-1]); @@ -1067,7 +1066,7 @@ static int myisamchk(HA_CHECK *param, char * filename) error=mi_sort_records(param,info,filename,param->opt_sort_key, /* what is the following parameter for ? */ - (my_bool) !(param->testflag & T_REP), + (my_bool) !(param->testflag & T_REP_ANY), update_index); datafile=info->dfile; /* This is now locked */ if (!error && !update_index) From 5d6aab809d9c22f0c489fd3e060f7cde5f8264fa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 11 Mar 2016 13:40:31 +0100 Subject: [PATCH 060/135] cleanup: minor issues in MyISAM --- include/myisamchk.h | 8 ------- storage/myisam/mi_check.c | 24 ++++++++----------- storage/myisam/mi_delete.c | 2 +- storage/myisam/mi_open.c | 47 +++++++++++++++++++------------------- storage/myisam/myisamchk.c | 18 ++++++++------- 5 files changed, 44 insertions(+), 55 deletions(-) diff --git a/include/myisamchk.h b/include/myisamchk.h index 64724de1789..e833a816b05 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -16,14 +16,6 @@ /* Definitions needed for myisamchk/mariachk.c */ -/* - Entries marked as "QQ to be removed" are NOT used to - pass check/repair options to xxx_check.c. They are used - internally by xxxchk.c or/and ha_xxxx.cc and should NOT - be stored together with other flags. They should be removed - from the following list to make addition of new flags possible. -*/ - #ifndef _myisamchk_h #define _myisamchk_h diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 99d90e5648b..c8e6bc3cd76 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -3268,12 +3268,9 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) sort_param->max_pos=(sort_param->pos+=share->base.pack_reclength); if (*sort_param->record) { - if (sort_param->calc_checksum) - param->glob_crc+= (info->checksum= - (*info->s->calc_check_checksum)(info, - sort_param-> - record)); - DBUG_RETURN(0); + if (sort_param->calc_checksum) + info->checksum= (*info->s->calc_check_checksum)(info, sort_param->record); + goto finish; } if (!sort_param->fix_datafile && sort_param->master) { @@ -3568,9 +3565,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) goto try_next; } } - if (sort_param->calc_checksum) - param->glob_crc+= info->checksum; - DBUG_RETURN(0); + goto finish; } if (!searching) mi_check_print_info(param,"Key %d - Found wrong stored record at %s", @@ -3639,11 +3634,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) block_info.rec_len); info->packed_length=block_info.rec_len; if (sort_param->calc_checksum) - param->glob_crc+= (info->checksum= - (*info->s->calc_check_checksum)(info, - sort_param-> - record)); - DBUG_RETURN(0); + info->checksum= (*info->s->calc_check_checksum)(info, sort_param->record); + goto finish; } default: DBUG_ASSERT(0); /* Impossible */ @@ -3651,6 +3643,10 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) } DBUG_ASSERT(0); /* Impossible */ DBUG_RETURN(1); /* Impossible */ +finish: + if (sort_param->calc_checksum) + param->glob_crc+= info->checksum; + DBUG_RETURN(0); } diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index 6a023f35b88..99185844b72 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -326,7 +326,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, { DBUG_PRINT("error",("Didn't find key")); mi_print_error(info->s, HA_ERR_CRASHED); - my_errno=HA_ERR_CRASHED; /* This should newer happend */ + my_errno=HA_ERR_CRASHED; /* This should never happend */ goto err; } save_flag=0; diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 9c3a6bf5a2f..6bf16f6a426 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -334,15 +334,15 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) uint32 ftkey_nr= 1; for (i=0 ; i < keys ; i++) { - share->keyinfo[i].share= share; - disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]); - disk_pos_assert(disk_pos + share->keyinfo[i].keysegs * HA_KEYSEG_SIZE, - end_pos); - if (share->keyinfo[i].key_alg == HA_KEY_ALG_RTREE) + MI_KEYDEF *keyinfo= share->keyinfo + i; + keyinfo->share= share; + disk_pos=mi_keydef_read(disk_pos, keyinfo); + disk_pos_assert(disk_pos + keyinfo->keysegs * HA_KEYSEG_SIZE, end_pos); + if (keyinfo->key_alg == HA_KEY_ALG_RTREE) have_rtree=1; - set_if_smaller(share->blocksize,share->keyinfo[i].block_length); - share->keyinfo[i].seg=pos; - for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++) + set_if_smaller(share->blocksize, keyinfo->block_length); + keyinfo->seg= pos; + for (j=0 ; j < keyinfo->keysegs; j++,pos++) { disk_pos=mi_keyseg_read(disk_pos, pos); if (pos->flag & HA_BLOB_PART && @@ -366,36 +366,36 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } else if (pos->type == HA_KEYTYPE_BINARY) pos->charset= &my_charset_bin; - if (!(share->keyinfo[i].flag & HA_SPATIAL) && + if (!(keyinfo->flag & HA_SPATIAL) && pos->start > share->base.reclength) { my_errno= HA_ERR_CRASHED; goto err; } } - if (share->keyinfo[i].flag & HA_SPATIAL) + if (keyinfo->flag & HA_SPATIAL) { #ifdef HAVE_SPATIAL - uint sp_segs=SPDIMS*2; - share->keyinfo[i].seg= pos - sp_segs; - DBUG_ASSERT(share->keyinfo[i].keysegs == sp_segs + 1); - share->keyinfo[i].keysegs= sp_segs; + uint sp_segs= SPDIMS*2; + keyinfo->seg= pos - sp_segs; + DBUG_ASSERT(keyinfo->keysegs == sp_segs + 1); + keyinfo->keysegs= sp_segs; #else my_errno=HA_ERR_UNSUPPORTED; goto err; #endif } - else if (share->keyinfo[i].flag & HA_FULLTEXT) + else if (keyinfo->flag & HA_FULLTEXT) { if (!fulltext_keys) { /* 4.0 compatibility code, to be removed in 5.0 */ - share->keyinfo[i].seg=pos-FT_SEGS; - share->keyinfo[i].keysegs-=FT_SEGS; + keyinfo->seg= pos - FT_SEGS; + keyinfo->keysegs-= FT_SEGS; } else { uint k; - share->keyinfo[i].seg=pos; + keyinfo->seg= pos; for (k=0; k < FT_SEGS; k++) { *pos= ft_keysegs[k]; @@ -410,7 +410,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } if (!share->ft2_keyinfo.seg) { - memcpy(& share->ft2_keyinfo, & share->keyinfo[i], sizeof(MI_KEYDEF)); + memcpy(& share->ft2_keyinfo, keyinfo, sizeof(MI_KEYDEF)); share->ft2_keyinfo.keysegs=1; share->ft2_keyinfo.flag=0; share->ft2_keyinfo.keylength= @@ -420,10 +420,10 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->ft2_keyinfo.end=pos; setup_key_functions(& share->ft2_keyinfo); } - share->keyinfo[i].ftkey_nr= ftkey_nr++; + keyinfo->ftkey_nr= ftkey_nr++; } - setup_key_functions(share->keyinfo+i); - share->keyinfo[i].end=pos; + setup_key_functions(keyinfo); + keyinfo->end= pos; pos->type=HA_KEYTYPE_END; /* End */ pos->length=share->base.rec_reflength; pos->null_bit=0; @@ -747,7 +747,7 @@ uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf) newptr-= MI_REC_BUFF_OFFSET; if (!(newptr=(uchar*) my_realloc((uchar*)newptr, length+extra+8, MYF(MY_ALLOW_ZERO_PTR)))) - return newptr; + return NULL; *((uint32 *) newptr)= (uint32) length; *buf= newptr+(extra ? MI_REC_BUFF_OFFSET : 0); } @@ -1390,4 +1390,3 @@ int mi_indexes_are_disabled(MI_INFO *info) */ return 2; } - diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index c206b562d72..7a4f9960af6 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -819,20 +819,22 @@ static int myisamchk(HA_CHECK *param, char * filename) char llbuff[22],llbuff2[22]; my_bool state_updated=0; MYISAM_SHARE *share; + int open_mode; + uint open_flags= HA_OPEN_FOR_REPAIR; DBUG_ENTER("myisamchk"); param->out_flag=error=param->warning_printed=param->error_printed= recreate=0; datafile=0; param->isam_file_name=filename; /* For error messages */ - if (!(info=mi_open(filename, - (param->testflag & (T_DESCRIPT | T_READONLY)) ? - O_RDONLY : O_RDWR, - HA_OPEN_FOR_REPAIR | - ((param->testflag & T_WAIT_FOREVER) ? - HA_OPEN_WAIT_IF_LOCKED : - (param->testflag & T_DESCRIPT) ? - HA_OPEN_IGNORE_IF_LOCKED : HA_OPEN_ABORT_IF_LOCKED)))) + open_mode= param->testflag & (T_DESCRIPT | T_READONLY) ? O_RDONLY : O_RDWR; + if (param->testflag & T_WAIT_FOREVER) + open_flags|= HA_OPEN_WAIT_IF_LOCKED; + else if (param->testflag & T_DESCRIPT) + open_flags|= HA_OPEN_IGNORE_IF_LOCKED; + else + open_flags|= HA_OPEN_ABORT_IF_LOCKED; + if (!(info=mi_open(filename, open_mode, open_flags))) { /* Avoid twice printing of isam file name */ param->error_printed=1; From 2cdcf141f516b0fd0c1edaccd2f5047a488a9c9d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 11 Mar 2016 13:46:46 +0100 Subject: [PATCH 061/135] make myisamchk -d ignore HA_CREATE_RELIES_ON_SQL_LAYER because it's only doing to show the table structure, not look at the data. --- storage/myisam/myisamchk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 7a4f9960af6..68c91154505 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -831,7 +831,7 @@ static int myisamchk(HA_CHECK *param, char * filename) if (param->testflag & T_WAIT_FOREVER) open_flags|= HA_OPEN_WAIT_IF_LOCKED; else if (param->testflag & T_DESCRIPT) - open_flags|= HA_OPEN_IGNORE_IF_LOCKED; + open_flags|= HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_FROM_SQL_LAYER; else open_flags|= HA_OPEN_ABORT_IF_LOCKED; if (!(info=mi_open(filename, open_mode, open_flags))) From c2b2cb8acd7fd8b84f5929f9c7b52961973c9b9f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 24 Nov 2016 16:07:19 +0100 Subject: [PATCH 062/135] TABLE::update_virtual_field to compute just one vcol will be used later by storage engines (e.g. in MyISAM repair or in InnoDB purge) --- sql/item.cc | 12 ++++++++++++ sql/item.h | 4 ++++ sql/table.cc | 12 ++++++++++++ sql/table.h | 1 + 4 files changed, 29 insertions(+) diff --git a/sql/item.cc b/sql/item.cc index 567ad643050..546300defcd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -985,6 +985,18 @@ bool Item_field::check_field_expression_processor(void *arg) return 0; } +bool Item_field::update_vcol_processor(void *arg) +{ + MY_BITMAP *map= (MY_BITMAP *) arg; + if (field->vcol_info && + !bitmap_fast_test_and_set(map, field->field_index)) + { + field->vcol_info->expr_item->walk(&Item::update_vcol_processor, 0, arg); + field->vcol_info->expr_item->save_in_field(field, 0); + } + return 0; +} + bool Item::check_cols(uint c) { diff --git a/sql/item.h b/sql/item.h index 556a03076c8..5129d8bfe85 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1635,6 +1635,7 @@ public: timezone-dependent expressions in a (sub)partitioning function. */ virtual bool check_valid_arguments_processor(void *arg) { return 0; } + virtual bool update_vcol_processor(void *arg) { return 0; } /*============== End of Item processor list ======================*/ virtual Item *get_copy(THD *thd, MEM_ROOT *mem_root)=0; @@ -2580,6 +2581,7 @@ public: bool enumerate_field_refs_processor(void *arg); bool update_table_bitmaps_processor(void *arg); bool switch_to_nullable_fields_processor(void *arg); + bool update_vcol_processor(void *arg); bool check_vcol_func_processor(void *arg) { return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF); @@ -5091,6 +5093,7 @@ public: } table_map used_tables() const { return (table_map)0L; } Item_field *field_for_view_update() { return 0; } + bool update_vcol_processor(void *arg) { return 0; } bool walk(Item_processor processor, bool walk_subquery, void *args) { @@ -5170,6 +5173,7 @@ public: (this->*processor)(args); } bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool update_vcol_processor(void *arg) { return 0; } bool check_vcol_func_processor(void *arg) { return mark_unsupported_function("values()", arg, VCOL_IMPOSSIBLE); diff --git a/sql/table.cc b/sql/table.cc index 3ca391d3538..7c47aff078e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -7333,6 +7333,18 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) DBUG_RETURN(0); } +int TABLE::update_virtual_field(Field *vf) +{ + DBUG_ENTER("TABLE::update_virtual_field"); + + in_use->reset_arena_for_cached_items(expr_arena); + bitmap_clear_all(&tmp_set); + vf->vcol_info->expr_item->walk(&Item::update_vcol_processor, 0, &tmp_set); + vf->vcol_info->expr_item->save_in_field(vf, 0); + in_use->reset_arena_for_cached_items(0); + DBUG_RETURN(0); +} + /** Update all DEFAULT and/or ON INSERT fields. diff --git a/sql/table.h b/sql/table.h index cd2d3af95ad..34da450fe44 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1423,6 +1423,7 @@ public: uint actual_n_key_parts(KEY *keyinfo); ulong actual_key_flags(KEY *keyinfo); + int update_virtual_field(Field *vf); int update_virtual_fields(enum_vcol_update_mode update_mode); int update_default_fields(bool update, bool ignore_errors); void reset_default_fields(); From 4136968ca0910c1e4fc0191a659fbdc113fbf709 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 15 Oct 2016 23:53:14 +0200 Subject: [PATCH 063/135] enable spatial indexes in innodb vcol tests --- mysql-test/suite/vcol/r/vcol_keys_innodb.result | 7 +++++++ mysql-test/suite/vcol/t/vcol_keys_innodb.test | 3 +-- mysql-test/suite/vcol/t/vcol_keys_myisam.test | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 5070981f08f..6c7429b2a03 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -99,6 +99,13 @@ drop table t1; # # TODO: FULLTEXT INDEX # SPATIAL INDEX +# Error "All parts of a SPATIAL index must be NOT NULL" +create table t1 (a int, b geometry as (a+1) persistent, spatial index (b)); +ERROR 42000: All parts of a SPATIAL index must be NOT NULL +create table t1 (a int, b int as (a+1) persistent); +alter table t1 add spatial index (b); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +drop table t1; # FOREIGN KEY # Rejected FK options. create table t1 (a int, b int as (a+1) persistent, diff --git a/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test index e408672ac07..34efc6e1f30 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test +++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test @@ -34,14 +34,13 @@ ##### Storage engine to be tested # Set the session storage engine --source include/have_innodb.inc -eval SET @@session.storage_engine = 'InnoDB'; +SET @@session.storage_engine = 'InnoDB'; ##### Workarounds for known open engine specific bugs # none #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $skip_spatial_index_check = 1; --source suite/vcol/inc/vcol_keys.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/vcol/t/vcol_keys_myisam.test b/mysql-test/suite/vcol/t/vcol_keys_myisam.test index 87d7b79aa1c..26f4a2c5ae1 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_keys_myisam.test @@ -33,7 +33,7 @@ ##### Storage engine to be tested # Set the session storage engine -eval SET @@session.storage_engine = 'MyISAM'; +SET @@session.storage_engine = 'MyISAM'; ##### Workarounds for known open engine specific bugs # none From a418c9920047d5222a0d065343347312127b780f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Nov 2016 16:48:50 +0100 Subject: [PATCH 064/135] gcol mysql-test suite from 5.7 update tests and results, fix bugs --- mysql-test/mysql-test-run.pl | 1 + .../gcol/inc/gcol_blocked_sql_funcs_main.inc | 249 ++ mysql-test/suite/gcol/inc/gcol_cleanup.inc | 24 + .../gcol/inc/gcol_column_def_options.inc | 585 ++++ .../gcol/inc/gcol_dependancies_on_vcol.inc | 43 + mysql-test/suite/gcol/inc/gcol_handler.inc | 77 + mysql-test/suite/gcol/inc/gcol_ins_upd.inc | 609 ++++ mysql-test/suite/gcol/inc/gcol_keys.inc | 766 +++++ .../gcol/inc/gcol_non_stored_columns.inc | 155 + mysql-test/suite/gcol/inc/gcol_partition.inc | 155 + mysql-test/suite/gcol/inc/gcol_select.inc | 1163 +++++++ .../gcol/inc/gcol_supported_sql_funcs.inc | 47 + .../inc/gcol_supported_sql_funcs_main.inc | 1245 +++++++ mysql-test/suite/gcol/inc/gcol_trigger_sp.inc | 114 + .../inc/gcol_unsupported_storage_engines.inc | 21 + mysql-test/suite/gcol/inc/gcol_view.inc | 223 ++ mysql-test/suite/gcol/r/federated_gcol.result | 49 + mysql-test/suite/gcol/r/gcol_archive.result | 14 + mysql-test/suite/gcol/r/gcol_blackhole.result | 14 + .../r/gcol_blocked_sql_funcs_innodb.result | 179 + .../r/gcol_blocked_sql_funcs_myisam.result | 181 + .../suite/gcol/r/gcol_bug20746926.result | 32 + mysql-test/suite/gcol/r/gcol_bugfixes.result | 628 ++++ .../r/gcol_column_def_options_innodb.result | 582 ++++ .../r/gcol_column_def_options_myisam.result | 582 ++++ mysql-test/suite/gcol/r/gcol_csv.result | 14 + mysql-test/suite/gcol/r/gcol_falcon.result | 14 + .../suite/gcol/r/gcol_handler_innodb.result | 83 + .../suite/gcol/r/gcol_handler_myisam.result | 83 + .../suite/gcol/r/gcol_ins_upd_innodb.result | 602 ++++ .../suite/gcol/r/gcol_ins_upd_myisam.result | 524 +++ .../suite/gcol/r/gcol_keys_innodb.result | 421 +++ .../suite/gcol/r/gcol_keys_myisam.result | 421 +++ mysql-test/suite/gcol/r/gcol_memory.result | 14 + mysql-test/suite/gcol/r/gcol_merge.result | 15 + mysql-test/suite/gcol/r/gcol_ndb.result | 14 + .../r/gcol_non_stored_columns_innodb.result | 237 ++ .../r/gcol_non_stored_columns_myisam.result | 237 ++ .../suite/gcol/r/gcol_partition_innodb.result | 95 + .../suite/gcol/r/gcol_partition_myisam.result | 95 + .../suite/gcol/r/gcol_rejected_innodb.result | 8 + mysql-test/suite/gcol/r/gcol_rollback.result | 75 + .../suite/gcol/r/gcol_select_innodb.result | 976 ++++++ .../suite/gcol/r/gcol_select_myisam.result | 978 ++++++ .../r/gcol_supported_sql_funcs_innodb.result | 3000 +++++++++++++++++ .../r/gcol_supported_sql_funcs_myisam.result | 3000 +++++++++++++++++ .../gcol/r/gcol_trigger_sp_innodb.result | 94 + .../gcol/r/gcol_trigger_sp_myisam.result | 94 + mysql-test/suite/gcol/r/gcol_update.result | 30 + .../suite/gcol/r/gcol_view_innodb.result | 280 ++ .../suite/gcol/r/gcol_view_myisam.result | 280 ++ mysql-test/suite/gcol/r/rpl_gcol.result | 33 + mysql-test/suite/gcol/t/gcol_archive.test | 44 + mysql-test/suite/gcol/t/gcol_blackhole.test | 44 + .../gcol/t/gcol_blocked_sql_funcs_innodb.test | 47 + .../gcol/t/gcol_blocked_sql_funcs_myisam.test | 44 + mysql-test/suite/gcol/t/gcol_bug20746926.test | 28 + mysql-test/suite/gcol/t/gcol_bugfixes.test | 601 ++++ .../t/gcol_column_def_options_innodb.test | 47 + .../t/gcol_column_def_options_myisam.test | 47 + .../suite/gcol/t/gcol_handler_innodb.test | 46 + .../suite/gcol/t/gcol_handler_myisam.test | 45 + .../suite/gcol/t/gcol_ins_upd_innodb.test | 47 + .../suite/gcol/t/gcol_ins_upd_myisam.test | 46 + mysql-test/suite/gcol/t/gcol_keys_innodb.test | 89 + mysql-test/suite/gcol/t/gcol_keys_myisam.test | 46 + mysql-test/suite/gcol/t/gcol_memory.test | 43 + mysql-test/suite/gcol/t/gcol_merge.test | 52 + .../t/gcol_non_stored_columns_innodb.test | 48 + .../t/gcol_non_stored_columns_myisam.test | 47 + .../suite/gcol/t/gcol_partition_innodb.test | 46 + .../suite/gcol/t/gcol_partition_myisam.test | 45 + .../suite/gcol/t/gcol_rejected_innodb.test | 41 + mysql-test/suite/gcol/t/gcol_rollback.test | 108 + .../suite/gcol/t/gcol_select_innodb.test | 53 + .../suite/gcol/t/gcol_select_myisam.test | 52 + .../t/gcol_supported_sql_funcs_innodb.test | 45 + .../t/gcol_supported_sql_funcs_myisam.test | 44 + .../suite/gcol/t/gcol_trigger_sp_innodb.test | 47 + .../suite/gcol/t/gcol_trigger_sp_myisam.test | 46 + mysql-test/suite/gcol/t/gcol_update.test | 56 + mysql-test/suite/gcol/t/gcol_view_innodb.test | 46 + mysql-test/suite/gcol/t/gcol_view_myisam.test | 45 + mysql-test/suite/gcol/t/rpl_gcol.test | 65 + .../suite/vcol/r/innodb_autoinc_vcol.result | 10 +- .../suite/vcol/t/innodb_autoinc_vcol.test | 2 +- sql/field.h | 8 +- sql/item.cc | 13 +- sql/item.h | 11 +- sql/sql_table.cc | 18 +- 90 files changed, 21645 insertions(+), 22 deletions(-) create mode 100644 mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_cleanup.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_column_def_options.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_dependancies_on_vcol.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_handler.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_ins_upd.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_keys.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_partition.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_select.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_supported_sql_funcs.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_trigger_sp.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc create mode 100644 mysql-test/suite/gcol/inc/gcol_view.inc create mode 100644 mysql-test/suite/gcol/r/federated_gcol.result create mode 100644 mysql-test/suite/gcol/r/gcol_archive.result create mode 100644 mysql-test/suite/gcol/r/gcol_blackhole.result create mode 100644 mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_bug20746926.result create mode 100644 mysql-test/suite/gcol/r/gcol_bugfixes.result create mode 100644 mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_csv.result create mode 100644 mysql-test/suite/gcol/r/gcol_falcon.result create mode 100644 mysql-test/suite/gcol/r/gcol_handler_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_handler_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_keys_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_keys_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_memory.result create mode 100644 mysql-test/suite/gcol/r/gcol_merge.result create mode 100644 mysql-test/suite/gcol/r/gcol_ndb.result create mode 100644 mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_partition_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_partition_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_rejected_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_rollback.result create mode 100644 mysql-test/suite/gcol/r/gcol_select_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_select_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_trigger_sp_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_trigger_sp_myisam.result create mode 100644 mysql-test/suite/gcol/r/gcol_update.result create mode 100644 mysql-test/suite/gcol/r/gcol_view_innodb.result create mode 100644 mysql-test/suite/gcol/r/gcol_view_myisam.result create mode 100644 mysql-test/suite/gcol/r/rpl_gcol.result create mode 100644 mysql-test/suite/gcol/t/gcol_archive.test create mode 100644 mysql-test/suite/gcol/t/gcol_blackhole.test create mode 100644 mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_bug20746926.test create mode 100644 mysql-test/suite/gcol/t/gcol_bugfixes.test create mode 100644 mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_handler_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_handler_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_keys_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_keys_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_memory.test create mode 100644 mysql-test/suite/gcol/t/gcol_merge.test create mode 100644 mysql-test/suite/gcol/t/gcol_non_stored_columns_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_non_stored_columns_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_partition_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_partition_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_rejected_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_rollback.test create mode 100644 mysql-test/suite/gcol/t/gcol_select_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_select_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_supported_sql_funcs_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_supported_sql_funcs_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_trigger_sp_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_trigger_sp_myisam.test create mode 100644 mysql-test/suite/gcol/t/gcol_update.test create mode 100644 mysql-test/suite/gcol/t/gcol_view_innodb.test create mode 100644 mysql-test/suite/gcol/t/gcol_view_myisam.test create mode 100644 mysql-test/suite/gcol/t/rpl_gcol.test diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fdbc2a739a2..700433c2b17 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -175,6 +175,7 @@ my @DEFAULT_SUITES= qw( federated- funcs_1- funcs_2- + gcol- handler- heap- innodb- diff --git a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc new file mode 100644 index 00000000000..b1774490958 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc @@ -0,0 +1,249 @@ +################################################################################ +# inc/gcol_blocked_sql_funcs_main.inc # +# # +# Purpose: # +# Tests around sql functions # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# MySQL doesn't support them, but MariaDB does: +# +create or replace table t1 (b double generated always as (rand()) virtual); +create or replace table t1 (a datetime generated always as (curdate()) virtual); +create or replace table t1 (a datetime generated always as (current_date) virtual); +create or replace table t1 (a datetime generated always as (current_date()) virtual); +create or replace table t1 (a datetime generated always as (current_time) virtual); +create or replace table t1 (a datetime generated always as (current_time()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp) virtual); +create or replace table t1 (a datetime generated always as (curtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (now()) virtual); +create or replace table t1 (a int, b varchar(10) generated always as (sysdate()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (unix_timestamp()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_date()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_time()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_timestamp()) virtual); +create or replace table t1 (a int generated always as (connection_id()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (database()) virtual); +create or replace table t1 (a varchar(32) generated always as (schema()) virtual); +create or replace table t1 (a varchar(32) generated always as (session_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (system_user()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (user()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid_short()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (version()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (encrypt(a)) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (UpdateXML(a,'/a','fff')) virtual); +drop table t1; + +# +# NOTE: All SQL functions below should be rejected, otherwise BUG. +# + +--echo # LOAD_FILE() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual); + +--echo # MATCH() +if (!$skip_full_text_check) +{ + -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED + create table t1 (a varchar(32), b bool generated always as (match a against ('sample text')) virtual); +} + +--echo # BENCHMARK() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual); + +--echo # FOUND_ROWS() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual); + +--echo # GET_LOCK() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual); + +--echo # IS_FREE_LOCK() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual); + +--echo # IS_USED_LOCK() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual); + +--echo # LAST_INSERT_ID() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (last_insert_id()) virtual); + +--echo # MASTER_POS_WAIT() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(32), b int generated always as (master_pos_wait(a,0,2)) virtual); + +--echo # NAME_CONST() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual); + +--echo # RELEASE_LOCK() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual); + +--echo # ROW_COUNT() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (row_count()) virtual); + +--echo # SLEEP() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (sleep(a)) virtual); + +--echo # VALUES() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual); + +--echo # Stored procedures + +delimiter //; +create procedure p1() +begin + select current_user(); +end // + +create function f1() +returns int +begin + return 1; +end // + +delimiter ;// + +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (p1()) virtual); +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (f1()) virtual); + +drop procedure p1; +drop function f1; + +--echo # Unknown functions +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (f1()) virtual); + +--echo # +--echo # GROUP BY FUNCTIONS +--echo # + +--echo # AVG() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (avg(a)) virtual); + +--echo # BIT_AND() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (bit_and(a)) virtual); + +--echo # BIT_OR() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (bit_or(a)) virtual); + +--echo # BIT_XOR() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (bit_xor(a)) virtual); + +--echo # COUNT(DISTINCT) +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (count(distinct a)) virtual); + +--echo # COUNT() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (count(a)) virtual); + +--echo # GROUP_CONCAT() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual); + +--echo # MAX() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (max(a)) virtual); + +--echo # MIN() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (min(a)) virtual); + +--echo # STD() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (std(a)) virtual); + +--echo # STDDEV_POP() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (stddev_pop(a)) virtual); + +--echo # STDDEV_SAMP() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (stddev_samp(a)) virtual); + +--echo # STDDEV() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (stddev(a)) virtual); + +--echo # SUM() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (sum(a)) virtual); + +--echo # VAR_POP() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (var_pop(a)) virtual); + +--echo # VAR_SAMP() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (var_samp(a)) virtual); + +--echo # VARIANCE() +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (variance(a)) virtual); + +--echo # +--echo # Sub-selects +--echo # + +create table t1 (a int); +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t2 (a int, b int generated always as (select count(*) virtual from t1)); +drop table t1; + +--echo # +--echo # Long expression + +let $tmp_long_string = `SELECT repeat('a',240)`; +eval create table t1 (a int, b varchar(300) generated always as (concat(a,'$tmp_long_string')) virtual); +drop table t1; +let $tmp_long_string = `SELECT repeat('a',243)`; +# Limit is lifted to 64K. TODO write a test for it. +# --error 1470 +eval create table t1 (a int, b varchar(300) generated always as (concat(a,'$tmp_long_string')) virtual); +drop table t1; + +--echo # +--echo # Constant expression +create table t1 (a int generated always as (PI()) virtual); +drop table t1; + +--echo # bug#21098119: GCOL WITH MATCH/AGAINST --> +--echo # ASSERTION FAILED: TR && TR->TABLE->FILE +--echo # +create table t1 (a int); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add column r blob generated always +as (match(a) against ('' in boolean mode)) virtual; +drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_cleanup.inc b/mysql-test/suite/gcol/inc/gcol_cleanup.inc new file mode 100644 index 00000000000..39f7ff7fcea --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_cleanup.inc @@ -0,0 +1,24 @@ +################################################################################ +# inc/gcol_cleanup.inc # +# # +# Purpose: # +# Removal of the objects created by the t/.test # +# scripts. # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--disable_warnings +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; +--enable_warnings diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc new file mode 100644 index 00000000000..935a20503bf --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -0,0 +1,585 @@ +################################################################################ +# inc/gcol_column_def_options.inc # +# # +# Purpose: # +# Testing different optional parameters specified when defining # +# a generated column. # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ +--source include/have_partition.inc + +--echo # +--echo # Section 1. Wrong column definition options +--echo # - DEFAULT +--echo # - AUTO_INCREMENT + +--echo # NOT NULL +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) virtual not null); +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) stored not null); +create table t1 (a int); +--error ER_PARSE_ERROR +alter table t1 add column b int generated always as (a+1) virtual not null; +drop table t1; + +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) virtual null); +create table t1 (a int); +--error ER_PARSE_ERROR +alter table t1 add column b int generated always as (a+1) virtual null; +drop table t1; + +--echo # Added columns mixed with virtual GC and other columns +create table t1 (a int); +insert into t1 values(1); +--enable_info +alter table t1 add column (b int generated always as (a+1) virtual, c int); +alter table t1 add column (d int, e int generated always as (a+1) virtual); +alter table t1 add column (f int generated always as (a+1) virtual, g int as(5) stored); +alter table t1 add column (h int generated always as (a+1) virtual, i int as(5) virtual); +--disable_info +drop table t1; + +--echo # DEFAULT +--error 1064 +create table t1 (a int, b int generated always as (a+1) virtual default 0); +create table t1 (a int); +--error 1064 +alter table t1 add column b int generated always as (a+1) virtual default 0; +drop table t1; + +--echo # AUTO_INCREMENT +--error 1064 +create table t1 (a int, b int generated always as (a+1) virtual AUTO_INCREMENT); +create table t1 (a int); +--error 1064 +alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT; +drop table t1; + +--echo # [PRIMARY] KEY +if ($support_virtual_index) +{ +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) virtual key); +} +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) stored key); +if ($support_virtual_index) +{ +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) virtual primary key); +} +--error ER_PARSE_ERROR +create table t1 (a int, b int generated always as (a+1) stored primary key); +create table t1 (a int); +if ($support_virtual_index) +{ +--error ER_PARSE_ERROR +alter table t1 add column b int generated always as (a+1) virtual key; +} +--error ER_PARSE_ERROR +alter table t1 add column b int generated always as (a+1) stored key; +if ($support_virtual_index) +{ +--error ER_PARSE_ERROR +alter table t1 add column c int generated always as (a+2) virtual primary key; +} +show create table t1; +--error ER_PARSE_ERROR +alter table t1 add column c int generated always as (a+2) stored primary key; +drop table t1; + +--echo # Section 2. Other column definition options +--echo # - COMMENT +--echo # - REFERENCES (only syntax testing here) +--echo # - STORED (only systax testing here) +create table t1 (a int, b int generated always as (a % 2) virtual comment 'my comment'); +show create table t1; +describe t1; +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) virtual comment 'my comment'; +show create table t1; +describe t1; +insert into t1 (a) values (1); +select * from t1; +insert into t1 values (2,default); +select a,b from t1 order by a; +create table t2 like t1; +show create table t2; +describe t2; +insert into t2 (a) values (1); +select * from t2; +insert into t2 values (2,default); +select a,b from t2 order by a; +drop table t2; +drop table t1; + +create table t1 (a int, b int generated always as (a % 2) stored); +show create table t1; +describe t1; +insert into t1 (a) values (1); +select * from t1; +insert into t1 values (2,default); +select a,b from t1 order by a; +drop table t1; + + +create table t2 (a int); +create table t1 (a int, b int generated always as (a % 2) stored references t2(a)); +show create table t1; +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +--error 1064 +alter table t1 modify b int generated always as (a % 2) stored references t2(a); +show create table t1; +drop table t1; +drop table t2; +--echo FK options +create table t1(a int, b int as (a % 2), c int as (a) stored); +create table t2 (a int); +--error ER_KEY_COLUMN_DOES_NOT_EXITS +alter table t1 add constraint foreign key fk(d) references t2(a); +if ($support_virtual_foreign) +{ +--replace_regex /`#sql-.*`/`#sql-temporary`/ +--error ER_CANT_CREATE_TABLE +alter table t1 add constraint foreign key fk(b) references t2(a); +} +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; +drop table t1; +drop table t2; +--echo Generated always is optional +create table t1 (a int, b int as (a % 2) virtual); +show create table t1; +describe t1; +drop table t1; +create table t1 (a int, b int as (a % 2) stored); +show create table t1; +describe t1; +drop table t1; +--echo Default should be non-stored column +create table t1 (a int, b int as (a % 2)); +show create table t1; +describe t1; +drop table t1; +--echo Expression can be constant +create table t1 (a int, b int as (5 * 2)); +show create table t1; +describe t1; +drop table t1; +--echo Test generated columns referencing other generated columns +create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual); +insert into t1 (a) values (1), (2); +--sorted_result +select * from t1; +insert into t1(a) values (1) on duplicate key update a=3; +--sorted_result +select * from t1; +update t1 set a=4 where a=2; +--sorted_result +select * from t1; +drop table t1; + +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); + +--echo # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE +create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); +insert into t1(a) values(1),(2); +create table tt as select * from t1; +select * from t1 order by a; +select * from tt order by a; +drop table t1,tt; + +if (!$support_virtual_index) +{ +--echo # Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON +--echo # VIRTUAL GC FOR MYISAM +--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +CREATE TABLE A ( +pk INTEGER, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY +(col_int_key)); +} + +--echo # Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: +--echo # THD->CHANGE_LIST.IS_EMPTY() +--echo # +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +CREATE TABLE t1(a bigint AS (a between 1 and 1)); + +--echo # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +--echo # IN FIND_FIELD_IN_TABLE +--echo # +CREATE TABLE t1(a int); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +DROP TABLE t1; + +--echo # Bug#20566243: ERROR WHILE DOING CREATE TABLE T1 SELECT (QUERY ON GC COLUMNS) +CREATE TABLE t1(a int, b int as (a + 1), + c varchar(12) as ("aaaabb") stored, d blob as (c)); +INSERT INTO t1(a) VALUES(1),(3); +SHOW CREATE TABLE t1; +SELECT * FROM t1 order by a; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +CREATE TABLE t3 AS SELECT * FROM t1; +SHOW CREATE TABLE t3; +SELECT * FROM t3 order by a; +CREATE TABLE t4 AS SELECT b,c,d FROM t1; +SHOW CREATE TABLE t4; +SELECT * FROM t4 order by b; +DROP TABLE t1,t2,t3,t4; + +--echo # Bug#21025003:WL8149:ASSERTION `CTX->NUM_TO_DROP_FK +--echo # == HA_ALTER_INFO->ALTER_INFO-> FAILED +--echo # +CREATE TABLE t1 ( + col1 int(11) DEFAULT NULL, + col2 int(11) DEFAULT NULL, + col3 int(11) DEFAULT NULL, + col4 int(11) DEFAULT NULL, + col5 int(11) GENERATED ALWAYS AS (col4 / col2) VIRTUAL, + col6 text +); +INSERT INTO t1(col1,col2,col3,col4,col6) VALUES(NULL,1,4,0,REPEAT(2,1000)); +--error ER_CANT_DROP_FIELD_OR_KEY +ALTER TABLE t1 DROP PRIMARY KEY , ADD KEY idx ( col5, col2 ); +DROP TABLE t1; +--echo # Bug#20949226:i CAN ASSIGN NON-DEFAULT() VALUE TO GENERATED COLUMN +--echo # +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2; +CREATE TABLE t2 (a int); +INSERT INTO t2 values(1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5; +SELECT * FROM t1; +DROP TABLE t1, t2; + +if ($support_virtual_index) +{ +--echo # Bug#21074624:i WL8149:SIG 11 INNOBASE_GET_COMPUTED_VALUE | +--echo # INNOBASE/HANDLER/HA_INNODB.CC:19082 +CREATE TABLE t1 ( + col1 int(11) NOT NULL, + col2 int(11) DEFAULT NULL, + col3 int(11) NOT NULL, + col4 int(11) DEFAULT NULL, + col5 int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL, + col6 int(11) GENERATED ALWAYS AS (col3 + col3) VIRTUAL, + col7 int(11) GENERATED ALWAYS AS (col5 / col5) VIRTUAL, + col8 int(11) GENERATED ALWAYS AS (col6 / col5) VIRTUAL, + col9 text, + extra int(11) DEFAULT NULL, + KEY idx (col5) +); +INSERT INTO t1(col1,col2,col3,col4,col9,extra) +VALUES(0,6,3,4,REPEAT(4,1000),0); +ALTER TABLE t1 DROP COLUMN col1; +DROP TABLE t1; + +--echo # Bug#21390605:VALGRIND ERROR ON DELETE FROM TABLE CONTAINING +--echo # AN INDEXED VIRTUAL COLUMN +CREATE TABLE t1 ( + a INTEGER, + b INTEGER GENERATED ALWAYS AS (a) VIRTUAL, + c INTEGER GENERATED ALWAYS AS (b) VIRTUAL, + INDEX idx (b,c) +); +INSERT INTO t1 (a) VALUES (42); +DELETE FROM t1 WHERE c = 42; +DROP TABLE t1; +} + +--echo # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +--echo # IN FIND_FIELD_IN_TABLE +--echo # +CREATE TABLE t1(a int); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col))); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual))); +DROP TABLE t1; + +if(! $testing_ndb) { +--echo # Bug#21142905: PARTITIONED GENERATED COLS - +--echo # !TABLE || (!TABLE->WRITE_SET || BITMAP_IS_SET +--echo # +CREATE TABLE t1 ( +a int, +b int generated always as (a) virtual, +c int generated always as (b+a) virtual, +d int generated always as (b+a) virtual +) PARTITION BY LINEAR HASH (b); +INSERT INTO t1(a) VALUES(0); +DELETE FROM t1 WHERE c=1; +DROP TABLE t1; +} + +--error ER_PARSE_ERROR +CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); +CREATE TABLE t1 (i INT); +--error ER_PARSE_ERROR +ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); +DROP TABLE t1; +--error ER_PARSE_ERROR +CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); + +--echo # Check for a charset mismatch processing: + +--echo # Bug #21469535: VALGRIND ERROR (CONDITIONAL JUMP) WHEN INSERT +--echo # ROWS INTO A PARTITIONED TABLE +--echo # +CREATE TABLE t1 ( + id INT NOT NULL, + store_id INT NOT NULL, + x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( + PARTITION p0 VALUES LESS THAN (6), + PARTITION p1 VALUES LESS THAN (11), + PARTITION p2 VALUES LESS THAN (16), + PARTITION p3 VALUES LESS THAN (21) +); + +INSERT INTO t1 VALUES(1, 2, default); +DROP TABLE t1; + +--echo # Bug#21465626:ASSERT/CRASH ON DROPPING/ADDING VIRTUAL COLUMN +CREATE TABLE t (a int(11), b int(11), + c int(11) GENERATED ALWAYS AS (a+b) VIRTUAL, + d int(11) GENERATED ALWAYS AS (a+b) VIRTUAL); +INSERT INTO t(a,b) VALUES(1,2); +--enable_info +--echo # Mixed drop/add/rename virtual with non-virtual columns, +--echo # ALGORITHM=INPLACE is not supported for InnoDB +ALTER TABLE t DROP d, ADD e varchar(10); +ALTER TABLE t ADD d int, ADD f char(10) AS ('aaa'); +ALTER TABLE t CHANGE d dd int, CHANGE f ff varchar(10) AS ('bbb'); +--echo # Only drop/add/change virtual, inplace is supported for Innodb +ALTER TABLE t DROP c, DROP ff; +ALTER TABLE t ADD c int(11) as (a+b), ADD f varchar(10) as ('aaa'); +ALTER TABLE t CHANGE c c int(11) as (a), CHANGE f f varchar(10) as('bbb'); +--echo # Change order should be ALGORITHM=INPLACE on Innodb +ALTER TABLE t CHANGE c c int(11) as (a) after f; +ALTER TABLE t CHANGE b b int(11) after c; +--echo # TODO: Changing virtual column type should be ALGORITHM=INPLACE on InnoDB, current it goes only with COPY method +ALTER TABLE t CHANGE c c varchar(10) as ('a'); +--echo # Changing stored column type is ALGORITHM=COPY +ALTER TABLE t CHANGE dd d varchar(10); +if ($support_virtual_index) +{ + +#ALTER TABLE t ADD INDEX idx(a), ADD INDEX idx1(c); +#ALTER TABLE t RENAME INDEX idx TO idx2, RENAME INDEX idx1 TO idx3; +#ALTER TABLE t DROP INDEX idx2, DROP INDEX idx3; +ALTER TABLE t ADD INDEX idx(c), ADD INDEX idx1(d); +ALTER TABLE t DROP INDEX idx, DROP INDEX idx1; +} +--disable_info +DROP TABLE t; + +--echo # Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF +CREATE TABLE t1( + col1 INTEGER PRIMARY KEY, + col2 INTEGER, + col3 INTEGER, + col4 INTEGER, + vgc1 INTEGER AS (col2 + col3) VIRTUAL, + sgc1 INTEGER AS (col2 - col3) STORED +); + +INSERT INTO t1(col1, col2, col3) VALUES + (1, 10, 100), (2, 20, 200); + +SELECT * FROM t1 order by col1; + +# Change expression of a virtual generated column +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; + +# Change expression of a stored generated column +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; + +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; + +if ($support_virtual_index) +{ +ALTER TABLE t1 ADD INDEX vgc1 (vgc1); +} +ALTER TABLE t1 ADD INDEX sgc1 (sgc1); + +if ($support_virtual_index) +{ +# Change expression of a virtual generated column, with index +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +SELECT vgc1 FROM t1 order by vgc1; +} + +# Change expression of a stored generated column, with index +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; +SELECT sgc1 FROM t1 order by sgc1; + +if ($support_virtual_index) +{ +ALTER TABLE t1 DROP INDEX vgc1; +} +ALTER TABLE t1 DROP INDEX sgc1; + +if ($support_virtual_index) +{ +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 ADD UNIQUE INDEX vgc1 (vgc1); +} +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); + +# Change expression of a virtual generated column, with unique index +if ($support_virtual_index) +{ +--error ER_DUP_ENTRY +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 / col3) VIRTUAL; +} +--error ER_DUP_ENTRY +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; + +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +SELECT vgc1 FROM t1 order by col1; + +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 * col3) STORED; +SELECT * FROM t1 order by col1; +SELECT sgc1 FROM t1 order by sgc1; + +# Change virtual generated column to become stored +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; + +# Change stored generated column to become virtual +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; + +# Change base column to become stored generated column: +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER AS (col1 + col2 + col3) STORED; +SELECT * FROM t1 order by col1; + +# Change stored generated column to become base column: +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER; +SELECT * FROM t1 order by col1; + +DROP TABLE t1; + +if ($support_virtual_index) +{ +--echo # +--echo # bug#22018979: RECORD NOT FOUND ON UPDATE, +--echo # VIRTUAL COLUMN, ASSERTION 0 +--disable_warnings +SET @sql_mode_save= @@sql_mode; +SET sql_mode= 'ANSI'; +CREATE TABLE t1 ( + a INT, + b VARCHAR(10), + c CHAR(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, + PRIMARY KEY (a), + KEY c(c) +); +INSERT INTO t1(a, b) values(1, 'bbbb'), (2, 'cc'); +SHOW CREATE TABLE t1; +SELECT * FROM t1 order by a; + +SET sql_mode= ''; +FLUSH TABLE t1; +SHOW CREATE TABLE t1; +SELECT * FROM t1 order by a; +DELETE FROM t1 where a= 2; + +SET sql_mode= @sql_mode_save; +DROP TABLE t1; +--enable_warnings +} + + +--echo # +--echo # Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE +--echo # ALLOWED IN GENERATED COLUMNS +--echo # +if ($support_virtual_index) +{ +CREATE TABLE tzz(a INT DEFAULT 5, + gc1 INT AS (a+DEFAULT(a)) VIRTUAL, + gc2 INT AS (a+DEFAULT(a)) STORED, + KEY k1(gc1)); +INSERT INTO tzz(A) VALUES (1); +SELECT * FROM tzz; +SELECT gc1 FROM tzz; + +ALTER TABLE tzz MODIFY COLUMN a INT DEFAULT 6; +SELECT * FROM tzz; +SELECT gc1 FROM tzz; +DROP TABLE tzz; +} + +--echo # Test 1: ALTER DEFAULT +--echo # +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, + b INT AS (1 + DEFAULT(a)) STORED, + c INT AS (1 + DEFAULT(a)) VIRTUAL); +INSERT INTO t1 VALUES (); +--disable_warnings +# Check how many rows are accessed: >0 = COPY +--enable_info +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; +ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; +ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; +--disable_info +DROP TABLE t1; + +--echo # Test 2: ALTER DEFAULT + ADD GCOL +--echo # +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5); +INSERT INTO t1 VALUES(); +--enable_info +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, + ADD COLUMN b1 INT AS (1 + DEFAULT(a)) STORED; +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, + ADD COLUMN c1 INT AS (1 + DEFAULT(a)) VIRTUAL; +--disable_info +# Check how many rows are accessed: >0 = COPY +--enable_info +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, + ADD COLUMN b INT AS (1 + DEFAULT(a)) STORED, + ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; +--disable_info +DROP TABLE t1; +--enable_warnings diff --git a/mysql-test/suite/gcol/inc/gcol_dependancies_on_vcol.inc b/mysql-test/suite/gcol/inc/gcol_dependancies_on_vcol.inc new file mode 100644 index 00000000000..5ef433097d9 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_dependancies_on_vcol.inc @@ -0,0 +1,43 @@ +################################################################################ +# inc/gcol_dependencies_on_gcol.inc # +# # +# Purpose: # +# Testing scenarios when columns depend on generated columns, i.e. such as # +# - a generated column is based on a generated column # +# - a "real" column on which a generated one is renamed/dropped # +# - a generated column involved in partitioning is renamed/dropped # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--echo # Can't define a generated column on another generated column +--error ER_VCOL_BASED_ON_VCOL +create table t1 (a int, b int generated always as (a+1) virtual, c int generated always as (b+1) virtual); +create table t1 (a int, b int generated always as (a+1) virtual); +--error ER_VCOL_BASED_ON_VCOL +alter table t1 add column c int generated always as (b+1) virtual; +drop table t1; + +--echo # Can't rename or drop a column used in the function of a generated column +create table t1 (a int, b int generated always as (a+1) virtual); +--echo # On renaming/dropping a column on which a virtual field is +--echo # defined the following error is displayed: +--echo # "Unknown column 'a' in 'generated column function'" +--error 1054 +alter table t1 drop column a; +--error 1054 +alter table t1 change a c int; +drop table t1; + +--echo # Can't rename or drop a generated column used by the paritition function +create table t1 (a int, b int generated always as (a+1) virtual) partition by hash(b); +--error 1054 +alter table t1 drop b; +--error 1054 +alter table t1 change b c int generated always as (a+1) virtual; + diff --git a/mysql-test/suite/gcol/inc/gcol_handler.inc b/mysql-test/suite/gcol/inc/gcol_handler.inc new file mode 100644 index 00000000000..9ac6d5916ca --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_handler.inc @@ -0,0 +1,77 @@ +################################################################################ +# inc/gcol_handler.inc # +# # +# Purpose: # +# Testing HANDLER. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored, + d char(1), + index (a), + index (c)); +insert into t1 (a,d) values (4,'a'), (2,'b'), (1,'c'), (3,'d'); +select * from t1; + +--echo # HANDLER tbl_name OPEN +handler t1 open; + +--echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) +handler t1 read a > (2); + +--echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read a > (2) where d='c'; + +--echo # HANDLER tbl_name READ gcol_index_name = (value1,value2,...) +handler t1 read c = (-2); + +--echo # HANDLER tbl_name READ gcol_index_name = (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read c = (-2) where d='c'; + +--echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read a > (2) where b=-3 && c=-3; + +--echo # HANDLER tbl_name READ gcol_index_name <= (value1,value2,...) +handler t1 read c <= (-2); + +--echo # HANDLER tbl_name READ gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read c <= (-2) where b=-3; + +--echo # HANDLER tbl_name READ gcol_index_name FIRST +handler t1 read c first; + +--echo # HANDLER tbl_name READ gcol_index_name NEXT +handler t1 read c next; + +--echo # HANDLER tbl_name READ gcol_index_name PREV +handler t1 read c prev; + +--echo # HANDLER tbl_name READ gcol_index_name LAST +handler t1 read c last; + +--echo # HANDLER tbl_name READ FIRST where non-gcol=expr +handler t1 read FIRST where a >= 2; + +--echo # HANDLER tbl_name READ FIRST where gcol=expr +handler t1 read FIRST where b >= -2; + +--echo # HANDLER tbl_name READ NEXT where non-gcol=expr +handler t1 read NEXT where d='c'; + +--echo # HANDLER tbl_name READ NEXT where gcol=expr +handler t1 read NEXT where b<=-4; + +--echo # HANDLER tbl_name CLOSE +handler t1 close; + +drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc new file mode 100644 index 00000000000..951cf5ff0e5 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc @@ -0,0 +1,609 @@ +################################################################################ +# inc/gcol_ins_upd.inc # +# # +# Purpose: # +# Testing DDL operations such as INSERT, UPDATE, REPLACE and DELETE. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +let $create1 = create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +let $create2 = create table t1 (a int unique, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +let $create3 = create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored unique); +let $create4 = create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored unique, + d varchar(16)); +eval $create1; +set sql_warnings = 1; + +--echo # +--echo # *** INSERT *** +--echo # + +--echo # INSERT INTO tbl_name VALUES... DEFAULT is specified against gcols +insert into t1 values (1,default,default); +select * from t1; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name VALUES... NULL is specified against gcols +insert into t1 values (1,null,null); +select * from t1; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols +insert into t1 values (1,2,3); +select * from t1; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name () VALUES... +insert into t1 (a) values (1), (2); +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name () VALUES... DEFAULT is specified +--echo # against gcols +insert into t1 (a,b) values (1,default), (2,default); +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name () VALUES... NULL is specified against gcols +insert into t1 (a,b) values (1,null), (2,null); +select * from t1; +delete from t1; +select * from t1; + +--echo # INSERT INTO tbl_name () VALUES... a non-NULL value is specified +--echo # against gcols +insert into t1 (a,b) values (1,3), (2,4); +select * from t1; +delete from t1; +select * from t1; +drop table t1; + +--echo # Table with UNIQUE non-gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +--echo # KEY UPDATE =expr, =expr +eval $create2; +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) + on duplicate key update a=2, b=default; +select a,b,c from t1; +delete from t1 where b in (1,2); +select * from t1; +drop table t1; + +--echo # Table with UNIQUE gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +--echo # KEY UPDATE =expr, =expr +eval $create3; +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) + on duplicate key update a=2, b=default; +select a,b,c from t1; + +--echo # CREATE new_table ... LIKE old_table +--echo # INSERT INTO new_table SELECT * from old_table +create table t2 like t1; +insert into t2(a) select a from t1; +select * from t2; +drop table t2; + +--echo # CREATE new_table ... LIKE old_table INSERT INTO new_table (, ) +--echo # SELECT , from old_table +insert into t1 values (1,default,default); +select * from t1; +create table t2 like t1; +insert into t2 (a) select a from t1; +select * from t2 order by a; +drop table t2; +drop table t1; + +--echo # +--echo # *** UPDATE *** +--echo # + +--echo # UPDATE tbl_name SET non-gcol=expr WHERE non-gcol=expr +eval $create1; +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set a=3 where a=2; +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # UPDATE tbl_name SET gcol=expr WHERE non-gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set c=3 where a=2; +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set a=3 where b=-2; +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # UPDATE tbl_name SET gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set c=3 where b=-2; +select * from t1 order by a; +delete from t1; +select * from t1; +drop table t1; + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=const +eval $create3; +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set a=3 where c=-2; +select * from t1; +delete from t1; +select * from t1; + + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set a=3 where c between -3 and -2; +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # No INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +update t1 set a=3 where b between -3 and -2; +select * from t1 order by a; +delete from t1; +select * from t1; + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr +--echo # WHERE gcol=between const1 and const2 ORDER BY gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +update t1 set a=6 where c between -1 and 0 + order by c; +select * from t1 order by a; +delete from t1 where c between -6 and 0; +select * from t1; + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr +--echo # WHERE gcol=between const1 and const2 ORDER BY gcol LIMIT 2 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +update t1 set a=6 where c between -1 and 0 + order by c limit 2; +select * from t1 order by a; +delete from t1 where c between -2 and 0 order by c; +select * from t1 order by a; +delete from t1; + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr +--echo # WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +update t1 set a=6 where (c between -2 and 0) and (b=-1); +select * from t1 order by a; +delete from t1; + +--echo # INDEX created on gcol +--echo # UPDATE tbl_name SET non-gcol=expr +--echo # WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +--echo # ORDER BY indexed gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +update t1 set a=6 where (c between -2 and 0) and (b=-1) order by c; +select * from t1 order by a; +delete from t1; +drop table t1; + +let $innodb_engine = `SELECT @@session.default_storage_engine='innodb'`; +if ($innodb_engine) +{ + --echo # + --echo # Verify ON UPDATE/DELETE actions of FOREIGN KEYs + create table t2 (a int primary key, name varchar(10)); + create table t1 (a int primary key, b int generated always as (a % 10) stored); + insert into t2 values (1, 'value1'), (2,'value2'), (3,'value3'); + insert into t1 (a) values (1),(2),(3); + select * from t1 order by a; + select * from t2 order by a; + select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a order by t1.a; + + --echo # - ON UPDATE RESTRICT + alter table t1 add foreign key (b) references t2(a) on update restrict; + --error 1452 + insert into t1 (a) values (4); + --error 1451 + update t2 set a=4 where a=3; + select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; + alter table t1 drop foreign key t1_ibfk_1; + + --echo # - ON DELETE RESTRICT + alter table t1 add foreign key (b) references t2(a) on delete restrict; + --error 1451 + delete from t2 where a=3; + select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; + select t1.a, t1.b, t2.name from t1 left outer join t2 on (t1.b=t2.a); + alter table t1 drop foreign key t1_ibfk_1; + + --echo # - ON DELETE CASCADE + alter table t1 add foreign key (b) references t2(a) on delete cascade; + delete from t2 where a=3; + select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; + select t1.a, t1.b, t2.name from t1 left outer join t2 on (t1.b=t2.a); + alter table t1 drop foreign key t1_ibfk_1; + + drop table t1; + drop table t2; +} + +--echo # +--echo # *** REPLACE *** +--echo # + +--echo # UNIQUE INDEX on gcol +--echo # REPLACE tbl_name (non-gcols) VALUES (non-gcols); +eval $create4; +insert into t1 (a,d) values (1,'a'), (2,'b'); +select * from t1 order by a; +replace t1 (a,d) values (1,'c'); +select * from t1 order by a; +delete from t1; +select * from t1; + + +# *** DELETE +# All required tests for DELETE are performed as part of the above testing +# for INSERT, UPDATE and REPLACE. + +set sql_warnings = 0; +drop table t1; + +if ($innodb_engine) { +--echo Bug#20170778: WL411:FAILING ASSERTION `!TABLE || (!TABLE->WRITE_SET || +--echo BITMAP_IS_SET(TABLE->WR +--echo # +CREATE TABLE t1 (col1 INT, col2 INT, col3 INT, col4 INT, col5 +INT GENERATED ALWAYS AS (col3 * col2) VIRTUAL, col6 INT GENERATED ALWAYS AS +(col4 * col1) STORED, col7 INT GENERATED ALWAYS AS (col6 + col6) VIRTUAL, +col8 INT GENERATED ALWAYS AS (col6 / col5) STORED, col9 TEXT); + +SET @fill_amount = (@@innodb_page_size / 2 ) + 1; + +INSERT INTO t1 (col1,col2,col3,col4,col5,col6,col7,col8,col9) VALUES /* 3 */ +(3, 3 / 3, 3 + 3, 3 / 3, DEFAULT, DEFAULT, DEFAULT, DEFAULT ,REPEAT(CAST(3 AS +CHAR(1)),@fill_amount)) , (3, 3 * 3, 3 + 3, 3 / 3, DEFAULT, DEFAULT, DEFAULT, +DEFAULT ,REPEAT(CAST(3 AS CHAR(1)),@fill_amount)); + +UPDATE t1 SET col1 = 2; +UPDATE t1 SET col7 = DEFAULT; +UPDATE t1 SET col8 = DEFAULT; +DROP TABLE t1; +} + +if ($support_virtual_index) +{ +--echo Bug#20797344: WL#8149: ALLOCATED SPACE FOR INDEXED BLOB VGC CAN BE +--echo OVERWRITTEN FOR UPDATE +--echo # +CREATE TABLE t (a varchar(100), b blob, +c blob GENERATED ALWAYS AS (concat(a,b)) VIRTUAL, +d blob GENERATED ALWAYS AS (b) VIRTUAL, +e int(11) GENERATED ALWAYS AS (10) VIRTUAL, +h int(11) NOT NULL, PRIMARY KEY (h), key(c(20))); +INSERT INTO t(a,b,h) VALUES('aaaaaaa','1111111', 11); +INSERT INTO t(a,b,h) VALUES('bbbbbbb','2222222', 22); +SELECT c FROM t; +UPDATE t SET a='ccccccc'; +SELECT c FROM t; +DROP TABLE t; +} + +--echo # Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET || +--echo # BITMAP_IS_SET(TABLE->WRITE_SET +--echo # + +CREATE TABLE b ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); + +INSERT INTO b (col_varchar_nokey) VALUES ('v'),('v'); + +CREATE TABLE d ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +) ; + +INSERT INTO d (col_varchar_nokey) VALUES ('q'),('g'),('e'),('l'),(NULL),('v'),('c'),('u'),('x'); + +CREATE TABLE bb ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); + +INSERT INTO bb (col_varchar_nokey) VALUES ('j'),('h'); + +EXPLAIN UPDATE +d AS OUTR1, b AS OUTR2 +SET OUTR1.col_varchar_nokey = NULL +WHERE +( 't', 'b' ) IN +( +SELECT +INNR1.col_varchar_nokey AS x, +INNR1.col_varchar_key AS y +FROM bb AS INNR1 +WHERE OUTR1.pk = 1 +); + +DROP TABLE IF EXISTS b,bb,d; + + +--echo # +--echo # Bug#21216067 ASSERTION FAILED ROW_UPD_SEC_INDEX_ENTRY (INNOBASE/ROW/ROW0UPD.CC:2103) +--echo # + +CREATE TABLE t ( +x INT, y INT, gc INT GENERATED ALWAYS AS (x+1) STORED +); +INSERT INTO t VALUES (); +UPDATE t t1, t t2 SET t2.y = 1, t1.x = 2; +SELECT * FROM t; +DROP TABLE t; + +if ($support_virtual_index) +{ +CREATE TABLE t ( +x INT, y INT, gc INT GENERATED ALWAYS AS (x+1), KEY (x,gc) +); +INSERT INTO t VALUES (); +UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2; +SELECT * FROM t; +SELECT gc FROM t; +DROP TABLE t; +} + +let $query= +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; + +--echo # stored + +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED +); + +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +eval EXPLAIN $query; +eval $query; +SELECT * from C; +DROP TABLE C; + +--echo # stored, indexed + +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, +KEY (col_varchar_key, col_varchar_nokey) +); + +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +eval EXPLAIN $query; +eval $query; +SELECT * from C; +DROP TABLE C; + +--echo # virtual + +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL +); + +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +eval EXPLAIN $query; +eval $query; +SELECT * from C; +DROP TABLE C; + +if ($support_virtual_index) +{ +--echo # virtual, indexed + +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, +KEY (col_varchar_key, col_varchar_nokey) +); + +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +eval EXPLAIN $query; +eval $query; +SELECT * from C; +DROP TABLE C; + +--echo # +--echo # Bug #21530366 CRASH/ASSERTION, CORRUPTION WITH INDEXES + +--echo # VIRTUAL COLUMNS, BLOB +--echo # + +CREATE TABLE t ( + a INTEGER, + b BLOB GENERATED ALWAYS AS (a) VIRTUAL, + INDEX (b(57)) +); + +INSERT INTO t (a) VALUES (9); +UPDATE t SET a = 10; +DELETE FROM t WHERE a = 10; + +DROP TABLE t; + +--echo # Bug#21807818: Generated columns not updated with empty insert list + +CREATE TABLE t ( +a BLOB GENERATED ALWAYS AS ('') VIRTUAL, +b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL, +KEY (a(183),b) +); + +INSERT INTO t VALUES(), (), (); + +DELETE IGNORE FROM t; + +DROP TABLE t; + +--echo # +--echo # Bug#22195458:GCOLS: ASSERTION 0 AND CORRUPTION... +--echo # +--disable_warnings +CREATE TABLE t ( + a INT, + b YEAR GENERATED ALWAYS AS ('a') VIRTUAL, + c YEAR GENERATED ALWAYS AS ('aaaa') VIRTUAL, + b1 YEAR GENERATED ALWAYS AS ('a') STORED, + c1 YEAR GENERATED ALWAYS AS ('aaaa') STORED, + UNIQUE(b), + UNIQUE(b1) +); +INSERT INTO t VALUES(); +SELECT b from t; +SELECT b1 from t; +SELECT * from t; +DELETE FROM t; +CHECK TABLE t EXTENDED; +DROP TABLE t; +--enable_warnings + +--echo # Bug#22195364:GCOLS: FAILING ASSERTION: +--echo # DFIELD_IS_NULL(DFIELD2) || DFIELD2->DATA +CREATE TABLE t ( + a INT, + c BLOB GENERATED ALWAYS AS ('') VIRTUAL, + UNIQUE KEY(c(1),a) +); +INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2; +SELECT * FROM t; +INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2; +SELECT * FROM t; +# Test Field_blob::store_to_mem +SELECT GROUP_CONCAT(c ORDER BY c) FROM t; +DROP TABLE t; +} + +--echo #Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE +CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL, + c2 INT GENERATED ALWAYS AS(2) STORED); +INSERT INTO t VALUES(DEFAULT, DEFAULT); +SELECT * FROM t; +CREATE TABLE t1(c1 INT, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t1(c2) VALUES(DEFAULT); +SELECT * FROM t1; +CREATE TABLE t2(c1 INT DEFAULT 1, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t2(c2) VALUES(DEFAULT); +SELECT * FROM t2; +DROP TABLE t, t1, t2; + +--echo # Bug#22179637: INSERT INTO TABLE FROM SELECT ACCEPTS TO INSERT INTO +--echo # GENERATED COLUMNS +CREATE TABLE t1 ( + i1 INTEGER, + i2 INTEGER GENERATED ALWAYS AS (i1 + i1) +); +INSERT INTO t1 (i1) SELECT 5; +INSERT INTO t1 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t1; + +CREATE TABLE t2 ( + i1 INTEGER, + i2 INTEGER GENERATED ALWAYS AS (i1 + i1) STORED +); +INSERT INTO t2 (i1) SELECT 5; +INSERT INTO t2 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t2; + +DROP TABLE t1,t2; + +if ($support_virtual_index) +{ + +--echo # +--echo # Bug#22070021 GCOL:ASSERTION `!TABLE || (!TABLE->WRITE_SET || +--echo # BITMAP_IS_SET(TABLE->WRITE_SET, +--echo # + +CREATE TABLE t1( +c1 INT, +c2 INT GENERATED ALWAYS AS (c1 + c1) VIRTUAL, +KEY(c2) +); + +INSERT INTO t1(c1) VALUES(0); +DELETE O1.* FROM t1 AS O1, t1 AS O2; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Bug#21944199 SIMPLE DELETE QUERY CAUSES INNODB: FAILING ASSERTION: 0 +--echo # & DATA CORRUPTION +--echo # + +CREATE TEMPORARY TABLE t1 ( + a INTEGER NOT NULL, + b INTEGER GENERATED ALWAYS AS (a+1) VIRTUAL +); + +INSERT INTO t1 (a) VALUES (0), (0), (0); + +ALTER TABLE t1 ADD INDEX idx (b); + +DELETE FROM t1; + +DROP TEMPORARY TABLE t1; + +} diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc new file mode 100644 index 00000000000..aaba019ec4c --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -0,0 +1,766 @@ +################################################################################ +# inc/gcol_keys.inc # +# # +# Purpose: # +# Testing keys, indexes defined upon generated columns. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +if (!$support_virtual_index) { + let $skip_spatial_index_check=1; +} + +--echo # - UNIQUE KEY +--echo # - INDEX +--echo # - FULLTEXT INDEX +--echo # - SPATIAL INDEX (not supported) +--echo # - FOREIGN INDEX (partially supported) +--echo # - CHECK (allowed but not used) + +--echo # UNIQUE +if($support_virtual_index) +{ +create table t1 (a int, b int generated always as (a*2) virtual unique); +show create table t1; +describe t1; +drop table t1; +} +create table t1 (a int, b int generated always as (a*2) stored unique); +show create table t1; +describe t1; +drop table t1; + +if($support_virtual_index) +{ +create table t1 (a int, b int generated always as (a*2) virtual, unique key (b)); +show create table t1; +describe t1; +drop table t1; +} +create table t1 (a int, b int generated always as (a*2) stored, unique (b)); +show create table t1; +describe t1; +drop table t1; + +if($support_virtual_index) +{ +create table t1 (a int, b int generated always as (a*2) virtual); +alter table t1 add unique key (b); +drop table t1; +} +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add unique key (b); +drop table t1; + +--echo # Testing data manipulation operations involving UNIQUE keys +--echo # on generated columns can be found in: +--echo # - gcol_ins_upd.inc +--echo # - gcol_select.inc + +--echo # +--echo # INDEX +if($support_virtual_index) +{ +create table t1 (a int, b int generated always as (a*2) virtual, index (b)); +show create table t1; +describe t1; +drop table t1; + +create table t1 (a int, b int generated always as (a*2) virtual, index (a,b)); +drop table t1; +} + +create table t1 (a int, b int generated always as (a*2) stored, index (b)); +show create table t1; +describe t1; +drop table t1; + +create table t1 (a int, b int generated always as (a*2) stored, index (a,b)); +show create table t1; +describe t1; +drop table t1; + +if($support_virtual_index) +{ +create table t1 (a int, b int generated always as (a*2) virtual); +alter table t1 add index (b); + +alter table t1 add index (a,b); +drop table t1; +} + +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (b); +drop table t1; + +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (a,b); +create table t2 like t1; +drop table t2; +drop table t1; + +--echo # Testing data manipulation operations involving INDEX +--echo # on generated columns can be found in: +--echo # - gcol_select.inc + +--echo # +--echo # TODO: FULLTEXT INDEX + +--echo # SPATIAL INDEX +if (!$skip_spatial_index_check) +{ + --echo # Error "All parts of a SPATIAL index must be geometrical" + --error 1687 + create table t1 (a int, b int generated always as (a+1) stored, spatial index (b)); + create table t1 (a int, b int generated always as (a+1) stored); + --error 1687 + alter table t1 add spatial index (b); + drop table t1; +} + +--echo # FOREIGN KEY + +--echo # Rejected FK options. +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +create table t1 (a int, b int generated always as (a+1) stored, + foreign key (b) references t2(a) on update set null); +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +create table t1 (a int, b int generated always as (a+1) stored, + foreign key (b) references t2(a) on update cascade); +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +create table t1 (a int, b int generated always as (a+1) stored, + foreign key (b) references t2(a) on delete set null); + +create table t1 (a int, b int generated always as (a+1) stored); +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add foreign key (b) references t2(a) on update set null; +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add foreign key (b) references t2(a) on update cascade; +--error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +alter table t1 add foreign key (b) references t2(a) on delete set null; +drop table t1; + +if($support_virtual_index) +{ +--error ER_CANT_CREATE_TABLE +create table t1 (a int, b int generated always as (a+1) virtual, + foreign key (b) references t2(a)); + +create table t1 (a int, b int generated always as (a+1) virtual); +--replace_regex /`#sql-.*`/`#sql-temporary`/ +--error ER_CANT_CREATE_TABLE +alter table t1 add foreign key (b) references t2(a); +drop table t1; +} + +--echo # Allowed FK options. +create table t2 (a int primary key, b char(5)); +create table t1 (a int, b int generated always as (a % 10) stored, + foreign key (b) references t2(a) on update restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, + foreign key (b) references t2(a) on update no action); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, + foreign key (b) references t2(a) on delete restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, + foreign key (b) references t2(a) on delete cascade); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, + foreign key (b) references t2(a) on delete no action); +drop table t1,t2; + +if($support_virtual_index) +{ +--echo # +--echo # Bug#20553262: WL8149: ASSERTION `DELSUM+(INT) Y/4-TEMP >= 0' FAILED +--echo # +CREATE TABLE c ( +pk integer AUTO_INCREMENT, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) /*! NULL */, +PRIMARY KEY (pk), +KEY (col_time_key), +KEY (col_datetime_key)); + +INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values +('14:03:03.042673','2001-11-28 00:50:27.051028', 'c'), +('01:46:09.016386','2007-10-09 19:53:04.008332', NULL), +('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'), +('18:56:33.027423','2003-04-01 00:00:00', 'i'); + +--replace_column 10 x 11 x +EXPLAIN SELECT +outr.col_time_key AS x +FROM c as outr +WHERE +outr.col_varchar_nokey in ('c', 'x', 'i') +AND (outr.col_time_key IS NULL OR + outr.col_datetime_key = '2009-09-27'); + +SELECT +outr.col_time_key AS x +FROM c AS outr +WHERE +outr.col_varchar_nokey in ('c', 'x', 'i') +AND (outr.col_time_key IS NULL OR + outr.col_datetime_key = '2009-09-27'); + +DROP TABLE c; + +--echo # +--echo # Bug#20913803: WL8149: SIG 11 IN DFIELD_DUP | +--echo # INNOBASE/INCLUDE/DATA0DATA.IC:253 +--echo # +CREATE TABLE A ( +col_varchar_nokey TEXT , +col_varchar_key TEXT GENERATED ALWAYS AS (REPEAT(col_varchar_nokey, 1000)), +KEY (col_varchar_key(50)) +); + +INSERT INTO A (col_varchar_nokey) VALUES (''); + +CREATE TABLE D ( +pk INTEGER AUTO_INCREMENT, +col_date_nokey BLOB, +col_date_key BLOB GENERATED ALWAYS AS (REPEAT(col_date_nokey,1000)) VIRTUAL, +col_datetime_nokey LONGBLOB, +col_time_nokey LONGTEXT, + +col_datetime_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_datetime_nokey, 1000)), +col_time_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_datetime_nokey, 1000)), + +col_varchar_nokey TEXT, +col_varchar_key TEXT GENERATED ALWAYS AS (REPEAT(col_varchar_nokey, 1000)), + +PRIMARY KEY (pk), +KEY (col_varchar_key(50)), +KEY (col_date_key(20)), +KEY (col_time_key(20)), +KEY (col_datetime_key(20)), +KEY (col_varchar_key(10), col_date_key(10), col_time_key(5), col_datetime_key(5)) +); + +INSERT INTO D ( +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES ('', '', '', ''),('', '', '', ''); + +DELETE FROM OUTR1.* USING D AS OUTR1 RIGHT JOIN A AS OUTR2 ON +( OUTR1 . `col_varchar_nokey` = OUTR2 . `col_varchar_nokey` ); + +DROP TABLE IF EXISTS A,D; +--echo # +--echo # Bug#21024896: SIG 11 INNOBASE_ADD_ONE_VIRTUAL | +--echo # INNOBASE/HANDLER/HANDLER0ALTER.CC +--echo # +CREATE TABLE t1 ( + col1 int(11) DEFAULT NULL, + col2 int(11) DEFAULT NULL, + col3 int(11) NOT NULL, + col4 int(11) DEFAULT NULL, + col5 int(11) GENERATED ALWAYS AS (col2 / col2) VIRTUAL, + col7 int(11) GENERATED ALWAYS AS (col5 + col5) VIRTUAL, + col8 int(11) GENERATED ALWAYS AS (col5 * col5) VIRTUAL, + col9 text, + col6 int(11) DEFAULT NULL, + PRIMARY KEY (`col3`), + UNIQUE KEY uidx (`col2`), + KEY idx (`col5`) +); + +INSERT INTO t1(col1,col2,col3,col4,col9,col6) +VALUES(1,1,0,1,REPEAT(col1,1000),0), (3,2,1,1,REPEAT(col1,1000),NULL); + +ALTER TABLE t1 ADD COLUMN extra INT; +DROP TABLE t1; + + +--echo # +--echo # Bug#21316860: WL8149:INNODB: FAILING ASSERTION: +--echo # TEMPL->CLUST_REC_FIELD_NO != ULINT_UNDEFINED +--echo # +CREATE TABLE t1 ( + pk int(11) NOT NULL, + col_int_nokey int(11), + col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, + col_date_nokey date, + col_date_key date GENERATED ALWAYS AS (col_date_nokey) VIRTUAL, + PRIMARY KEY (pk), + UNIQUE KEY col_int_key (col_int_key) +); + +ALTER TABLE t1 DROP COLUMN pk; +DROP TABLE t1; + +--echo # Remove the impact on PK choose by index on virtual generated column +CREATE TABLE t1 ( + pk int(11) NOT NULL, + col_int_nokey int(11) DEFAULT NULL, + col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, + UNIQUE KEY col_int_key (col_int_key) +); + +ALTER TABLE t1 add unique index idx(pk), algorithm=inplace; +DESC t1; +DROP TABLE t1; + +--echo # +--echo # Bug#21346132: WL8149:INNODB: FAILING ASSERTION: +--echo # PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0 +--echo # +CREATE TABLE t1 ( + col_int_nokey int(11) NOT NULL, + col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey), + col_varchar_nokey varchar(1) NOT NULL, + col_varchar_key varchar(2) GENERATED ALWAYS AS (col_varchar_nokey), + UNIQUE KEY col_int_key (col_int_key), + UNIQUE KEY col_varchar_key (col_varchar_key), + UNIQUE KEY col_int_key_2 (col_int_key,col_varchar_key), + UNIQUE KEY col_varchar_key_2 (col_varchar_key,col_varchar_nokey), + KEY col_int_key_3 (col_int_key,col_int_nokey) +); + +ALTER TABLE t1 DROP COLUMN col_varchar_key; +DROP TABLE t1; +--echo # +--echo # Bug#21320151 WL8149: WRONG RESULT WITH INDEX SCAN +--echo # + +CREATE TABLE t1 ( + id INTEGER NOT NULL, + b INTEGER GENERATED ALWAYS AS (id+1) VIRTUAL, + UNIQUE KEY (b) +); + +INSERT INTO t1 (id) VALUES (2),(3),(4),(5),(6),(7),(8),(9),(10); + +--disable_query_log +--disable_result_log +ANALYZE TABLE t1; +--enable_result_log +--enable_query_log + +# covering index scan +let query= SELECT b FROM t1 FORCE INDEX(b); +eval EXPLAIN $query; +eval $query; + +# range scan +let $query= SELECT b FROM t1 FORCE INDEX(b) WHERE b BETWEEN 1 AND 5; +eval EXPLAIN $query; +eval $query; + +DROP TABLE t1; + +} +--echo +--echo # Testing data manipulation operations involving FOREIGN KEY +--echo # on generated columns can be found in: +--echo # - gcol_ins_upd.inc +--echo # - gcol_select.inc + +--echo # +--echo # TODO: CHECK + +--echo # +--echo # Test how optimizer picks indexes defined on a GC +--echo # +CREATE TABLE t1 (f1 int, gc int AS (f1 + 1) STORED, UNIQUE(gc)); +INSERT INTO t1(f1) VALUES (1),(2),(0),(9),(3),(4),(8),(7),(5),(6); +ANALYZE TABLE t1; +--echo # Should use index +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 > 7; +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7; + +SELECT * FROM t1 WHERE f1 + 1 = 7; +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 = 7; +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 IN (7,5); +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 IN(7,5); +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; + +--echo # Check that expression isn't transformed for a disabled key +--sorted_result +SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; + +--echo # Check that ORDER BY could be optimized +SELECT * FROM t1 ORDER BY f1 + 1; +EXPLAIN SELECT * FROM t1 ORDER BY f1 + 1; +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) ORDER BY f1 + 1; + +--echo # Check that GROUP BY could be optimized +SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +EXPLAIN SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +EXPLAIN SELECT f1 + 1, MAX(GC) + FROM t1 IGNORE KEY (gc) GROUP BY f1 + 1; + +--echo # Shouldn't use index +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 > 7.0; +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7.0; + +DROP TABLE t1; +--echo # Pick index with proper type +CREATE TABLE t1 (f1 int, + gc_int int AS (f1 + 1) STORED, + gc_date DATE AS (f1 + 1) STORED, + KEY gc_int_idx(gc_int), + KEY gc_date_idx(gc_date)); +INSERT INTO t1(f1) VALUES + (030303),(040404), + (050505),(060606), + (010101),(020202), + (030303),(040404), + (050505),(060606), + (010101),(020202), + (090909),(101010), + (010101),(020202), + (070707),(080808); +ANALYZE TABLE t1; + +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 > 070707; +--echo # INT column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 070707; +--sorted_result +SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); +--echo # DATE column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); + +DROP TABLE t1; + +--echo # +--echo # BUG#21229846: WL8170: SIGNAL 11 IN JOIN::MAKE_SUM_FUNC_LIST +--echo # +CREATE TABLE t1 ( + pk int primary key auto_increment, + col_int_key INTEGER , + col_int_gc_key INT GENERATED ALWAYS AS (col_int_key + 1) STORED, + KEY col_int_gc_key(col_int_gc_key) +); + +INSERT INTO t1 ( col_int_key) VALUES (7); + +ANALYZE TABLE t1; + +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 + FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) + ORDER BY field1, field2; + +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 + FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) + ORDER BY field1, field2; + +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 + FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) + GROUP BY field1, field2; + +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 + FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) + GROUP BY field1, field2; + +DROP TABLE t1; + +if($support_virtual_index) +{ +--echo # +--echo # Bug#21391781 ASSERT WHEN RUNNING ALTER TABLE ON A TABLE WITH INDEX +--echo # ON VIRTUAL COLUMN +--echo # + +# +# Test 1: column number 2 and 66 are virtual and there is an index +# on column number 2. +# +CREATE TABLE t1 ( + col1 INTEGER NOT NULL, + col2 INTEGER NOT NULL, + gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, + col3 INTEGER NOT NULL, + col4 INTEGER NOT NULL, + col5 INTEGER DEFAULT NULL, + col6 INTEGER DEFAULT NULL, + col7 INTEGER DEFAULT NULL, + col8 INTEGER DEFAULT NULL, + col9 INTEGER DEFAULT NULL, + col10 INTEGER DEFAULT NULL, + col11 INTEGER DEFAULT NULL, + col12 INTEGER DEFAULT NULL, + col13 INTEGER DEFAULT NULL, + col14 INTEGER DEFAULT NULL, + col15 INTEGER DEFAULT NULL, + col16 INTEGER DEFAULT NULL, + col17 INTEGER DEFAULT NULL, + col18 INTEGER DEFAULT NULL, + col19 INTEGER DEFAULT NULL, + col20 INTEGER DEFAULT NULL, + col21 INTEGER DEFAULT NULL, + col22 INTEGER DEFAULT NULL, + col23 INTEGER DEFAULT NULL, + col24 INTEGER DEFAULT NULL, + col25 INTEGER DEFAULT NULL, + col26 INTEGER DEFAULT NULL, + col27 INTEGER DEFAULT NULL, + col28 INTEGER DEFAULT NULL, + col29 INTEGER DEFAULT NULL, + col30 INTEGER DEFAULT NULL, + col31 INTEGER DEFAULT NULL, + col32 INTEGER DEFAULT NULL, + col33 INTEGER DEFAULT NULL, + col34 INTEGER DEFAULT NULL, + col35 INTEGER DEFAULT NULL, + col36 INTEGER DEFAULT NULL, + col37 INTEGER DEFAULT NULL, + col38 INTEGER DEFAULT NULL, + col39 INTEGER DEFAULT NULL, + col40 INTEGER DEFAULT NULL, + col41 INTEGER DEFAULT NULL, + col42 INTEGER DEFAULT NULL, + col43 INTEGER DEFAULT NULL, + col44 INTEGER DEFAULT NULL, + col45 INTEGER DEFAULT NULL, + col46 INTEGER DEFAULT NULL, + col47 INTEGER DEFAULT NULL, + col48 INTEGER DEFAULT NULL, + col49 INTEGER DEFAULT NULL, + col50 INTEGER DEFAULT NULL, + col51 INTEGER DEFAULT NULL, + col52 INTEGER DEFAULT NULL, + col53 INTEGER DEFAULT NULL, + col54 INTEGER DEFAULT NULL, + col55 INTEGER DEFAULT NULL, + col56 INTEGER DEFAULT NULL, + col57 INTEGER DEFAULT NULL, + col58 INTEGER DEFAULT NULL, + col59 INTEGER DEFAULT NULL, + col60 INTEGER DEFAULT NULL, + col61 INTEGER DEFAULT NULL, + col62 INTEGER DEFAULT NULL, + col63 INTEGER DEFAULT NULL, + col64 INTEGER DEFAULT NULL, + col65 INTEGER DEFAULT NULL, + gcol2 INTEGER GENERATED ALWAYS AS (col3 / col4) VIRTUAL, + KEY idx1 (gcol1) +); + +INSERT INTO t1 (col1, col2, col3, col4) + VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (5,5,5,5); + +# This will call my_eval_gcolumn_expr to compute the indexed column value +ALTER TABLE t1 ADD COLUMN extra INTEGER; + +SELECT gcol1 FROM t1 FORCE INDEX(idx1); + +DROP TABLE t1; + +# +# Test 2: column number 2 and 66 are virtual and there is an index +# on column number 66. +# +CREATE TABLE t1 ( + col1 INTEGER NOT NULL, + col2 INTEGER NOT NULL, + gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, + col3 INTEGER NOT NULL, + col4 INTEGER NOT NULL, + col5 INTEGER DEFAULT NULL, + col6 INTEGER DEFAULT NULL, + col7 INTEGER DEFAULT NULL, + col8 INTEGER DEFAULT NULL, + col9 INTEGER DEFAULT NULL, + col10 INTEGER DEFAULT NULL, + col11 INTEGER DEFAULT NULL, + col12 INTEGER DEFAULT NULL, + col13 INTEGER DEFAULT NULL, + col14 INTEGER DEFAULT NULL, + col15 INTEGER DEFAULT NULL, + col16 INTEGER DEFAULT NULL, + col17 INTEGER DEFAULT NULL, + col18 INTEGER DEFAULT NULL, + col19 INTEGER DEFAULT NULL, + col20 INTEGER DEFAULT NULL, + col21 INTEGER DEFAULT NULL, + col22 INTEGER DEFAULT NULL, + col23 INTEGER DEFAULT NULL, + col24 INTEGER DEFAULT NULL, + col25 INTEGER DEFAULT NULL, + col26 INTEGER DEFAULT NULL, + col27 INTEGER DEFAULT NULL, + col28 INTEGER DEFAULT NULL, + col29 INTEGER DEFAULT NULL, + col30 INTEGER DEFAULT NULL, + col31 INTEGER DEFAULT NULL, + col32 INTEGER DEFAULT NULL, + col33 INTEGER DEFAULT NULL, + col34 INTEGER DEFAULT NULL, + col35 INTEGER DEFAULT NULL, + col36 INTEGER DEFAULT NULL, + col37 INTEGER DEFAULT NULL, + col38 INTEGER DEFAULT NULL, + col39 INTEGER DEFAULT NULL, + col40 INTEGER DEFAULT NULL, + col41 INTEGER DEFAULT NULL, + col42 INTEGER DEFAULT NULL, + col43 INTEGER DEFAULT NULL, + col44 INTEGER DEFAULT NULL, + col45 INTEGER DEFAULT NULL, + col46 INTEGER DEFAULT NULL, + col47 INTEGER DEFAULT NULL, + col48 INTEGER DEFAULT NULL, + col49 INTEGER DEFAULT NULL, + col50 INTEGER DEFAULT NULL, + col51 INTEGER DEFAULT NULL, + col52 INTEGER DEFAULT NULL, + col53 INTEGER DEFAULT NULL, + col54 INTEGER DEFAULT NULL, + col55 INTEGER DEFAULT NULL, + col56 INTEGER DEFAULT NULL, + col57 INTEGER DEFAULT NULL, + col58 INTEGER DEFAULT NULL, + col59 INTEGER DEFAULT NULL, + col60 INTEGER DEFAULT NULL, + col61 INTEGER DEFAULT NULL, + col62 INTEGER DEFAULT NULL, + col63 INTEGER DEFAULT NULL, + col64 INTEGER DEFAULT NULL, + col65 INTEGER DEFAULT NULL, + gcol2 INTEGER GENERATED ALWAYS AS (col3 / col4) VIRTUAL, + KEY idx1 (gcol2) +); + +INSERT INTO t1 (col1, col2, col3, col4) + VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (5,5,5,5); + +# This will call my_eval_gcolumn_expr to compute the indexed column value +ALTER TABLE t1 ADD COLUMN extra INTEGER; + +SELECT gcol2 FROM t1 FORCE INDEX(idx1); + +DROP TABLE t1; +} + +if($support_virtual_index) +{ +--echo # +--echo # Bug#21628161 CRASH/MEMORY CORRUPTION ADDING INDEXES TO VIRTUAL COLUMN +--echo # +# When generating the value of column b, an out-of-range warning is +# raised. A warning is required in order to reproduce the bug, but it +# is promoted to an error on insertion unless we turn off strict mode. +CREATE TABLE t (a INT, + b BOOLEAN GENERATED ALWAYS AS (a+10000) VIRTUAL, + c BLOB GENERATED ALWAYS AS (b=2) VIRTUAL); +INSERT INTO t(a) VALUES (1); +# Before index was created, this query returned the expected one match. +SELECT * FROM t WHERE c = '0'; +# Adding an index sometimes crashed, other times populated it with garbage ... +ALTER TABLE t ADD UNIQUE INDEX (c(1)); +# ... so that this query found no match in the index. +SELECT * FROM t WHERE c = '0'; +DROP TABLE t; + +--echo # +--echo # Bug#21688115 VIRTUAL COLUMN COMPUTATION SAVE_IN_FIELD() +--echo # DID NOT RETURN TRUE WITH DIVIDE 0 +--echo # +CREATE TABLE t (a INT, b INT, h VARCHAR(10)); +INSERT INTO t VALUES (12, 3, "ss"); +INSERT INTO t VALUES (13, 4, "ss"); +INSERT INTO t VALUES (14, 0, "ss"); +ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL; +#--error ER_DIVISION_BY_ZERO +CREATE INDEX idx ON t(c); +CALL mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual column values failed"); +DROP TABLE t; +} + +--echo # +--echo # Bug#21770798 OPTIMIZER DOES NOT USE INDEX FOR GENERATED EXPRESSIONS +--echo # WITH LOGICAL OPERATORS +--echo # +CREATE TABLE t (a INT, b INT, + gc_and INT GENERATED ALWAYS AS (a AND b) STORED, + gc_or INT GENERATED ALWAYS AS (a OR b) STORED, + gc_xor INT GENERATED ALWAYS AS (a XOR b) STORED, + gc_not INT GENERATED ALWAYS AS (NOT a) STORED, + gc_case INT GENERATED ALWAYS AS + (CASE WHEN (a AND b) THEN a ELSE b END) STORED, + INDEX(gc_and), INDEX(gc_or), INDEX(gc_xor), INDEX(gc_not), + INDEX(gc_case)); +INSERT INTO t (a, b) VALUES (0, 0), (0, 1), (1, 0), (1, 1); +ANALYZE TABLE t; +EXPLAIN SELECT a, b FROM t WHERE (a AND b) = 1; +SELECT a, b FROM t WHERE (a AND b) = 1; +EXPLAIN SELECT a, b FROM t WHERE 1 = (a AND b); +SELECT a, b FROM t WHERE 1 = (a AND b); +EXPLAIN SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +EXPLAIN SELECT a, b FROM t WHERE (a OR b) = 1; +--sorted_result +SELECT a, b FROM t WHERE (a OR b) = 1; +EXPLAIN SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +--sorted_result +SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +# XOR and NOT worked even before the bug fix, but we test all logical +# operators here for completeness. +EXPLAIN SELECT a, b FROM t WHERE (a XOR b) = 1; +--sorted_result +SELECT a, b FROM t WHERE (a XOR b) = 1; +EXPLAIN SELECT a FROM t WHERE (NOT a) = 1; +SELECT a FROM t WHERE (NOT a) = 1; +# Also verify that a logical expression nested inside another +# expression doesn't prevent substitution. +EXPLAIN SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +--sorted_result +SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +# The expression must be exactly the same as the generated expression. +# (b AND a) is not recognized as equivalent to (a AND b). +EXPLAIN SELECT a, b FROM t WHERE 1 = (b AND a); +SELECT a, b FROM t WHERE 1 = (b AND a); +--sorted_result +EXPLAIN SELECT a, b FROM t WHERE 1 = (b OR a); +SELECT a, b FROM t WHERE 1 = (b OR a); +DROP TABLE t; + +--echo # +--echo # Bug#22810883: ASSERTION FAILED: +--echo # !(USED_TABS & (~READ_TABLES & ~FILTER_FOR_TABLE)) +--echo # +CREATE TABLE t1 (a1 INTEGER GENERATED ALWAYS AS (1 AND 0) STORED, + a2 INTEGER, KEY (a1)); +INSERT INTO t1 VALUES (); +CREATE TABLE t2 (b INTEGER); +INSERT INTO t2 VALUES (1); +ANALYZE TABLE t1, t2; +--echo # Used to choose the index on a1 and get wrong results. +--let $query= SELECT * FROM t1 WHERE (a2 AND a2) = 0 +--eval EXPLAIN $query +--eval $query +--echo # Used to get assertion or wrong results. +--let $query= SELECT * FROM t1 STRAIGHT_JOIN t2 ON b WHERE (b AND b) = 1 +--eval EXPLAIN $query +--eval $query +DROP TABLE t1, t2; + +--echo # diff --git a/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc b/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc new file mode 100644 index 00000000000..bc82512aa21 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc @@ -0,0 +1,155 @@ +################################################################################ +# inc/gcol_non_stored_columns.inc # +# # +# Purpose: # +# Ensure that MySQL behaviour is consistent irrelevant of # +# - the place of a non-stored column among other columns, # +# - the total number of non-stored fields. # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--echo # Case 1. All non-stored columns. +eval create $opt_tmp table t1 (a int generated always as (2+3) virtual); +insert into t1 values (default); +select * from t1; +insert into t1 values (default); +select * from t1; +drop table t1; +--echo # Case 2. CREATE +--echo # - Column1: "real" +--echo # - Column 2: virtual non-stored +eval create $opt_tmp table t1 (a int, b int generated always as (-a) virtual); +insert into t1 values (1,default); +select * from t1; +insert into t1 values (2,default); +select * from t1 order by a; +drop table t1; + +--echo # Case 3. CREATE +--echo # - Column1: "real" +--echo # - Column 2: virtual stored +eval create $opt_tmp table t1 (a int, b int generated always as (-a) stored); +insert into t1 values (1,default); +select * from t1; +insert into t1 values (2,default); +select * from t1 order by a; +drop table t1; + +--echo # Case 4. CREATE +--echo # - Column1: virtual non-stored +--echo # - Column2: "real" +eval create $opt_tmp table t1 (a int generated always as (-b) virtual, b int); +insert into t1 values (default,1); +select * from t1; +insert into t1 values (default,2); +select * from t1 order by a; +drop table t1; + +--echo # Case 5. CREATE +--echo # - Column1: virtual stored +--echo # - Column2: "real" +eval create $opt_tmp table t1 (a int generated always as (-b) stored, b int); +insert into t1 values (default,1); +select * from t1; +insert into t1 values (default,2); +select * from t1 order by a; +drop table t1; + +--echo # Case 6. CREATE +--echo # - Column1: "real" +--echo # - Column2: virtual non-stored +--echo # - Column3: virtual stored +eval create $opt_tmp table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +insert into t1 values (1,default,default); +select * from t1; +insert into t1 values (2,default,default); +select * from t1 order by a; +drop table t1; + +--echo # Case 7. ALTER. Modify virtual stored -> virtual non-stored +eval create $opt_tmp table t1 (a int, b int generated always as (a % 2) stored); +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +alter table t1 modify b int generated always as (a % 2) virtual; +show create table t1; +drop table t1; + +--echo # Case 8. ALTER. Modify virtual non-stored -> virtual stored +eval create $opt_tmp table t1 (a int, b int generated always as (a % 2) virtual); +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +alter table t1 modify b int generated always as (a % 2) stored; +show create table t1; +drop table t1; + +--echo # Case 9. CREATE LIKE +--echo # - Column1: "real" +--echo # - Column2: virtual non-stored +--echo # - Column3: virtual stored +eval create $opt_tmp table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +eval create $opt_tmp table t2 like t1; +insert into t2 values (1,default,default); +select * from t2; +insert into t2 values (2,default,default); +select * from t2 order by a; +drop table t2; +drop table t1; + +--echo # Case 10. ALTER. Dropping a virtual non-stored column. +--echo # - Column1: virtual non-stored +--echo # - Column2: "real" +eval create $opt_tmp table t1 (a int generated always as (-b) virtual, b int, c varchar(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +alter table t1 drop column a; +select * from t1 order by b; +show create table t1; +drop table t1; + +--echo # Case 11. ALTER. Dropping a virtual stored column. +--echo # - Column1: virtual stored +--echo # - Column2: "real" +eval create $opt_tmp table t1 (a int generated always as (-b) stored, b int, c char(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +alter table t1 drop column a; +select * from t1 order by b; +show create table t1; +drop table t1; + +--echo # Case 12. ALTER. Adding a new virtual non-stored column. +eval create $opt_tmp table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +alter table t1 add column c int generated always as (dayofyear(b)) virtual after a; +select * from t1 order by a; +show create table t1; +drop table t1; + +--echo # Case 13. ALTER. Adding a new virtual stored column. +eval create $opt_tmp table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +alter table t1 add column c int generated always as (dayofyear(b)) stored after a; +select * from t1 order by a; +show create table t1; +drop table t1; + +--echo # Case 15. ALTER. Changing the expression of a virtual non-stored column. +eval create $opt_tmp table t1 (a int, b datetime, c int generated always as (week(b)) virtual); +insert into t1 values (1,'2008-09-04',default); +insert into t1 values (2,'2008-09-05',default); +select * from t1 order by a; +alter table t1 change column c c int generated always as (week(b,1)) virtual; +select * from t1 order by a; +show create table t1; +drop table t1; + diff --git a/mysql-test/suite/gcol/inc/gcol_partition.inc b/mysql-test/suite/gcol/inc/gcol_partition.inc new file mode 100644 index 00000000000..df199e86c68 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_partition.inc @@ -0,0 +1,155 @@ +################################################################################ +# inc/gcol_partition.inc # +# # +# Purpose: # +# Testing partitioning tables with generated columns. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--source include/have_partition.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +--echo # Case 1. Partitioning by RANGE based on a non-stored generated column. + +CREATE TABLE t1 ( + a DATE NOT NULL, + b int generated always as (year(a)) virtual +) +PARTITION BY RANGE( b ) ( + PARTITION p0 VALUES LESS THAN (2006), + PARTITION p2 VALUES LESS THAN (2008) +); + +insert into t1 values ('2006-01-01',default); +insert into t1 values ('2007-01-01',default); +insert into t1 values ('2005-01-01',default); +select * from t1; + +# Specifically for MyISAM, check that data is written into correct +# $MYSQLTEST_VARDIR/master-data/test/t1*p?.MYD files + +--echo # Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; + +select * from t1; + +drop table t1; + +--echo # Case 2. Partitioning by LIST based on a stored generated column. + +CREATE TABLE t1 (a int, b int generated always as (a % 3 ) stored) +PARTITION BY LIST (a+1) +(PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); + +insert into t1 values (1,default); +select * from t1; + +# +# NOTE: The following tests are currently failing due to a +# [suspected] bug in the existing partition functionality. +# Here is what was observed when using mysqld compiled prior +# to adding the generated column functionality. +# mysql> create table t1 (a int) partition by list (a) +# (partition p1 values in (1), partition p2 values in (2)); +# Query OK, 0 rows affected (0.00 sec) +# +# mysql> insert into t1 values (1), (1), (2); +# Query OK, 3 rows affected (0.00 sec) +# Records: 3 Duplicates: 0 Warnings: 0 +# +# mysql> select * from t1; +# +------+ +# | a | +# +------+ +# | 1 | +# | 1 | +# | 2 | +# +------+ +# 3 rows in set (0.00 sec) +# +# mysql> alter table t1 reorganize partition p1 into +# (partition p1 values in (3)); +# Query OK, 2 rows affected (3.90 sec) +# Records: 2 Duplicates: 2 Warnings: 0 +# +# mysql> select * from t1; +# +------+ +# | a | +# +------+ +# | 2 | <- Two row have been lost!!! +# +------+ +# 1 row in set (0.00 sec) + +# +#alter table t1 change b b virtual int as ((a % 3)+1) stored; +#--error ER_NO_PARTITION_FOR_GIVEN_VALUE +#alter table t1 change b b virtual int as (a % 2) stored; +#if ($myisam_engine) +#{ +# --echo # Check how data is physically partitioned. +# --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +# --exec du -b $MYSQLTEST_VARDIR/master-data/test/t1*p?.MYD +#} + +select * from t1; + +drop table t1; + +--echo # Case 3. Partitioning by HASH based on a non-stored generated column. + +CREATE TABLE t1 ( + a DATE NOT NULL, + b int generated always as (year(a)) virtual +) +PARTITION BY HASH( b % 3 ) PARTITIONS 3; + +insert into t1 values ('2005-01-01',default); +insert into t1 values ('2006-01-01',default); +select * from t1; + +--echo # Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; + +select * from t1; + +drop table t1; + +--echo # +--echo # Bug#21779011 INVALID READS AND SENDING RANDOM SERVER MEMORY BACK +--echo # TO CLIENT +--echo # + +CREATE TABLE t ( + c INTEGER GENERATED ALWAYS AS (2) VIRTUAL, + d INTEGER, + KEY (d) +) PARTITION BY KEY (d) PARTITIONS 2; + +INSERT INTO t (d) VALUES (1),(1),(2),(2); + +SELECT c FROM t WHERE d >= 1 GROUP BY d LIMIT 2; + +DROP TABLE t; + +--echo # +--echo # Bug#21779554: CHECK_MISPLACED_ROWS BOGUS "FOUND A MISPLACED ROW" +--echo # AND CRASHES +--echo # +CREATE TABLE t(a INT,b INT GENERATED ALWAYS AS (1) VIRTUAL,c INT) +PARTITION BY KEY (b)PARTITIONS 6; +INSERT INTO t VALUES(); +CHECK TABLE t EXTENDED; +FLUSH TABLES; +CHECK TABLE t EXTENDED; +DROP TABLE t; diff --git a/mysql-test/suite/gcol/inc/gcol_select.inc b/mysql-test/suite/gcol/inc/gcol_select.inc new file mode 100644 index 00000000000..efaffd5168d --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_select.inc @@ -0,0 +1,1163 @@ +################################################################################ +# inc/gcol_select.inc # +# # +# Purpose: # +# Testing different SELECTs. # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-18 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# Table t1 is used below to test: +# - Join type of ALL (sequential scan of the entire table) +# - Join type of Index +# - Join type of Range +# - Join type of Ref_or_null +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored, + index (c)); +insert into t1 (a) values (2), (1), (1), (3), (NULL); + +# Table t2 is used below to test: +# - Join type of system and const +create table t2 like t1; +insert into t2 (a) values (1); + +# Table t3 is used below to test +# - Join type of Eq_ref with a unique generated column +# - Join type of Const +create table t3 (a int primary key, + b int generated always as (-a) virtual, + c int generated always as (-a) stored unique); +insert into t3 (a) values (2),(1),(3); +analyze table t1,t2,t3; + +--echo # select_type=SIMPLE, type=system +let $s = select * from t2; +eval $s; +eval explain $s; + +let $s = select * from t2 where c=-1; +eval $s; +eval explain $s; + +--echo # select_type=SIMPLE, type=ALL +let $s = select * from t1 where b=-1; +eval $s; +eval explain $s; + +--echo # select_type=SIMPLE, type=const +let $s = select * from t3 where a=1; +eval $s; +eval explain $s; + +--echo # select_type=SIMPLE, type=range +let $s = select * from t3 where c>=-1; +eval $s; +eval explain $s; + +--echo # select_type=SIMPLE, type=ref +let $s = select * from t1,t3 where t1.c=t3.c and t3.c=-1; +eval $s; +eval explain $s; + +--echo # select_type=PRIMARY, type=index,ALL +let $s = select * from t1 where b in (select c from t3); +--sorted_result +eval $s; +eval explain $s; + +--echo # select_type=PRIMARY, type=range,ref +--sorted_result +let $s = select * from t1 where c in (select c from t3 where c between -2 and -1); +eval $s; +eval explain $s; + +--echo # select_type=UNION, type=system +--echo # select_type=UNION RESULT, type= +let $s = select * from t1 union select * from t2; +--sorted_result +eval $s; +eval explain $s; + +--echo # select_type=DERIVED, type=system +let $s = select * from (select a,b,c from t1) as t11; +--sorted_result +eval $s; +eval explain $s; + +--echo ### +--echo ### Using aggregate functions with/without DISTINCT +--echo ### +--echo # SELECT COUNT(*) FROM tbl_name +let $s = select count(*) from t1; +eval $s; +eval explain $s; + +--echo # SELECT COUNT(DISTINCT ) FROM tbl_name +let $s = select count(distinct a) from t1; +eval $s; +eval explain $s; + +--echo # SELECT COUNT(DISTINCT ) FROM tbl_name +let $s = select count(distinct b) from t1; +eval $s; +eval explain $s; + +--echo # SELECT COUNT(DISTINCT ) FROM tbl_name +let $s = select count(distinct c) from t1; +eval $s; +eval explain $s; + +--echo ### +--echo ### filesort & range-based utils +--echo ### +--echo # SELECT * FROM tbl_name WHERE +let $s = select * from t3 where c >= -2; +--sorted_result +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE +let $s = select * from t3 where a between 1 and 2; +--sorted_result +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE +let $s = select * from t3 where b between -2 and -1; +--sorted_result +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE +let $s = select * from t3 where c between -2 and -1; +--sorted_result +eval $s; +eval explain $s; + +#### Remove for MyISAM due to a bug +#### when all the three records are returned (a=1,2,3) +#### instead of just two (a=1,2). +#### This bug is presumably in base SQL routines as the same happens +#### with this table: +#### create table t4 (a int primary key, b int, c int unique); +let $myisam_engine = `SELECT @@session.default_storage_engine='myisam'`; +if (!$myisam_engine) +{ + --echo # SELECT * FROM tbl_name WHERE ORDER BY + let $s = select * from t3 where a between 1 and 2 order by b; + eval $s; + eval explain $s; + --echo # bug#20022189: WL411:DEBUG ASSERT AT FIELD_LONG::VAL_INT IN SQL/FIELD.CC + --echo # SELECT * FROM tbl_name WHERE ORDER BY + let $s = select * from t3 where a between 1 and 2 order by c; + eval $s; + eval explain $s; +} +--echo # bug#20022189: WL411:DEBUG ASSERT AT FIELD_LONG::VAL_INT IN SQL/FIELD.CC +CREATE TABLE t4 ( + `pk` int(11) NOT NULL , + `col_int_nokey` int(11) GENERATED ALWAYS AS (pk + col_int_key) STORED, + `col_int_key` int(11) DEFAULT NULL, + `col_date_nokey` date DEFAULT NULL, + `col_datetime_key` datetime DEFAULT NULL, + PRIMARY KEY (`pk`), + KEY `col_int_key` (`col_int_key`), + KEY `col_datetime_key` (`col_datetime_key`) +); + +INSERT INTO t4 VALUES +(1,default,4,'2008-12-05','1900-01-01 00:00:00'); + +SELECT +SQL_BIG_RESULT +GRANDPARENT1 . `col_int_nokey` AS g1 +FROM t4 AS GRANDPARENT1 LEFT JOIN t4 AS GRANDPARENT2 ON ( GRANDPARENT2 . +`col_datetime_key` <= GRANDPARENT1 . `col_date_nokey` ) +GROUP BY GRANDPARENT1 . `pk`; +DROP TABLE t4; + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where a between 1 and 2 order by c; +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where b between -2 and -1 order by a; +eval $s; +eval explain $s; + +#### Remove for MyISAM due to a bug +#### when all the three records are returned (a=1,2,3) +#### instead of just two (a=1,2). +#### This bug is presumably in base SQL routines as the same happens +#### with this table: +#### create table t4 (a int primary key, b int, c int unique); +let $innodb_engine = `SELECT @@session.default_storage_engine='innodb'`; +if (!$innodb_engine) +{ + --echo # SELECT * FROM tbl_name WHERE ORDER BY + let $s = select * from t3 where c between -2 and -1 order by a; + eval $s; + eval explain $s; +} + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where b between -2 and -1 order by b; +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where c between -2 and -1 order by b; +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where b between -2 and -1 order by c; +eval $s; +eval explain $s; + +--echo # SELECT * FROM tbl_name WHERE ORDER BY +let $s = select * from t3 where c between -2 and -1 order by c; +eval $s; +eval explain $s; + +--echo # SELECT sum() FROM tbl_name GROUP BY +let $s = select sum(b) from t1 group by b; +eval $s; +eval explain $s; + +--echo # SELECT sum() FROM tbl_name GROUP BY +let $s = select sum(c) from t1 group by c; +eval $s; +eval explain $s; + +--echo # SELECT sum() FROM tbl_name GROUP BY +let $s = select sum(b) from t1 group by c; +eval $s; +eval explain $s; + +--echo # SELECT sum() FROM tbl_name GROUP BY +let $s = select sum(c) from t1 group by b; +eval $s; +eval explain $s; + +drop table t1; + +--echo # +--echo # Bug#20241655: WL411:FAILING ASSERTION ASSERTION +--echo # +CREATE TABLE BB ( + col_time_key time NOT NULL, + col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, + col_datetime_key datetime NOT NULL); +INSERT INTO BB VALUES('23:28:02', default, '2005-03-15 22:48:25'); + +CREATE TABLE CC ( + col_time_key time NOT NULL, + col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, + col_datetime_key datetime NOT NULL +); +INSERT INTO CC VALUES('16:22:51', default, '1900-01-01 00:00:00'); + +SELECT 1 AS g1 FROM BB AS gp1 LEFT JOIN BB AS gp2 USING ( col_time_nokey); +DROP TABLE BB, CC; + +--echo # +--echo # Bug#20328786: WL411:VALGRIND WARNINGS OF CONDITIONAL +--echo # JUMP WHILE SELECTING FROM VIEW +--echo # +CREATE TABLE A ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER, + col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, + PRIMARY KEY (pk) +); + +CREATE TABLE C ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER, + col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, + col_varchar_nokey VARCHAR(1), + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_varchar_key, col_int_key) +); + +INSERT INTO C ( + col_int_nokey, + col_varchar_nokey +) VALUES (4, 'v'),(62, 'v'),(7, 'c'),(1, NULL),(0, 'x'),(7, 'i'),(7, 'e'),(1, 'p'),(7, 's'),(1, 'j'),(5, 'z'),(2, 'c'),(0, 'a'),(1, 'q'),(8, 'y'),(1, NULL),(1, 'r'),(9, 'v'),(1, NULL),(5, 'r'); + +CREATE OR REPLACE ALGORITHM=MERGE VIEW V1 AS SELECT alias1. +col_varchar_key AS field1 , alias1.pk AS field2, alias2. +col_int_nokey AS field3 FROM C AS alias1 LEFT JOIN A AS alias2 ON +alias1.pk = alias2.col_int_key WHERE alias1.pk > 8 AND alias1 +.pk < ( 9 + 2 ) AND alias1.col_int_key <> 1 OR alias1.col_int_key +> 0 AND alias1.col_int_key <= ( 3 + 2 ) ORDER BY field1, field2, field3 +LIMIT 100 OFFSET 6; + +SELECT * FROM V1; + +DROP VIEW V1; +DROP TABLE A,C; + +--echo # +--echo # Bug#20406510: WL411:VALGRIND WARNINGS WITH +--echo # COUNT DISTINCT QUERY ON VIRTUAL GC VARCHAR COLUMN +--echo # +CREATE TABLE A ( + pk INTEGER AUTO_INCREMENT, + col_time_key TIME NOT NULL, + col_datetime_key DATETIME NOT NULL, + PRIMARY KEY (pk), + KEY (col_time_key), + KEY (col_datetime_key) +); + +CREATE TABLE C ( + pk INTEGER AUTO_INCREMENT, + col_int_key INTEGER NOT NULL, + col_varchar_key VARCHAR(1) NOT NULL, + col_varchar_nokey VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_key, col_varchar_key)), + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_varchar_key, col_int_key) +); + +INSERT INTO C (col_int_key,col_varchar_key) VALUES (0, 'j'),(8, 'v'),(1, 'c'),(8, 'm'),(9, 'd'); +SELECT MIN( alias2 . col_int_key ) AS field1, +COUNT( DISTINCT alias2 . col_varchar_nokey ) AS field2 +FROM ( A AS alias1 , C AS alias2 ) +ORDER BY alias1.col_time_key, alias1.col_datetime_key, alias1.pk ASC; +DROP TABLE A,C; + +--echo # +--echo # Bug#20566325: WL8149: INNODB: FAILING ASSERTION: +--echo # COL_NR < TABLE->N_DEF +--echo # +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); + +INSERT /*! IGNORE */ INTO A (col_varchar_nokey) VALUES ('k'); + +CREATE TABLE CC ( +pk INTEGER AUTO_INCREMENT, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk)); + +INSERT INTO CC (col_time_nokey,col_datetime_nokey,col_varchar_nokey) VALUES +('13:06:13.033877','1900-01-01 00:00:00', 'p'), +(NULL, '2007-05-25 11:58:54.015689', 'g'); + +SELECT +table1.col_time_key AS field1, +'z' AS field2 +FROM +(CC AS table1 LEFT OUTER JOIN (A AS table2 STRAIGHT_JOIN CC AS table3 ON +(table3.col_varchar_key = table2.col_varchar_nokey)) ON +(table3.col_varchar_key = table2.col_varchar_nokey)) +WHERE +table2.pk != 6 +AND table1.col_varchar_key IN ('l', 's' , 'b' ) +AND table3.col_varchar_key != table1.col_varchar_key +ORDER BY table1.col_varchar_key , field1 , field2; + +DROP TABLE A,CC; + +if ($support_virtual_index) +{ +--echo # +--echo # Bug#20573302: WL8149: SEGV IN HA_INNOBASE:: +--echo # BUILD_TEMPLATE AT INNOBASE/HANDLER/HA_INNODB.CC:665 +--echo # +CREATE TABLE c ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, + + col_date_nokey DATE NOT NULL, + col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, + + col_datetime_nokey DATETIME NOT NULL, + col_time_nokey TIME NOT NULL, + + col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), + col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), + + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)), + + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_varchar_key), + KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_varchar_key, col_date_key, + col_time_key, col_datetime_key)); + +INSERT /*! IGNORE */ INTO c ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey + ) VALUES +(1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(24, '2000-10-08', '10:14:58.018534', '2006-10-12 04:32:53.031976', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(1, '2008-01-23', '11:14:24.032949', '2004-10-02 20:31:15.022553', 't'), +(6, '2007-06-18', NULL, '2002-08-20 22:48:00.035785', 'd'), +(2, '2002-10-13', '00:00:00', '1900-01-01 00:00:00', 's'), +(4, '1900-01-01', '15:57:25.019666', '2005-08-15 00:00:00', 'r'), +(8, NULL, '07:05:51.006712', '1900-01-01 00:00:00', 'm'), +(4, '2006-03-09', '19:22:21.057406', '2008-05-16 08:09:06.002924', 'b'), +(4, '2001-06-05', '03:53:16.001370', '2001-01-20 12:47:23.022022', 'x'), +(7, '2006-05-28', '09:16:38.034570', '2008-07-02 00:00:00', 'g'), +(4, '2001-04-19', '15:37:26.028315', '1900-01-01 00:00:00', 'p'), +(1, '1900-01-01', '00:00:00', '2002-12-08 11:34:58.001571', 'q'), +(9, '2004-08-20', '05:03:03.047452', '1900-01-01 00:00:00', 'w'), +(4, '2004-10-10', '02:59:24.063764', '1900-01-01 00:00:00', 'd'), +(8, '2000-04-02', '00:01:58.064243', '2002-08-25 20:35:06.064634', 'e'), +(4, '2006-11-02', '00:00:00', '2001-10-22 11:13:24.048128', 'b'), +(8, '2009-01-28', '02:20:16.024931', '2003-03-12 02:00:34.029335', 'y'); + +CREATE TABLE cc ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, + + col_date_nokey DATE NOT NULL, + col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, + + col_datetime_nokey DATETIME NOT NULL, + col_time_nokey TIME NOT NULL, + + col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), + col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), + + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)), + + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_varchar_key), + KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_varchar_key, col_date_key, + col_time_key, col_datetime_key)); + +INSERT /*! IGNORE */ INTO cc ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey + ) VALUES +(0, '2003-02-06', '22:02:09.059926', '2003-08-07 14:43:09.011144', 'x'), +(0, '2005-04-16', '19:33:15.014160', '2005-12-11 00:00:00', 'n'), +(1, '2005-07-23', '22:03:16.058787', '2005-12-26 20:48:07.043628', 'w'), +(7, '2001-11-15', '06:31:23.027263', '2008-06-12 06:41:21.012493', 's'), +(0, '2006-03-24', '02:19:08.013275', '2007-10-11 18:46:28.030000', 'a'), +(4, '2008-07-10', NULL, '2006-04-04 22:22:40.057947', 'd'), +(1, '2009-12-07', NULL, '2002-08-10 20:52:58.035137', 'w'), +(1, '2008-05-01', '10:28:01.038587', '2008-10-03 11:17:23.005299', 'j'), +(1, '2008-06-22', '00:00:00', '2009-01-06 20:11:01.034339', 'm'), +(4, '2001-11-11', '15:02:50.048785', '2009-09-19 00:00:00', 'k'), +(7, '2000-12-21', '05:29:13.012729', '2007-09-02 12:14:27.029187', 't'), +(4, '2007-09-03', '23:45:33.048507', '2003-09-26 00:00:00', 'k'), +(2, '2003-02-18', '19:10:53.057455', '2001-11-18 18:10:16.063189', 'e'), +(0, '2008-12-01', '01:45:27.037313', '2005-02-15 04:08:17.015554', 'i'), +(1, '2008-10-18', '03:56:03.060218', '2009-06-13 23:04:40.013006', 't'), +(91, '2004-08-28', '12:43:17.023797', '1900-01-01 00:00:00', 'm'), +(6, '2006-10-05', '13:33:46.053634', '2005-03-20 02:48:24.045653', 'z'), +(3, '2003-05-16', NULL, '2002-03-16 11:47:27.045297', 'c'), +(6, '2008-10-10', NULL, '2000-05-22 00:00:00', 'i'), +(8, '2002-01-19', '05:18:40.006865', '2009-02-12 00:00:00', 'v'); + +--replace_column 10 # 11 # +EXPLAIN +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN + (c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON + (subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON + (subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; + +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN + (c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON + (subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON + (subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN + (c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON + (subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON + (subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; + +DROP TABLE c,cc; + +--echo # +--echo # Bug#2081065: WL8149:RESULT DIFF SEEN FOR SIMPLE +--echo # RANGE QUERIES WITH ORDER BY +--echo # +CREATE TABLE cc ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_int_key INTEGER GENERATED ALWAYS AS + (col_int_nokey + col_int_nokey) VIRTUAL, + PRIMARY KEY (pk), + KEY (col_int_key) +); +INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5); +--replace_column 10 # 11 # +EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3; +SELECT pk FROM cc WHERE col_int_key > 3; +--replace_column 10 # 11 # +EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +DROP TABLE cc; + +--echo # +--echo # Bug#20849676 :WL8149:ASSERTION `!TABLE || (!TABLE->READ_SET +--echo # || BITMAP_IS_SET(TABLE->READ_SET +--echo # +CREATE TABLE c ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_int_key INTEGER GENERATED ALWAYS AS + (col_int_nokey + col_int_nokey) VIRTUAL, + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)), + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_varchar_key), + KEY (col_int_key, col_varchar_key) +) ; + +INSERT INTO c (col_int_nokey, col_varchar_nokey) VALUES +(1, 'c'),(8, 'm'),(9, 'd'),(24, 'd'),(6, 'y'),(1, 't'),(6, 'd'), +(2, 'r'),(8, 'm'),(4, 'b'),(4, 'x'),(7, 'g'),(4, 'p'),(1, 'q'), +(9, 'w'),(4, 'd'),(8, 'e'),(4, 'b'),(8, 'y'); + +CREATE TABLE a ( + pk INTEGER AUTO_INCREMENT, + col_datetime_nokey DATETIME NOT NULL, + col_time_nokey TIME NOT NULL, + col_datetime_key DATETIME GENERATED ALWAYS AS + (ADDTIME(col_datetime_nokey, col_time_nokey)), + col_time_key TIME GENERATED ALWAYS AS + (ADDTIME(col_datetime_nokey, col_time_nokey)), + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)), + PRIMARY KEY (pk), + KEY (col_varchar_key), + KEY (col_time_key), + KEY (col_datetime_key), + KEY (col_varchar_key, col_time_key, col_datetime_key) +); + +INSERT INTO a ( + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey) VALUES +('04:08:02.046897', '2001-11-04 19:07:55.051133', 'k'); + +ANALYZE TABLE a, c; + +--replace_column 10 # +--disable_warnings +EXPLAIN +SELECT +table1.pk AS field1 , +table1.col_datetime_key AS field2 +FROM +( a AS table1 LEFT JOIN ( ( c AS table2 STRAIGHT_JOIN ( SELECT +SUBQUERY1_t1.* FROM ( c AS SUBQUERY1_t1 INNER JOIN ( c AS SUBQUERY1_t2 +STRAIGHT_JOIN c AS SUBQUERY1_t3 ON (SUBQUERY1_t3.col_varchar_key = +SUBQUERY1_t2.col_varchar_key ) ) +ON (SUBQUERY1_t3.pk = SUBQUERY1_t2.col_int_key +OR SUBQUERY1_t1.col_int_key <> 1 ) ) +WHERE SUBQUERY1_t2.pk >= 9 ) AS table3 +ON (table3.col_int_key = table2.col_int_key ) ) ) +ON (table3.col_int_nokey = table2.pk ) ) +GROUP BY field1, field2; +SELECT +table1.pk AS field1 , +table1.col_datetime_key AS field2 +FROM +( a AS table1 LEFT JOIN ( ( c AS table2 STRAIGHT_JOIN ( SELECT +SUBQUERY1_t1.* FROM ( c AS SUBQUERY1_t1 INNER JOIN ( c AS SUBQUERY1_t2 +STRAIGHT_JOIN c AS SUBQUERY1_t3 ON (SUBQUERY1_t3.col_varchar_key = +SUBQUERY1_t2.col_varchar_key ) ) +ON (SUBQUERY1_t3.pk = SUBQUERY1_t2.col_int_key +OR SUBQUERY1_t1.col_int_key <> 1 ) ) +WHERE SUBQUERY1_t2.pk >= 9 ) AS table3 +ON (table3.col_int_key = table2.col_int_key ) ) ) +ON (table3.col_int_nokey = table2.pk ) ) +GROUP BY field1, field2; + +--enable_warnings +DROP TABLE IF EXISTS c,a; +CREATE TABLE c ( +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS + (col_int_nokey + col_int_nokey) VIRTUAL, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)), + +KEY (col_int_key), +KEY (col_int_key, col_varchar_key) +) ; + +INSERT INTO c ( +col_int_nokey, +col_varchar_nokey +) VALUES (1, 'c'),(8, 'm'),(9, 'd'),(24, 'd'),(6, 'y'),(1, 't'), +(6, 'd'),(2, 's'),(4, 'r'),(8, 'm'),(4, 'b'),(4, 'x'),(7, 'g'),(4, 'p'), +(1, 'q'),(9, 'w'),(4, 'd'),(8, 'e'),(4, 'b'),(8, 'y'); + +CREATE TABLE cc ( +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +KEY (col_int_key), +KEY (col_varchar_key), +KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY (col_varchar_key, col_varchar_nokey) +); +INSERT INTO cc ( +col_int_nokey, +col_varchar_nokey +) VALUES (8, 'p'),(9, 'g'),(9, 'i'),(4, 'p'),(7, 'h'),(1, 'e'),(8, 'e'),(6, 'u'), +(6, 'j'),(6, 'e'),(1, 'z'),(227, 'w'),(NULL, 't'),(9, 'i'),(1, 'i'),(8, 'i'), +(5, 'b'),(8,'m'),(7, 'j'),(2, 'v'); +ANALYZE TABLE c, cc; + +--replace_column 10 # +--disable_warnings + +let query=SELECT +alias2 . col_varchar_key AS field1 +FROM ( cc AS alias1 , cc AS alias2 ) +WHERE +( alias2 . col_int_key , alias1 . col_int_nokey ) +NOT IN +( +SELECT +DISTINCT SQ1_alias2 . col_int_nokey AS SQ1_field1 , +SQ1_alias1 . col_int_key AS SQ1_field2 +FROM ( cc AS SQ1_alias1 , c AS SQ1_alias2 ) +GROUP BY SQ1_field1 , SQ1_field2 +) +GROUP BY field1; + +eval EXPLAIN $query; +eval $query; + +DROP TABLE IF EXISTS c,cc; + +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; +CREATE TABLE d ( + col_int int(11) DEFAULT NULL, + col_varchar_10_utf8 varchar(10) CHARACTER SET utf8 DEFAULT NULL, + pk int(11) NOT NULL AUTO_INCREMENT, + col_int_key int(11) GENERATED ALWAYS AS (col_int+col_int) VIRTUAL, + col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT(SUBSTRING(col_varchar_10_utf8, -1), 5)) VIRTUAL, + PRIMARY KEY (pk), + KEY col_int_key (col_int_key), + KEY col_varchar_10_utf8_key (col_varchar_10_utf8_key), + KEY cover_key1 (col_int_key, col_varchar_10_utf8_key) +); + +INSERT INTO d (col_int, col_varchar_10_utf8) VALUES ('qhlhtrovam',1),('how',2),('htrovamzqr',3),('rovamzqrdc',4),('well',5),('g',6),('rdcenchyhu',7),('want',8); + +SELECT table1.pk AS field1 FROM d AS table1 LEFT JOIN d AS table2 ON table1.col_varchar_10_utf8_key = table2.col_varchar_10_utf8_key WHERE table1.col_int_key IS NULL GROUP BY table1.pk ; + +DROP TABLE d; + +--echo # +--echo # Bug#21153237: WL8149: QUERIES USING FILESORT +--echo # ON VIRTUAL GC HAVING INDEX GIVES WRONG RESULTS +--echo # +CREATE TABLE j ( +col_int int(11), +pk int(11) NOT NULL, +col_varchar_10_utf8 varchar(10) CHARACTER SET utf8 DEFAULT NULL, +col_varchar_255_utf8_key varchar(255) CHARACTER SET utf8 GENERATED ALWAYS AS +(col_varchar_10_utf8) VIRTUAL, +PRIMARY KEY (pk), +KEY cover_key1 (col_int, col_varchar_255_utf8_key)); + +INSERT INTO j(col_int, pk, col_varchar_10_utf8) VALUES(9, 1, '951910400'), +(-1934295040, 2, '1235025920'),(-584581120, 3, '-1176633344'),(3, 4, '1074462720'); + +--replace_column 10 # +EXPLAIN SELECT col_varchar_255_utf8_key FROM j ORDER BY 1; +SELECT col_varchar_255_utf8_key FROM j ORDER BY col_varchar_255_utf8_key; + +DROP TABLE j; + +set sql_mode= @save_old_sql_mode; +--enable_warnings +} + +CREATE TABLE cc ( + pk int(11) NOT NULL AUTO_INCREMENT, + col_int_nokey int(11) NOT NULL, + col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) STORED, + col_date_nokey date NOT NULL, + col_date_key date GENERATED ALWAYS AS (col_date_nokey) STORED, + col_datetime_nokey datetime NOT NULL, + col_time_nokey time NOT NULL, + col_datetime_key datetime GENERATED ALWAYS AS (col_datetime_nokey)STORED, + col_time_key time GENERATED ALWAYS AS (col_time_nokey) STORED, + col_varchar_nokey varchar(1) NOT NULL, + col_varchar_key varchar(1) GENERATED ALWAYS AS (col_varchar_nokey)STORED, + PRIMARY KEY (pk), + KEY gc_idx1 (col_int_key), + KEY gc_idx2 (col_varchar_key), + KEY gc_idx3 (col_date_key), + KEY gc_idx4 (col_time_key), + KEY gc_idx5 (col_datetime_key), + KEY gc_idx6 (col_varchar_key,col_int_key), + KEY gc_idx7 (col_date_key,col_datetime_key,col_time_key), + KEY gc_idx8(col_int_key,col_varchar_key,col_date_key,col_time_key, + col_datetime_key) +); + +INSERT INTO cc ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey +) VALUES (1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(24, '2000-10-08', '10:14:58.018534', '2006-10-12 04:32:53.031976', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(1, '2008-01-23', '11:14:24.032949', '2004-10-02 20:31:15.022553', 't'); +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; + +# Warnings arrive in unpredictable order with NDB and cannot be sorted +if ($testing_ndb) +{ +--disable_warnings +} +SELECT DISTINCT alias1.col_varchar_key AS field1 +FROM ( cc AS alias1 STRAIGHT_JOIN + (( cc AS alias2 STRAIGHT_JOIN cc AS alias3 ON + (alias3.col_varchar_key > alias2.col_varchar_key ) ) ) ON + (( alias3 .pk >= alias2.col_int_nokey ) AND + (alias3 .pk >= alias2.col_int_nokey ) )) +WHERE alias1.col_varchar_key <= 'v' +GROUP BY field1 HAVING field1 = 91 +ORDER BY field1, alias1.col_date_key, field1 ASC, field1 DESC, + alias1.col_time_key ASC, field1; +DROP TABLE cc; +SET sql_mode=@save_old_sql_mode; +if ($testing_ndb) +{ +--enable_warnings +} + +--echo # +--echo # Bug#20797941: WL8149:ASSERTION !TABLE || +--echo # (!TABLE->READ_SET || BITMAP_IS_SET(TABLE->READ_SET +--echo # +CREATE TABLE t(a int, b int as(a+1)); +INSERT INTO t(a) values(1),(2); +SELECT * FROM t ORDER BY b; +DROP TABLE t; + +if ($support_virtual_index) +{ +--echo # +--echo # Testing a few index-based accesses on the virtual column +--echo # + +CREATE TABLE t1 ( +id int(11) NOT NULL, +b int(11) GENERATED ALWAYS AS (id+1) VIRTUAL, +UNIQUE KEY (b) ); + +--error ER_BAD_NULL_ERROR +INSERT INTO t1 (id) VALUES(NULL); + +INSERT INTO t1 (id) VALUES(2),(3); + +# constant table read with one index lookup +EXPLAIN SELECT * FROM t1 FORCE INDEX(b) WHERE b=3; + +# eq_ref +EXPLAIN SELECT * FROM t1 AS t2 STRAIGHT_JOIN t1 FORCE INDEX(b) WHERE t1.b=t2.b; + +# covering index scan +EXPLAIN SELECT b FROM t1 FORCE INDEX(b); + +# range scan +INSERT INTO t1 (id) VALUES(4),(5),(6),(7),(8),(9),(10); +EXPLAIN SELECT b FROM t1 FORCE INDEX(b) WHERE b BETWEEN 1 AND 5; + +# index-subquery +EXPLAIN SELECT * FROM t2 AS t1 WHERE b NOT IN (SELECT b FROM t1 FORCE INDEX(b)); + +DROP TABLE t1; +} + +DROP TABLE t2, t3; + +--echo # +--echo # Bug#21317507:GC: STORED COLUMN REJECTED, BUT VIRTUAL IS ACCEPTED +--echo # +--disable_abort_on_error +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN b; +ALTER TABLE t1 ADD COLUMN c SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN c; +ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL; +ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL; +ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL; +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL; +ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY; +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED; +ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE; +--enable_abort_on_error +DROP TABLE t1; + +--echo # +--echo # Bug#21980430 GCOLS: CRASHING +--echo # +CREATE TABLE t ( + a INT, + b BLOB, + c BLOB GENERATED ALWAYS AS (a+b) VIRTUAL, + UNIQUE KEY i0008 (a) +); + +INSERT INTO t(a,b) VALUES(1,'cccc'); +let $query= +SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c +WHERE b.b>c.a; +eval EXPLAIN $query; +eval $query; +DROP TABLE t; + +# Force DS-MRR to be used +set @optimizer_switch_save = @@optimizer_switch; +set optimizer_switch='mrr_cost_based=off'; + +# Reduce the size of the DS-MRR sort buffer to force multiple rounds +set @read_rnd_buffer_size_save= @@read_rnd_buffer_size; +set read_rnd_buffer_size=32; + +CREATE TABLE t0 ( + i1 INTEGER NOT NULL +); + +INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +CREATE TABLE t1 ( + pk INTEGER NOT NULL, + i1 INTEGER NOT NULL, + i2 INTEGER NOT NULL, + v1 INTEGER GENERATED ALWAYS AS (i2 + 1) VIRTUAL, + v2 INTEGER GENERATED ALWAYS AS (i1 / (i1 - i2 + 57)) VIRTUAL, + PRIMARY KEY (pk), + INDEX idx(i1) +); + +INSERT INTO t1 (pk, i1, i2) +SELECT a0.i1 + a1.i1*10 + a2.i1*100, + a0.i1 + a1.i1*10, + a0.i1 + a1.i1*10 +FROM t0 AS a0, t0 AS a1, t0 AS a2; + +# Do a DS-MRR scan on an index on a non-generated column +# (this caused Division by 0 errors to be reported). +let query1= +SELECT * FROM t1 +WHERE i1 > 41 AND i1 <= 43; + +eval EXPLAIN $query1; +--sorted_result +eval $query1; + +if ($support_virtual_index) +{ +ALTER TABLE t1 ADD INDEX idx2(v1); +} + +# Do a DS-MRR scan on an index on a virtual column +# (this query returned too few records). +let query2= +SELECT * FROM t1 +WHERE v1 > 41 AND v1 <= 43; + +--replace_column 9 # +eval EXPLAIN $query2; +--sorted_result +eval $query2; + +DROP TABLE t0, t1; + +# Restore defaults +set optimizer_switch= @optimizer_switch_save; +set @@read_rnd_buffer_size= @read_rnd_buffer_size_save; + +--echo # +--echo # Bug#21872184 CONDITIONAL JUMP AT JOIN_CACHE::WRITE_RECORD_DATA IN +--echo # SQL_JOIN_BUFFER.CC +--echo # + +--echo # +--echo # Test 1: Dynamic range scan with one covering index +--echo # + +# This is the original test case which produces the valgrind error when +# inserting data into the join buffer. The test failure only occurs with +# InnoDB since it is only InnoDB that currently supports indexes on +# virtual columns and is the only storage engine that includes the +# primary key in each secondary key. + +CREATE TABLE t1 ( + i1 INTEGER NOT NULL, + c1 VARCHAR(1) NOT NULL +); + +INSERT INTO t1 +VALUES (10, 'c'), (10, 'i'), (2, 't'), (4, 'g'); + +CREATE TABLE t2 ( + i1 INTEGER NOT NULL, + c1 VARCHAR(1) NOT NULL +); + +INSERT INTO t2 +VALUES (2, 'k'), (9, 'k'), (7, 'o'), (5, 'n'), (7, 'e'); + +CREATE TABLE t3 ( + pk INTEGER NOT NULL, + i1 INTEGER, + i2_key INTEGER GENERATED ALWAYS AS (i1 + i1) VIRTUAL, + PRIMARY KEY (pk) +); + +if ($support_virtual_index) +{ +--echo # Add a covering index. The reason for this index being covering is that +--echo # secondary indexes in InnoDB include the primary key. +ALTER TABLE t3 ADD INDEX v_idx (i2_key); +} + +INSERT INTO t3 (pk, i1) +VALUES (1, 1), (2, 48), (3, 228), (4, 3), (5, 5), + (6, 39), (7, 6), (8, 8), (9, 3); + +CREATE TABLE t4 ( + i1 INTEGER NOT NULL, + c1 VARCHAR(1) NOT NULL +); + +INSERT INTO t4 +VALUES (1, 'j'), (2, 'c'), (0, 'a'); + +ANALYZE TABLE t1, t2, t3, t4; + +# Hint is added to avoid materialization of the subquery +let query= +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN + ( + SELECT /*+ QB_NAME(subq1) */ t4.i1 + FROM t4 + WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; + +eval EXPLAIN $query; +--sorted_result +eval $query; + +--echo # +--echo # Test 2: Two alternative covering indexes for the range scan +--echo # + +# Adding second covering index +if ($support_virtual_index) +{ +ALTER TABLE t3 ADD INDEX v_idx2 (i2_key, i1); +} + +# Hint is added to avoid materialization of the subquery +let query= +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN + ( + SELECT /*+ QB_NAME(subq1) */ t4.i1 + FROM t4 + WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; + +eval EXPLAIN $query; +--sorted_result +eval $query; + +--echo # +--echo # Test 3: One covering index including the base column for the virtual +--echo # column +--echo # + +if ($support_virtual_index) +{ +--echo # Drop the index with only the virtual column +ALTER TABLE t3 DROP INDEX v_idx; +} + +# Hint is added to avoid materialization of the subquery +let query= +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN + ( + SELECT /*+ QB_NAME(subq1) */ t4.i1 + FROM t4 + WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; + +eval EXPLAIN $query; +--sorted_result +eval $query; + +--echo # +--echo # Test 4: One non-covering index +--echo # + +if ($support_virtual_index) +{ +--echo # Drop the index on two columns, add index on just one virtual column +ALTER TABLE t3 DROP INDEX v_idx2; +ALTER TABLE t3 ADD INDEX v_idx (i2_key); +} + +--echo # Add more data to the table so that it will run the dynamic range scan +--echo # as both table scan and range scan (the purpose of this is to make the +--echo # table scan more expensive). +INSERT INTO t3 (pk, i1) +VALUES (10,1), (11,1), (12,1), (13,1), (14,1),(15,1), (16,1),(17,1), (18,1), + (19,1), (20,1), (21,1), (22,1), (23,1), (24,1),(25,1),(26,1),(27,1), + (28,1), (29,1); + +--echo # Change the query to read an extra column (t3.i1) making the index +--echo # non-covering. +# Hint is added to avoid materialization of the subquery +let query= +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN + ( + SELECT /*+ QB_NAME(subq1) */ t4.i1 + FROM t4 + WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; + +eval EXPLAIN $query; +--sorted_result +eval $query; + +--echo # +--echo # Test 5: Test where the added primary key to secondary indexes is +--echo # used after it has been included in the join buffer +--echo # + +# This test is only relevant for storage engines that add the primary key +# to all secondary keys (e.g. InnoDB). For these engines, the fields in the +# primary key might be included when deciding that a secondary index is +# covering for the query. This is the case for most of the secondary indexes +# on t3 in this test. But in the above queries, the subquery is non-dependent +# and the "t3.pk IN .." will be evaluated after rows for t3 are read. At this +# time t3.pk is in the record buffer. t3.pk is not used after it has been +# inserted into the join buffer. To test that t3.pk is actually correctly +# included in the join buffer we change the subquery to be dependent and +# only evaluated after the join has been done. +# The purpose of this test is to ensure that we correctly handle and +# include primary key fields that are added to a covering secondary index. + +# The difference between this query and the query in test 1 is that +# an extra query condition is added to the subquery. +# Hint is added to avoid materialization of the subquery +let query= +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN + ( + SELECT /*+ QB_NAME(subq1) */ t4.i1 + FROM t4 + WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) + ) +) +AND t1.i1 <= t3.i2_key; + +eval EXPLAIN $query; +--sorted_result +eval $query; + +DROP TABLE t1, t2, t3, t4; diff --git a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs.inc b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs.inc new file mode 100644 index 00000000000..88f2f7c4da1 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs.inc @@ -0,0 +1,47 @@ +################################################################################ +# inc/gcol_supported_sql_funcs.inc # +# # +# Purpose: # +# Tests frame for allowed sql functions # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--enable_warnings +set sql_warnings = 1; +eval create table t1 ($cols); +show create table t1; +if ($rows) +{ +# Allow out-of-range errors +--error 0,1264,1690,3020 + eval insert into t1 values ($values1); + dec $rows; +} +if ($rows) +{ +--error 0,1292,1690,3020 + eval insert into t1 values ($values2); + dec $rows; +} +if ($rows) +{ +--error 0,1690,3020 + eval insert into t1 values ($values3); + dec $rows; +} +if ($rows) +{ + eval insert into t1 values ($values4); + dec $rows; +} +--sorted_result +select * from t1; +drop table t1; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc new file mode 100644 index 00000000000..88268ddd6c4 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc @@ -0,0 +1,1245 @@ +################################################################################ +# inc/gcol_supported_sql_funcs_main.inc # +# # +# Purpose: # +# Tests frame for allowed sql functions # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ +set time_zone="+03:00"; +--echo # +--echo # NUMERIC FUNCTIONS +--echo # + +--echo # ABS() +let $cols = a int, b int generated always as (abs(a)) virtual; +let $values1 = -1, default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ACOS() +let $cols = a double, b double generated always as (format(acos(a),6)) virtual; +let $values1 = 1, default; +let $values2 = 1.0001,default; +let $values3 = 0,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ASIN() +let $cols = a double, b double generated always as (format(asin(a),6)) virtual; +let $values1 = 0.2, default; +let $values2 = 1.0001,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo #ATAN +let $cols = a double, b double, c double generated always as (format(atan(a,b),6)) virtual; +let $values1 = -2,2,default; +let $values2 = format(PI(),6),0,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +let $cols = a double, c double generated always as (format(atan(a),6)) virtual; +let $values1 = -2,default; +let $values2 = format(PI(),6),default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ATAN2 +let $cols = a double, b double, c double generated always as (format(atan2(a,b),6)) virtual; +let $values1 = -2,2,default; +let $values2 = format(PI(),6),0,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CEIL() +let $cols = a double, b int generated always as (ceil(a)) virtual; +let $values1 = 1.23,default; +let $values2 = -1.23,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CONV() +let $cols = a varchar(10), b int, c int, d varchar(10) generated always as (conv(a,b,c)) virtual; +let $values1 = 'a',16,2,default; +let $values2 = '6e',18,8,default; +let $values3 = -17,10,-18,default; +let $values4 = 10+'10'+'10'+0xa,10,10,default; +let $rows = 4; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # COS() +let $cols = a double, b double generated always as (format(cos(a),6)) virtual; +let $values1 = format(PI(),6),default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # COT() +let $cols = a double, b double generated always as (format(cot(a),6)) virtual; +let $values1 = 0,default; +let $values2 = 12,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CRC32() +let $cols = a varchar(10), b bigint generated always as (crc32(a)) virtual; +let $values1 = 'MySQL',default; +let $values2 = 'mysql',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DEGREES() +let $cols = a double, b double generated always as (format(degrees(a),6)) virtual; +let $values1 = format(PI(),6),default; +let $values2 = format(PI()/2,6),default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # / +let $cols = a double, b double generated always as (a/2) virtual; +let $values1 = 2,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # EXP() +let $cols = a double, b double generated always as (format(exp(a),6)) virtual; +let $values1 = 2,default; +let $values2 = -2,default; +let $values3 = 0,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FLOOR() +let $cols = a double, b bigint generated always as (floor(a)) virtual; +let $values1 = 1.23,default; +let $values2 = -1.23,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LN() +let $cols = a double, b double generated always as (format(ln(a),6)) virtual; +let $values1 = 2,default; +let $values2 = -2,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LOG() +let $cols = a double, b double, c double generated always as (format(log(a,b),6)) virtual; +let $values1 = 2,65536,default; +let $values2 = 10,100,default; +let $values3 = 1,100,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +let $cols = a double, b double generated always as (format(log(a),6)) virtual; +let $values1 = 2,default; +let $values2 = -2,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LOG2() +let $cols = a double, b double generated always as (format(log2(a),6)) virtual; +let $values1 = 65536,default; +let $values2 = -100,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LOG10() +let $cols = a double, b double generated always as (format(log10(a),6)) virtual; +let $values1 = 2,default; +let $values2 = 100,default; +let $values3 = -100,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # - +let $cols = a double, b double generated always as (a-1) virtual; +let $values1 = 2,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MOD() +let $cols = a int, b int generated always as (mod(a,10)) virtual; +let $values1 = 1,default; +let $values2 = 11,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # % +let $cols = a int, b int generated always as (a % 10) virtual; +let $values1 = 1,default; +let $values2 = 11,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # OCT() +let $cols = a double, b varchar(10) generated always as (oct(a)) virtual; +let $values1 = 12,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # PI() +let $cols = a double, b double generated always as (format(PI()*a*a,6)) virtual; +let $values1 = 1,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # + +let $cols = a int, b int generated always as (a+1) virtual; +let $values1 = 1,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # POW, POWER +let $cols = a int, b int generated always as (pow(a,2)) virtual, c int generated always as (power(a,2)) virtual; +let $values1 = 1,default,default; +let $values2 = 2,default,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # RADIANS() +let $cols = a double, b double generated always as (format(radians(a),6)) virtual; +let $values1 = 90,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ROUND() +let $cols = a double, b int generated always as (round(a)) virtual; +let $values1 = -1.23,default; +let $values2 = -1.58,default; +let $values3 = 1.58,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +let $cols = a double, b double, c int generated always as (round(a,b)) virtual; +let $values1 = 1.298,1,default; +let $values2 = 1.298,0,default; +let $values3 = 23.298,-1,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SIGN() +let $cols = a double, b int generated always as (sign(a)) virtual; +let $values1 = -32,default; +let $values2 = 0,default; +let $values3 = 234,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SIN() +let $cols = a double, b double generated always as (format(sin(a),6)) virtual; +let $values1 = format(PI()/2,6),default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SQRT() +let $cols = a double, b double generated always as (format(sqrt(a),6)) virtual; +let $values1 = 4,default; +let $values2 = 20,default; +let $values3 = -16,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TAN() +let $cols = a double, b double generated always as (format(tan(a),6)) virtual; +let $values1 = format(PI(),6),default; +let $values2 = format(PI()+1,6),default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # * +let $cols = a double, b double generated always as (a*3) virtual; +let $values1 = 0,default; +let $values2 = 1,default; +let $values3 = 2,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TRUNCATE() +let $cols = a double, b double generated always as (truncate(a,4)) virtual; +let $values1 = 1.223,default; +let $values2 = 1.999,default; +let $values3 = 1.999,default; +let $values4 = 122,default; +let $rows = 4; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # Unary - +let $cols = a double, b double generated always as (-a) virtual; +let $values1 = 1,default; +let $values2 = -1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # STRING FUNCTIONS +--echo # + +--echo # ASCII() +let $cols = a char(2), b int generated always as (ascii(a)) virtual; +let $values1 = '2',default; +let $values2 = 2,default; +let $values3 = 'dx',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # BIN() +let $cols = a int, b varchar(10) generated always as (bin(a)) virtual; +let $values1 = 12,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # BIT_LENGTH() +let $cols = a varchar(10), b bigint generated always as (bit_length(a)) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CHAR_LENGTH() +let $cols = a varchar(10), b bigint generated always as (char_length(a)) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CHAR() +let $cols = a int, b int, c varbinary(10) generated always as (char(a,b)) virtual; +let $values1 = 77,121,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CHARACTER_LENGTH() +let $cols = a varchar(10), b bigint generated always as (character_length(a)) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CONCAT_WS() +let $cols = a varchar(10), b varchar(10), c varchar(20) generated always as (concat_ws(',',a,b)) virtual; +let $values1 = 'value1','value2',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CONCAT() +let $cols = a varchar(10), b varchar(10), c varchar(20) generated always as (concat(a,',',b)) virtual; +let $values1 = 'value1','value2',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ELT() +let $cols = a varchar(10), b varchar(10), c int, d varchar(10) generated always as (elt(c,a,b)) virtual; +let $values1 = 'value1','value2',1,default; +let $values2 = 'value1','value2',2,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # EXPORT_SET() +let $cols = a int, b varchar(10) generated always as (export_set(a,'1','0','',10)) virtual; +let $values1 = 6,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FIELD() +let $cols = a varchar(10), b varchar(10), c int generated always as (field('aa',a,b)) virtual; +let $values1 = 'aa','bb',default; +let $values2 = 'bb','aa',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FIND_IN_SET() +let $cols = a varchar(10), b varchar(10), c int generated always as (find_in_set(a,b)) virtual; +let $values1 = 'aa','aa,bb,cc',default; +let $values2 = 'aa','bb,aa,cc',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FORMAT() +let $cols = a double, b varchar(20) generated always as (format(a,2)) virtual; +let $values1 = 12332.123456,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # HEX() +let $cols = a int, b varchar(10) generated always as (hex(a)) virtual; +let $values1 = 17,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +let $cols = a varchar(10), b varchar(10) generated always as (hex(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # INSERT() +let $cols = a varchar(10), b varchar(10), c varchar(20) generated always as (insert(a,length(a),length(b),b)) virtual; +let $values1 = 'start,','end',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # INSTR() +let $cols = a varchar(10), b varchar(10), c int generated always as (instr(a,b)) virtual; +let $values1 = 'foobarbar,','bar',default; +let $values2 = 'xbar,','foobar',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LCASE() +let $cols = a varchar(10), b varchar(10) generated always as (lcase(a)) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LEFT() +let $cols = a varchar(10), b varchar(5) generated always as (left(a,5)) virtual; +let $values1 = 'foobarbar',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LENGTH() +let $cols = a varchar(10), b int generated always as (length(a)) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LIKE +let $cols = a varchar(10), b bool generated always as (a like 'H%o') virtual; +let $values1 = 'Hello',default; +let $values2 = 'MySQL',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LOCATE() +let $cols = a varchar(10), b varchar(10) generated always as (locate('bar',a)) virtual; +let $values1 = 'foobarbar',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LOWER() +let $cols = a varchar(10), b varchar(10) generated always as (lower(a)) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LPAD() +let $cols = a varchar(10), b varchar(10) generated always as (lpad(a,4,' ')) virtual; +let $values1 = 'MySQL',default; +let $values2 = 'M',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LTRIM() +let $cols = a varchar(10), b varchar(10) generated always as (ltrim(a)) virtual; +let $values1 = ' MySQL',default; +let $values2 = 'MySQL',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MAKE_SET() +let $cols = a varchar(10), b varchar(10), c int, d varchar(30) generated always as (make_set(c,a,b)) virtual; +let $values1 = 'a','b',1,default; +let $values2 = 'a','b',3,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MID() +let $cols = a varchar(10), b varchar(10) generated always as (mid(a,1,2)) virtual; +let $values1 = 'foobarbar',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # NOT LIKE +let $cols = a varchar(10), b bool generated always as (a not like 'H%o') virtual; +let $values1 = 'Hello',default; +let $values2 = 'MySQL',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # NOT REGEXP +let $cols = a varchar(10), b bool generated always as (a not regexp 'H.+o') virtual; +let $values1 = 'Hello',default; +let $values2 = 'hello',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # OCTET_LENGTH() +let $cols = a varchar(10), b int generated always as (octet_length(a)) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ORD() +let $cols = a varchar(10), b bigint generated always as (ord(a)) virtual; +let $values1 = '2',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # POSITION() +let $cols = a varchar(10), b varchar(10) generated always as (position('bar' in a)) virtual; +let $values1 = 'foobarbar',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # QUOTE() +let $cols = a varchar(10), b varchar(10) generated always as (quote(a)) virtual; +let $values1 = 'Don\'t',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # REGEXP() +let $cols = a varchar(10), b bool generated always as (a regexp 'H.+o') virtual; +let $values1 = 'Hello',default; +let $values2 = 'hello',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # REPEAT() +let $cols = a varchar(10), b varchar(30) generated always as (repeat(a,3)) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # REPLACE() +let $cols = a varchar(10), b varchar(30) generated always as (replace(a,'aa','bb')) virtual; +let $values1 = 'maa',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # REVERSE() +let $cols = a varchar(10), b varchar(30) generated always as (reverse(a)) virtual; +let $values1 = 'maa',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # RIGHT() +let $cols = a varchar(10), b varchar(10) generated always as (right(a,4)) virtual; +let $values1 = 'foobarbar',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # RLIKE() +let $cols = a varchar(10), b bool generated always as (a rlike 'H.+o') virtual; +let $values1 = 'Hello',default; +let $values2 = 'MySQL',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # RPAD() +let $cols = a varchar(10), b varchar(10) generated always as (rpad(a,4,'??')) virtual; +let $values1 = 'He',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # RTRIM(); +let $cols = a varchar(10), b varchar(10) generated always as (rtrim(a)) virtual; +let $values1 = 'Hello ',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SOUNDEX() +let $cols = a varchar(10), b varchar(20) generated always as (soundex(a)) virtual; +let $values1 = 'Hello',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SOUNDS LIKE +let $cols = a varchar(10), b varchar(10), c bool generated always as (a sounds like b) virtual; +let $values1 = 'Hello','Hello',default; +let $values2 = 'Hello','MySQL',default; +let $values3 = 'Hello','hello',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SPACE() +let $cols = a varchar(5), b varchar(10) generated always as (concat(a,space(5))) virtual; +let $values1 = 'Hello', default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # STRCMP() +let $cols = a varchar(9), b varchar(9), c tinyint(1) generated always as (strcmp(a,b)) virtual; +let $values1 = 'Hello','Hello', default; +let $values2 = 'Hello','Hello1', default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SUBSTR() +let $cols = a varchar(5), b varchar(10) generated always as (substr(a,2)) virtual; +let $values1 = 'Hello',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SUBSTRING_INDEX() +let $cols = a varchar(15), b varchar(10) generated always as (substring_index(a,'.',2)) virtual; +let $values1 = 'www.mysql.com',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SUBSTRING() +let $cols = a varchar(5), b varchar(10) generated always as (substring(a from 2 for 2)) virtual; +let $values1 = 'Hello',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TRIM() +let $cols = a varchar(15), b varchar(10) generated always as (trim(a)) virtual; +let $values1 = ' aa ',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # UCASE() +let $cols = a varchar(5), b varchar(10) generated always as (ucase(a)) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # UNHEX() +let $cols = a varchar(15), b varchar(10) generated always as (unhex(a)) virtual; +let $values1 = '4D7953514C',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # UPPER() +let $cols = a varchar(5), b varchar(10) generated always as (upper(a)) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # WEIGHT_STRING() +let $cols = a varchar(5), b varchar(10) generated always as (weight_string(a as char(4))) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # CONTROL FLOW FUNCTIONS +--echo # + +--echo # CASE +let $cols = a varchar(10), b varchar(16) generated always as (case a when NULL then 'asd' when 'b' then 'B' else a end) virtual; +let $values1 = NULL,default; +let $values2 = 'b',default; +let $values3 = 'c',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # IF +let $cols = a int, b int, c int generated always as (if(a=1,a,b)) virtual; +let $values1 = 1,2,default; +let $values2 = 3,4,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # IFNULL +let $cols = a varchar(10), b varchar(10), c varchar(10) generated always as (ifnull(a,'DEFAULT')) virtual; +let $values1 = NULL,'adf',default; +let $values2 = 'a','adf',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # NULLIF +let $cols = a varchar(10), b varchar(10) generated always as (nullif(a,'DEFAULT')) virtual; +let $values1 = 'DEFAULT',default; +let $values2 = 'a',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # OPERATORS +--echo # + +--echo # AND, && +let $cols = a int, b bool generated always as (a>0 && a<2) virtual; +let $values1 = -1,default; +let $values2 = 1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # BETWEEN ... AND ... +let $cols = a int, b bool generated always as (a between 0 and 2) virtual; +let $values1 = -1,default; +let $values2 = 1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # BINARY +let $cols = a varchar(10), b varbinary(10) generated always as (binary a) virtual; +let $values1 = '11',default; +let $values2 = 1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # & +let $cols = a int, b int generated always as (a & 5) virtual; +let $values1 = 1,default; +let $values2 = 0,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ~ +let $cols = a int, b int generated always as (~a) virtual; +let $values1 = 1,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # | +let $cols = a int, b int generated always as (a | 5) virtual; +let $values1 = 1,default; +let $values2 = 0,default; +let $values3 = 2,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ^ +let $cols = a int, b int generated always as (a ^ 5) virtual; +let $values1 = 1,default; +let $values2 = 0,default; +let $values3 = 2,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DIV +let $cols = a int, b int generated always as (a div 5) virtual; +let $values1 = 1,default; +let $values2 = 7,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # <=> +let $cols = a int, b int, c bool generated always as (a <=> b) virtual; +let $values1 = 1,1,default; +let $values2 = NULL,NULL,default; +let $values3 = 1,NULL,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # = +let $cols = a varchar(10), b varchar(10), c bool generated always as (a=b) virtual; +let $values1 = 'a','b',default; +let $values2 = 'a','a',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # >= +let $cols = a varchar(10), b varchar(10), c bool generated always as (a >= b) virtual; +let $values1 = 'a','b',default; +let $values2 = 'a','a',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # > +let $cols = a varchar(10), b varchar(10), c bool generated always as (a > b) virtual; +let $values1 = 'a','b',default; +let $values2 = 'a','a',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # IS NOT NULL +let $cols = a int, b bool generated always as (a is not null) virtual; +let $values1 = 1,default; +let $values2 = NULL,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # IS NULL +let $cols = a int, b bool generated always as (a is null) virtual; +let $values1 = 1,default; +let $values2 = NULL,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # << +let $cols = a int, b int generated always as (a << 2) virtual; +let $values1 = 1,default; +let $values2 = 3,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # <= +let $cols = a varchar(10), b varchar(10), c bool generated always as (a <= b) virtual; +let $values1 = 'b','a',default; +let $values2 = 'b','b',default; +let $values3 = 'b','c',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # < +let $cols = a varchar(10), b varchar(10), c bool generated always as (a < b) virtual; +let $values1 = 'b','a',default; +let $values2 = 'b','b',default; +let $values3 = 'b','c',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # NOT BETWEEN ... AND ... +let $cols = a int, b bool generated always as (a not between 0 and 2) virtual; +let $values1 = -1,default; +let $values2 = 1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # <> +let $cols = a varchar(10), b varchar(10), c bool generated always as (a <> b) virtual; +let $values1 = 'b','a',default; +let $values2 = 'b','b',default; +let $values3 = 'b','c',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # != +let $cols = a varchar(10), b varchar(10), c bool generated always as (a != b) virtual; +let $values1 = 'b','a',default; +let $values2 = 'b','b',default; +let $values3 = 'b','c',default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ||, OR +let $cols = a int, b int generated always as (a>5 || a<3) virtual; +let $values1 = 1,default; +let $values2 = 4,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # >> +let $cols = a int, b int generated always as (a >> 2) virtual; +let $values1 = 8,default; +let $values2 = 3,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # XOR +let $cols = a int, b int generated always as (a xor 5) virtual; +let $values1 = 0,default; +let $values2 = 1,default; +let $values3 = 2,default; +let $rows = 3; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # DATE AND TIME FUNCTIONS +--echo # + +--echo # ADDDATE() +let $cols = a datetime, b datetime generated always as (adddate(a,interval 1 month)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ADDTIME() +let $cols = a datetime, b datetime generated always as (addtime(a,'02:00:00')) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CONVERT_TZ() +let $cols = a datetime, b datetime generated always as (convert_tz(a,'MET','UTC')) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DATE_ADD() +let $cols = a datetime, b datetime generated always as (date_add(a,interval 1 month)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DATE_FORMAT() +let $cols = a datetime, b varchar(64) generated always as (date_format(a,'%W %M %D')) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DATE_SUB() +let $cols = a datetime, b datetime generated always as (date_sub(a,interval 1 month)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DATE() +let $cols = a datetime, b datetime generated always as (date(a)) virtual; +let $values1 = '2008-08-31 02:00:00',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DATEDIFF() +let $cols = a datetime, b bigint generated always as (datediff(a,'2000-01-01')) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DAY() +let $cols = a datetime, b int generated always as (day(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DAYNAME() +let $cols = a datetime, b varchar(10) generated always as (dayname(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DAYOFMONTH() +let $cols = a datetime, b int generated always as (dayofmonth(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DAYOFWEEK() +let $cols = a datetime, b int generated always as (dayofweek(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DAYOFYEAR() +let $cols = a datetime, b int generated always as (dayofyear(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # EXTRACT +let $cols = a datetime, b int generated always as (extract(year from a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FROM_DAYS() +let $cols = a bigint, b datetime generated always as (from_days(a)) virtual; +let $values1 = 730669,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # FROM_UNIXTIME() +let $cols = a bigint, b datetime generated always as (from_unixtime(a)) virtual; +let $values1 = 1196440219,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # GET_FORMAT() +let $cols = a datetime, b varchar(32) generated always as (date_format(a,get_format(DATE,'EUR'))) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # HOUR() +let $cols = a time, b bigint generated always as (hour(a)) virtual; +let $values1 = '10:05:03',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # LAST_DAY() +let $cols = a datetime, b datetime generated always as (last_day(a)) virtual; +let $values1 = '2003-02-05',default; +let $values2 = '2003-02-32',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MAKEDATE() +let $cols = a int, b datetime generated always as (makedate(a,1)) virtual; +let $values1 = 2001,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MAKETIME() +let $cols = a int, b time generated always as (maketime(a,1,3)) virtual; +let $values1 = 12,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MICROSECOND() +let $cols = a datetime, b bigint generated always as (microsecond(a)) virtual; +let $values1 = '2009-12-31 12:00:00.123456',default; +let $values2 = '2009-12-31 23:59:59.000010',default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MINUTE() +let $cols = a datetime, b int generated always as (minute(a)) virtual; +let $values1 = '2009-12-31 23:59:59.000010',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MONTH() +let $cols = a datetime, b int generated always as (month(a)) virtual; +let $values1 = '2009-12-31 23:59:59.000010',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MONTHNAME() +let $cols = a datetime, b varchar(16) generated always as (monthname(a)) virtual; +let $values1 = '2009-12-31 23:59:59.000010',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # PERIOD_ADD() +let $cols = a int, b int generated always as (period_add(a,2)) virtual; +let $values1 = 200801,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # PERIOD_DIFF() +let $cols = a int, b int, c int generated always as (period_diff(a,b)) virtual; +let $values1 = 200802,200703,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # QUARTER() +let $cols = a datetime, b int generated always as (quarter(a)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SEC_TO_TIME() +let $cols = a bigint, b time generated always as (sec_to_time(a)) virtual; +let $values1 = 2378,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SECOND() +let $cols = a datetime, b int generated always as (second(a)) virtual; +let $values1 = '10:05:03',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # STR_TO_DATE() +let $cols = a varchar(64), b datetime generated always as (str_to_date(a,'%m/%d/%Y')) virtual; +let $values1 = '04/30/2004',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SUBDATE() +let $cols = a datetime, b datetime generated always as (subdate(a,interval 1 month)) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SUBTIME() +let $cols = a datetime, b datetime generated always as (subtime(a,'02:00:00')) virtual; +let $values1 = '2008-08-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIME_FORMAT() +let $cols = a datetime, b varchar(32) generated always as (time_format(a,'%r')) virtual; +let $values1 = '2008-08-31 02:03:04',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIME_TO_SEC() +let $cols = a time, b bigint generated always as (time_to_sec(a)) virtual; +let $values1 = '22:23:00',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIME() +let $cols = a datetime, b time generated always as (time(a)) virtual; +let $values1 = '2008-08-31 02:03:04',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIMEDIFF() +let $cols = a datetime, b datetime, c time generated always as (timediff(a,b)) virtual; +let $values1 = '2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIMESTAMP() +let $cols = a datetime, b timestamp generated always as (timestamp(a)) virtual; +let $values1 = '2008-12-31',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIMESTAMPADD() +let $cols = a datetime, b timestamp generated always as (timestampadd(minute,1,a)) virtual; +let $values1 = '2003-01-02',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TIMESTAMPDIFF() +let $cols = a timestamp, c bigint generated always as (timestampdiff(MONTH, a, a)) virtual; +let $values1 = '2003-02-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # TO_DAYS() +let $cols = a datetime, b bigint generated always as (to_days(a)) virtual; +let $values1 = '2007-10-07',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # WEEK() +let $cols = a datetime, b int generated always as (week(a)) virtual; +let $values1 = '2008-09-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # WEEKDAY() +let $cols = a datetime, b int generated always as (weekday(a)) virtual; +let $values1 = '2008-09-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # WEEKOFYEAR() +let $cols = a datetime, b int generated always as (weekofyear(a)) virtual; +let $values1 = '2008-09-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # YEAR() +let $cols = a datetime, b int generated always as (year(a)) virtual; +let $values1 = '2008-09-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # YEARWEEK() +let $cols = a datetime, b int generated always as (yearweek(a)) virtual; +let $values1 = '2008-09-01',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # FULL TEXT SEARCH FUNCTIONS +--echo # +--echo # None. + +--echo # +--echo # CAST FUNCTIONS AND OPERATORS +--echo # + +--echo # CAST() +let $cols = a int, b bigint unsigned generated always as (cast(a as unsigned)) virtual; +let $values1 = 1,default; +let $values2 = -1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # Convert() +let $cols = a int, b bigint unsigned generated always as (convert(a,unsigned)) virtual; +let $values1 = 1,default; +let $values2 = -1,default; +let $rows = 2; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # +--echo # XML FUNCTIONS +--echo # +--echo # ExtractValue() +let $cols = a varchar(1024), b varchar(1024) generated always as (ExtractValue(a,'/b')) virtual; +let $values1 = 'text',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # None. + + +--echo # +--echo # OTHER FUNCTIONS +--echo # + +--echo # AES_DECRYPT(), AES_ENCRYPT() +let $cols = a varchar(1024), b varchar(1024) generated always as (aes_encrypt(aes_decrypt(a,'adf'),'adf')) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # BIT_COUNT() +let $cols = a int, b int generated always as (bit_count(a)) virtual; +let $values1 = 5,default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # CHARSET() +let $cols = a varchar(1024), b varchar(1024) generated always as (charset(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # COERCIBILITY() +let $cols = a varchar(1024), b int generated always as (coercibility(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # COLLATION() +let $cols = a varchar(1024), b varchar(1024) generated always as (collation(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # COMPRESS(), UNCOMPRESS() +let $cols = a varchar(1024), b varchar(1024) generated always as (uncompress(compress(a))) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # ENCODE(), DECODE() +let $cols = a varchar(1024), b varchar(1024) generated always as (decode(encode(a,'abc'),'abc')) virtual; +let $values1 = 'MySQL',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DEFAULT() +let $cols = a varchar(1024) default 'aaa', b varchar(1024) generated always as (ifnull(a,default(a))) virtual; +let $values1 = 'any value',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # DES_ENCRYPT(), DES_DECRYPT() +--source include/have_ssl_crypto_functs.inc +let $cols = a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual; +let $values1 = 'MySQL',default; +--disable_warnings +eval create table t1 ($cols); +show create table t1; +--enable_warnings +eval insert into t1 values ($values1); +select * from t1; +drop table t1; + +--echo # INET_ATON(), INET_NTOA() +let $cols = a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual; +let $values1 = '127.0.0.1',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # MD5() +let $cols = a varchar(1024), b varbinary(32) generated always as (md5(a)) virtual; +let $values1 = 'testing',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # PASSWORD() +let $cols = a varchar(1024), b varchar(1024) generated always as (password(a)) virtual; +let $values1 = 'badpwd',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SHA1() +let $cols = a varchar(1024), b varchar(1024) generated always as (sha1(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SHA() +let $cols = a varchar(1024), b varchar(1024) generated always as (sha(a)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # SHA2() +let $cols = a varchar(1024), b varchar(1024) generated always as (sha2(a,224)) virtual; +let $values1 = 'abc',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + +--echo # UNCOMPRESSED_LENGTH() +let $cols = a char, b varchar(1024) generated always as (uncompressed_length(compress(repeat(a,30)))) virtual; +let $values1 = 'a',default; +let $rows = 1; +--source suite/gcol/inc/gcol_supported_sql_funcs.inc + diff --git a/mysql-test/suite/gcol/inc/gcol_trigger_sp.inc b/mysql-test/suite/gcol/inc/gcol_trigger_sp.inc new file mode 100644 index 00000000000..b6ba5280216 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_trigger_sp.inc @@ -0,0 +1,114 @@ +################################################################################ +# inc/gcol_trigger_sp.inc # +# # +# Purpose: # +# Testing triggers, stored procedures and functions # +# defined on tables with generated columns. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +create table t1 (a int, + b int generated always as (a/10) virtual, + c int generated always as (a/10) stored); + +create table t2 (a timestamp); + +delimiter |; + +create trigger trg1 before insert on t1 for each row +begin + if (new.b < 10) then + set new.a:= 100; + set new.b:= 9; + set new.c:= 9; + end if; + + if (new.c > 50) then + set new.a:= 500; + end if; +end| + +create trigger trg2 after insert on t1 for each row +begin + if (new.b >= 60) then + insert into t2 values (now()); + end if; +end| + +create function f1() +returns int +begin + declare sum1 int default '0'; + declare cur1 cursor for select sum(b) from t1; + open cur1; + fetch cur1 into sum1; + close cur1; + return sum1; +end| + +delimiter ;| + +set sql_warnings = 1; + +insert into t1 (a) values (200); +select * from t1; +select * from t2; + +insert into t1 (a) values (10); +--sorted_result +select * from t1; +select * from t2; + +insert into t1 (a) values (600); +--sorted_result +select * from t1; +--replace_column 1 +select * from t2; + +select f1(); + +set sql_warnings = 0; + +drop trigger trg1; +drop trigger trg2; +drop table t2; + +delimiter |; + +create procedure p1() +begin + declare i int default '0'; + create table t2 like t1; + insert into t2 (a) values (100), (200); + begin + declare cur1 cursor for select sum(c) from t2; + open cur1; + fetch cur1 into i; + close cur1; + if (i=30) then + insert into t1 values (300,default,default); + end if; + end; +end| + +delimiter ;| + +delete from t1; + +call p1(); + +--sorted_result +select * from t2; +--sorted_result +select * from t1; + +drop table t1,t2; +drop procedure p1; diff --git a/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc b/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc new file mode 100644 index 00000000000..c6aed0253f6 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc @@ -0,0 +1,21 @@ +################################################################################ +# inc/gcol_unsupported_storage_engines.inc # +# # +# Purpose: # +# Ensure that defining a generated column for an unsupported table type # +# results in a graceful error. # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +create table t1 (a int, b int generated always as (a+1) virtual); +create table t1 (a int); +--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +alter table t1 add column b int generated always as (a+1) virtual; +drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_view.inc b/mysql-test/suite/gcol/inc/gcol_view.inc new file mode 100644 index 00000000000..51cb9b5d725 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_view.inc @@ -0,0 +1,223 @@ +################################################################################ +# inc/gcol_view.inc # +# # +# Purpose: # +# Testing views defined on tables with generated columns. # +# # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + + + +create table t1 (a int not null, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +insert into t1 (a) values (1), (1), (2), (2), (3); +analyze table t1; + +# simple view +create view v1 (d,e) as select abs(b), abs(c) from t1; +--sorted_result +select d,e from v1; +select is_updatable from information_schema.views where table_name='v1'; + +# view with different algorithms (explain output differs) +--replace_column 10 X +explain select d,e from v1; +create algorithm=temptable view v2 (d,e) as select abs(b), abs(c) from t1; +show create view v2; +--sorted_result +select d,e from v2; +--replace_column 10 X +explain select d,e from v2; + +# VIEW on VIEW test +create view v3 (d,e) as select d*2, e*2 from v1; +--sorted_result +select * from v3; +--replace_column 10 X +explain select * from v3; + +drop view v1,v2,v3; +drop table t1; + +# +# DISTINCT option for VIEW +# +create table t1 (a int not null, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (1), (2), (3); +create view v1 as select distinct b from t1; +--sorted_result +select * from v1; +--replace_column 10 X +explain select * from v1; +--sorted_result +select * from t1; +drop view v1; +create view v1 as select distinct c from t1; +--sorted_result +select * from v1; +--replace_column 10 X +explain select * from v1; +--sorted_result +select * from t1; +drop view v1; +drop table t1; + +# +# LIMIT clause test +# +create table t1 (a int not null, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (4); +create view v1 as select b+1 from t1 order by 1 desc limit 2; +select * from v1; +--replace_column 10 X +explain select * from v1; +drop view v1; +create view v1 as select c+1 from t1 order by 1 desc limit 2; +--sorted_result +select * from v1; +--replace_column 10 X +explain select * from v1; +drop view v1; +drop table t1; + +# +# simple view + simple update, insert and delete +# +create table t1 (a int, + b int, + c int generated always as (-a) virtual, + d int generated always as (-a) stored, + primary key(a)); +insert into t1 (a,b) values (10,2), (20,3), (30,4), (40,5), (50,10); +create view v1 (a,e,f,g) as select a, b+1,c+1,d+1 from t1; +# updatable field of updateable view +update v1 set a=a+e; +select * from v1 order by a; +select * from t1 order by a; +delete from v1; +select * from v1; +select * from t1; +--error ER_NON_INSERTABLE_TABLE +insert into v1 (a,e) values (60,15); +drop table t1; +drop view v1; + +# +# outer join based on VIEW with WHERE clause +# +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored, + primary key(a)); +insert into t1 (a) values (1), (2), (3); +create view v1 (x,y,z) as select a,b,c from t1 where b < -1; +--sorted_result +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.b= v1.y); +drop view v1; +create view v1 (x,y,z) as select a,b,c from t1 where c < -1; +--sorted_result +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.c= v1.z); +drop view v1; +drop table t1; + +# +# VIEW built over UNION +# +create table t1 (a1 int, + b1 int generated always as (-a1) virtual, + c1 int generated always as (-a1) stored); +create table t2 (a2 int, + b2 int generated always as (-a2) virtual, + c2 int generated always as (-a2) stored); +insert into t1 (a1) values (1), (2); +insert into t2 (a2) values (2), (3); +create view v1 as select * from t1,t2 union all select * from t1,t2; +--sorted_result +select * from v1; +drop view v1; +drop table t1, t2; + +# +# Showing VIEW with VIEWs in subquery +# +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +create table t2 like t1; +create view v1 as select a,b,c from t1; +create view v2 as select a,b,c from t2 where b in (select b from v1); +show create view v2; +drop view v2, v1; +drop table t1, t2; + +# +# TODO: VIEW with full text +# +#CREATE TABLE t1 (c1 int not null auto_increment primary key, c2 varchar(20), fulltext(c2)); +#insert into t1 (c2) VALUES ('real Beer'),('Water'),('Kossu'),('Coca-Cola'),('Vodka'),('Wine'),('almost real Beer'); +#select * from t1 WHERE match (c2) against ('Beer'); +#CREATE VIEW v1 AS SELECT * from t1 WHERE match (c2) against ('Beer'); +#select * from v1; +#drop view v1; +#drop table t1; + +# +# distinct in temporary table with a VIEW +# +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +insert into t1 (a) values (1),(1),(2),(2),(3),(3); +create view v1 as select b from t1; +--sorted_result +select distinct b from v1; +select distinct b from v1 order by b limit 2; +select distinct b from t1 order by b limit 2; +prepare stmt1 from "select distinct b from v1 order by b limit 2"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop view v1; +create view v1 as select c from t1; +--sorted_result +select distinct c from v1; +select distinct c from v1 order by c limit 2; +select distinct c from t1 order by c limit 2; +prepare stmt1 from "select distinct c from v1 order by c limit 2"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop view v1; +drop table t1; + +# +# WITH CHECK OPTION insert/update test +# +create table t1 (a int, + b int generated always as (-a) virtual, + c int generated always as (-a) stored); +create view v1 as select * from t1 where b > -2 && c >-2 with check option; +# simple insert +insert into v1 (a) values (1); +-- error 1369 +insert into v1 (a) values (3); +# simple insert with ignore +insert ignore into v1 (a) values (2),(3),(0); +--sorted_result +select * from t1; +drop view v1; +drop table t1; + diff --git a/mysql-test/suite/gcol/r/federated_gcol.result b/mysql-test/suite/gcol/r/federated_gcol.result new file mode 100644 index 00000000000..9c8de3987f0 --- /dev/null +++ b/mysql-test/suite/gcol/r/federated_gcol.result @@ -0,0 +1,49 @@ +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; +stop slave; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; +DROP TABLE IF EXISTS federated.t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS federated.t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE federated.t1 ( +`id` int(20) NOT NULL, +`group` int NOT NULL default 0, +`tmp` virtual int as (`id` + 1) +) +ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +ERROR HY000: 'Specified storage engine' is not yet supported for generated columns. +CREATE TABLE federated.t1 ( +`id` int(20) NOT NULL, +`group` int NOT NULL default 0 +) +ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +alter table federated.t1 add column `tmp` virtual int as (`id` + 1); +ERROR HY000: Table storage engine for 't1' doesn't have this option +DROP TABLE IF EXISTS federated.t1; +End of 5.1 tests +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_archive.result b/mysql-test/suite/gcol/r/gcol_archive.result new file mode 100644 index 00000000000..0d8072943b7 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_archive.result @@ -0,0 +1,14 @@ +SET @@session.default_storage_engine = 'archive'; +create table t1 (a int, b int generated always as (a+1) virtual); +ERROR HY000: ARCHIVE storage engine does not support computed columns +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual; +ERROR HY000: ARCHIVE storage engine does not support computed columns +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_blackhole.result b/mysql-test/suite/gcol/r/gcol_blackhole.result new file mode 100644 index 00000000000..2d448566114 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_blackhole.result @@ -0,0 +1,14 @@ +SET @@session.default_storage_engine = 'blackhole'; +create table t1 (a int, b int generated always as (a+1) virtual); +ERROR HY000: BLACKHOLE storage engine does not support computed columns +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual; +ERROR HY000: BLACKHOLE storage engine does not support computed columns +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result new file mode 100644 index 00000000000..27270654e9b --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result @@ -0,0 +1,179 @@ +SET @@session.default_storage_engine = 'InnoDB'; +create or replace table t1 (b double generated always as (rand()) virtual); +create or replace table t1 (a datetime generated always as (curdate()) virtual); +create or replace table t1 (a datetime generated always as (current_date) virtual); +create or replace table t1 (a datetime generated always as (current_date()) virtual); +create or replace table t1 (a datetime generated always as (current_time) virtual); +create or replace table t1 (a datetime generated always as (current_time()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp) virtual); +create or replace table t1 (a datetime generated always as (curtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (now()) virtual); +create or replace table t1 (a int, b varchar(10) generated always as (sysdate()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (unix_timestamp()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_date()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_time()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_timestamp()) virtual); +create or replace table t1 (a int generated always as (connection_id()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (database()) virtual); +create or replace table t1 (a varchar(32) generated always as (schema()) virtual); +create or replace table t1 (a varchar(32) generated always as (session_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (system_user()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (user()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid_short()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (version()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (encrypt(a)) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (UpdateXML(a,'/a','fff')) virtual); +drop table t1; +# LOAD_FILE() +create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual); +ERROR HY000: Function or expression 'load_file()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MATCH() +# BENCHMARK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual); +ERROR HY000: Function or expression 'benchmark()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# FOUND_ROWS() +create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual); +ERROR HY000: Function or expression 'found_rows()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GET_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual); +ERROR HY000: Function or expression 'get_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_FREE_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual); +ERROR HY000: Function or expression 'is_free_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_USED_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual); +ERROR HY000: Function or expression 'is_used_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# LAST_INSERT_ID() +create table t1 (a int generated always as (last_insert_id()) virtual); +ERROR HY000: Function or expression 'last_insert_id()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# MASTER_POS_WAIT() +create table t1 (a varchar(32), b int generated always as (master_pos_wait(a,0,2)) virtual); +ERROR HY000: Function or expression 'master_pos_wait()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# NAME_CONST() +create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual); +ERROR HY000: Function or expression 'name_const()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# RELEASE_LOCK() +create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual); +ERROR HY000: Function or expression 'release_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# ROW_COUNT() +create table t1 (a int generated always as (row_count()) virtual); +ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# SLEEP() +create table t1 (a int, b int generated always as (sleep(a)) virtual); +ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VALUES() +create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual); +ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# Stored procedures +create procedure p1() +begin +select current_user(); +end // +create function f1() +returns int +begin +return 1; +end // +create table t1 (a int generated always as (p1()) virtual); +ERROR HY000: Function or expression '`p1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create table t1 (a int generated always as (f1()) virtual); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +drop procedure p1; +drop function f1; +# Unknown functions +create table t1 (a int generated always as (f1()) virtual); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# +# GROUP BY FUNCTIONS +# +# AVG() +create table t1 (a int, b int generated always as (avg(a)) virtual); +ERROR HY000: Function or expression 'avg()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_AND() +create table t1 (a int, b int generated always as (bit_and(a)) virtual); +ERROR HY000: Function or expression 'bit_and()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_OR() +create table t1 (a int, b int generated always as (bit_or(a)) virtual); +ERROR HY000: Function or expression 'bit_or()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_XOR() +create table t1 (a int, b int generated always as (bit_xor(a)) virtual); +ERROR HY000: Function or expression 'bit_xor()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT(DISTINCT) +create table t1 (a int, b int generated always as (count(distinct a)) virtual); +ERROR HY000: Function or expression 'count(distinct )' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT() +create table t1 (a int, b int generated always as (count(a)) virtual); +ERROR HY000: Function or expression 'count()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GROUP_CONCAT() +create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual); +ERROR HY000: Function or expression 'group_concat()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MAX() +create table t1 (a int, b int generated always as (max(a)) virtual); +ERROR HY000: Function or expression 'max()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MIN() +create table t1 (a int, b int generated always as (min(a)) virtual); +ERROR HY000: Function or expression 'min()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STD() +create table t1 (a int, b int generated always as (std(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_POP() +create table t1 (a int, b int generated always as (stddev_pop(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_SAMP() +create table t1 (a int, b int generated always as (stddev_samp(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV() +create table t1 (a int, b int generated always as (stddev(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# SUM() +create table t1 (a int, b int generated always as (sum(a)) virtual); +ERROR HY000: Function or expression 'sum()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_POP() +create table t1 (a int, b int generated always as (var_pop(a)) virtual); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_SAMP() +create table t1 (a int, b int generated always as (var_samp(a)) virtual); +ERROR HY000: Function or expression 'var_samp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VARIANCE() +create table t1 (a int, b int generated always as (variance(a)) virtual); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# +# Sub-selects +# +create table t1 (a int); +create table t2 (a int, b int generated always as (select count(*) virtual from t1)); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +# +# Long expression +create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual); +drop table t1; +create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual); +drop table t1; +# +# Constant expression +create table t1 (a int generated always as (PI()) virtual); +drop table t1; +# bug#21098119: GCOL WITH MATCH/AGAINST --> +# ASSERTION FAILED: TR && TR->TABLE->FILE +# +create table t1 (a int); +alter table t1 add column r blob generated always +as (match(a) against ('' in boolean mode)) virtual; +ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `r` +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result new file mode 100644 index 00000000000..24fd3b988c2 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result @@ -0,0 +1,181 @@ +SET @@session.default_storage_engine = 'MyISAM'; +create or replace table t1 (b double generated always as (rand()) virtual); +create or replace table t1 (a datetime generated always as (curdate()) virtual); +create or replace table t1 (a datetime generated always as (current_date) virtual); +create or replace table t1 (a datetime generated always as (current_date()) virtual); +create or replace table t1 (a datetime generated always as (current_time) virtual); +create or replace table t1 (a datetime generated always as (current_time()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp()) virtual); +create or replace table t1 (a datetime generated always as (current_timestamp) virtual); +create or replace table t1 (a datetime generated always as (curtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtime) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp()) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp) virtual); +create or replace table t1 (a datetime, b varchar(10) generated always as (now()) virtual); +create or replace table t1 (a int, b varchar(10) generated always as (sysdate()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (unix_timestamp()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_date()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_time()) virtual); +create or replace table t1 (a datetime, b datetime generated always as (utc_timestamp()) virtual); +create or replace table t1 (a int generated always as (connection_id()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (current_user) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (database()) virtual); +create or replace table t1 (a varchar(32) generated always as (schema()) virtual); +create or replace table t1 (a varchar(32) generated always as (session_user()) virtual); +create or replace table t1 (a varchar(32) generated always as (system_user()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (user()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid_short()) virtual); +create or replace table t1 (a varchar(1024) generated always as (uuid()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (version()) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (encrypt(a)) virtual); +create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (UpdateXML(a,'/a','fff')) virtual); +drop table t1; +# LOAD_FILE() +create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual); +ERROR HY000: Function or expression 'load_file()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MATCH() +create table t1 (a varchar(32), b bool generated always as (match a against ('sample text')) virtual); +ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BENCHMARK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual); +ERROR HY000: Function or expression 'benchmark()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# FOUND_ROWS() +create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual); +ERROR HY000: Function or expression 'found_rows()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GET_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual); +ERROR HY000: Function or expression 'get_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_FREE_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual); +ERROR HY000: Function or expression 'is_free_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_USED_LOCK() +create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual); +ERROR HY000: Function or expression 'is_used_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# LAST_INSERT_ID() +create table t1 (a int generated always as (last_insert_id()) virtual); +ERROR HY000: Function or expression 'last_insert_id()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# MASTER_POS_WAIT() +create table t1 (a varchar(32), b int generated always as (master_pos_wait(a,0,2)) virtual); +ERROR HY000: Function or expression 'master_pos_wait()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# NAME_CONST() +create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual); +ERROR HY000: Function or expression 'name_const()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# RELEASE_LOCK() +create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual); +ERROR HY000: Function or expression 'release_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# ROW_COUNT() +create table t1 (a int generated always as (row_count()) virtual); +ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# SLEEP() +create table t1 (a int, b int generated always as (sleep(a)) virtual); +ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VALUES() +create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual); +ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# Stored procedures +create procedure p1() +begin +select current_user(); +end // +create function f1() +returns int +begin +return 1; +end // +create table t1 (a int generated always as (p1()) virtual); +ERROR HY000: Function or expression '`p1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create table t1 (a int generated always as (f1()) virtual); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +drop procedure p1; +drop function f1; +# Unknown functions +create table t1 (a int generated always as (f1()) virtual); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# +# GROUP BY FUNCTIONS +# +# AVG() +create table t1 (a int, b int generated always as (avg(a)) virtual); +ERROR HY000: Function or expression 'avg()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_AND() +create table t1 (a int, b int generated always as (bit_and(a)) virtual); +ERROR HY000: Function or expression 'bit_and()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_OR() +create table t1 (a int, b int generated always as (bit_or(a)) virtual); +ERROR HY000: Function or expression 'bit_or()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_XOR() +create table t1 (a int, b int generated always as (bit_xor(a)) virtual); +ERROR HY000: Function or expression 'bit_xor()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT(DISTINCT) +create table t1 (a int, b int generated always as (count(distinct a)) virtual); +ERROR HY000: Function or expression 'count(distinct )' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT() +create table t1 (a int, b int generated always as (count(a)) virtual); +ERROR HY000: Function or expression 'count()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GROUP_CONCAT() +create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual); +ERROR HY000: Function or expression 'group_concat()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MAX() +create table t1 (a int, b int generated always as (max(a)) virtual); +ERROR HY000: Function or expression 'max()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MIN() +create table t1 (a int, b int generated always as (min(a)) virtual); +ERROR HY000: Function or expression 'min()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STD() +create table t1 (a int, b int generated always as (std(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_POP() +create table t1 (a int, b int generated always as (stddev_pop(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_SAMP() +create table t1 (a int, b int generated always as (stddev_samp(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV() +create table t1 (a int, b int generated always as (stddev(a)) virtual); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# SUM() +create table t1 (a int, b int generated always as (sum(a)) virtual); +ERROR HY000: Function or expression 'sum()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_POP() +create table t1 (a int, b int generated always as (var_pop(a)) virtual); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_SAMP() +create table t1 (a int, b int generated always as (var_samp(a)) virtual); +ERROR HY000: Function or expression 'var_samp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VARIANCE() +create table t1 (a int, b int generated always as (variance(a)) virtual); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# +# Sub-selects +# +create table t1 (a int); +create table t2 (a int, b int generated always as (select count(*) virtual from t1)); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +# +# Long expression +create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual); +drop table t1; +create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual); +drop table t1; +# +# Constant expression +create table t1 (a int generated always as (PI()) virtual); +drop table t1; +# bug#21098119: GCOL WITH MATCH/AGAINST --> +# ASSERTION FAILED: TR && TR->TABLE->FILE +# +create table t1 (a int); +alter table t1 add column r blob generated always +as (match(a) against ('' in boolean mode)) virtual; +ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `r` +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_bug20746926.result b/mysql-test/suite/gcol/r/gcol_bug20746926.result new file mode 100644 index 00000000000..74fe76b3f1a --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_bug20746926.result @@ -0,0 +1,32 @@ +#Bug #20746926: GENERATED COLUMNS: INVALID READ OF THD WHEN WARNINGS +# +# Testing cmp_item_datetime +connect con1,localhost,root,,; +set sql_mode=''; +create table t1 ( +a date not null, +b mediumtext generated always as ((a not in (a,a))) virtual, +c timestamp generated always as ((a not in (b,b))) stored +); +insert t1(a) values(7777777777); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1292 Incorrect datetime value: '0' +show warnings; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1292 Incorrect datetime value: '0' +disconnect con1; +connect con2,localhost,root,,; +set sql_mode=''; +insert t1(a) values(6666666666); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1292 Incorrect datetime value: '0' +show warnings; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1292 Incorrect datetime value: '0' +drop table t1; +disconnect con2; +connection default; diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result new file mode 100644 index 00000000000..3ee376bd146 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -0,0 +1,628 @@ +# Bug#21230709: Alter table statement fails with division by zero +CREATE TABLE t1 ( +col1 INTEGER NOT NULL, +col2 INTEGER NOT NULL, +col3 INTEGER NOT NULL, +gcol1 INTEGER GENERATED ALWAYS AS (col3 + col3) VIRTUAL, +col4 INTEGER DEFAULT NULL, +col5 INTEGER DEFAULT NULL, +col6 INTEGER DEFAULT NULL, +col7 INTEGER DEFAULT NULL, +col8 INTEGER DEFAULT NULL, +col9 INTEGER DEFAULT NULL, +col10 INTEGER DEFAULT NULL, +col11 INTEGER DEFAULT NULL, +col12 INTEGER DEFAULT NULL, +col13 INTEGER DEFAULT NULL, +col14 INTEGER DEFAULT NULL, +col15 INTEGER DEFAULT NULL, +col16 INTEGER DEFAULT NULL, +col17 INTEGER DEFAULT NULL, +col18 INTEGER DEFAULT NULL, +col19 INTEGER DEFAULT NULL, +col20 INTEGER DEFAULT NULL, +col21 INTEGER DEFAULT NULL, +col22 INTEGER DEFAULT NULL, +col23 INTEGER DEFAULT NULL, +col24 INTEGER DEFAULT NULL, +col25 INTEGER DEFAULT NULL, +col26 INTEGER DEFAULT NULL, +col27 INTEGER DEFAULT NULL, +col28 INTEGER DEFAULT NULL, +col29 INTEGER DEFAULT NULL, +col30 INTEGER DEFAULT NULL, +col31 INTEGER DEFAULT NULL, +col32 INTEGER DEFAULT NULL, +col33 INTEGER DEFAULT NULL, +gcol2 INTEGER GENERATED ALWAYS AS (col2 + col2) VIRTUAL, +gcol3 INTEGER GENERATED ALWAYS AS (gcol2 / gcol2) VIRTUAL, +PRIMARY KEY (col1), +KEY idx1 (gcol1) +) engine=innodb; +INSERT INTO t1 (col1, col2, col3) +VALUES (0,1,2), (1,2,3), (2,3,4), (3,4,5), (4,5,6); +FLUSH TABLE t1; +ALTER TABLE t1 ADD COLUMN extra INTEGER; +DROP TABLE t1; +# +# Bug 21340801 WL8149:ASSERTION `IS_VIRTUAL_GCOL()' FAILED +# +CREATE TABLE t1 ( +c_blob BLOB, +c_blob_key BLOB GENERATED ALWAYS AS (REPEAT(c_blob,15)) STORED, +KEY (c_blob_key(200)) +); +INSERT INTO t1 (c_blob) VALUES ('xceks'); +DROP TABLE t1; +# +# Bug#21345972 WL8149:JOIN_CACHE::FILTER_VIRTUAL_GCOL_BASE_COLS(): ASSERTION `FALSE' FAILED. +# +CREATE TABLE c ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, +col_date_nokey DATE /*! NULL */, +col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +PRIMARY KEY (pk), +UNIQUE KEY (col_int_key), +UNIQUE KEY (col_varchar_key), +UNIQUE KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +UNIQUE KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY(col_int_key,col_date_key), +KEY(col_int_key, col_time_key), +KEY(col_int_key, col_datetime_key), +UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), +UNIQUE KEY (col_varchar_key, col_varchar_nokey), +UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) +) ENGINE=INNODB; +INSERT /*! IGNORE */ INTO c ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES (7, '2004-04-09', '14:03:03.042673', +'2001-11-28 00:50:27.051028', 'c'),(1, '2006-05-13', '01:46:09.016386', +'2007-10-09 19:53:04.008332', NULL); +Warnings: +Warning 1048 Column 'col_varchar_key' cannot be null +CREATE TABLE bb ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, +col_date_nokey DATE /*! NULL */, +col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +PRIMARY KEY (pk), +UNIQUE KEY (col_int_key), +UNIQUE KEY (col_varchar_key), +UNIQUE KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +UNIQUE KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY(col_int_key,col_date_key), +KEY(col_int_key, col_time_key), +KEY(col_int_key, col_datetime_key), +UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), +UNIQUE KEY (col_varchar_key, col_varchar_nokey), +UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB; +INSERT /*! IGNORE */ INTO bb ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES (0, '2003-08-04', '01:48:05.048577', +'2006-11-03 00:00:00', 'p'),(2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); +CREATE TABLE cc ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, +col_date_nokey DATE /*! NULL */, +col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +PRIMARY KEY (pk), +UNIQUE KEY (col_int_key), +UNIQUE KEY (col_varchar_key), +UNIQUE KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +UNIQUE KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY(col_int_key,col_date_key), +KEY(col_int_key, col_time_key), +KEY(col_int_key, col_datetime_key), +UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), +UNIQUE KEY (col_varchar_key, col_varchar_nokey), +UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB; +INSERT /*! IGNORE */ INTO cc ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'),(NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); +Warnings: +Warning 1048 Column 'col_int_key' cannot be null +Warning 1048 Column 'col_datetime_key' cannot be null +Warning 1048 Column 'col_time_key' cannot be null +EXPLAIN SELECT +gp1 . col_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +col_time_nokey ) +WHERE +gp1 . col_varchar_nokey IN +( +SELECT +DISTINCT p1 . col_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . col_int_key = p2 . pk ) +) +AND gp1 . col_varchar_nokey = 'b' +HAVING g1 > 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE gp1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +1 SIMPLE p1 NULL const col_varchar_key,col_varchar_key_2 col_varchar_key 4 const 1 100.00 NULL +1 SIMPLE p2 NULL eq_ref PRIMARY PRIMARY 4 test.p1.col_int_key 1 100.00 Using index; FirstMatch(gp1) +1 SIMPLE gp2 NULL index NULL col_datetime_key 5 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +Warnings: +Warning 1292 Incorrect datetime value: '6' for column 'col_datetime_key' at row 1 +Note 1003 /* select#1 */ select `test`.`gp1`.`col_datetime_key` AS `g1` from `test`.`cc` `gp1` semi join (`test`.`bb` `p1` left join `test`.`bb` `p2` on((`test`.`p1`.`col_int_key` = `test`.`p2`.`pk`))) left join `test`.`c` `gp2` on((`test`.`gp2`.`col_datetime_key` <> `test`.`gp1`.`col_time_nokey`)) where ((`test`.`gp1`.`col_varchar_nokey` = 'b') and ('b' = `test`.`p1`.`col_varchar_key`)) having (`g1` > 6) +SELECT +gp1 . col_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +col_time_nokey ) +WHERE +gp1 . col_varchar_nokey IN +( +SELECT +DISTINCT p1 . col_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . col_int_key = p2 . pk ) +) +AND gp1 . col_varchar_nokey = 'b' +HAVING g1 > 6; +g1 +Warnings: +Warning 1292 Incorrect datetime value: '6' for column 'col_datetime_key' at row 1 +DROP TABLE bb, c, cc; +# Bug#21284646: Assertion !(table || table->read_set || bitmap_is_set()) +CREATE TABLE c ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL not null, +col_date_nokey DATE NOT NULL, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +PRIMARY KEY (pk,col_int_nokey), +UNIQUE KEY (col_int_key), +UNIQUE KEY (col_varchar_key), +UNIQUE KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +UNIQUE KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY(col_int_key,col_date_key), +KEY(col_int_key, col_time_key), +KEY(col_int_key, col_datetime_key), +UNIQUE KEY (col_date_key,col_time_key,col_datetime_key), +UNIQUE KEY (col_varchar_key, col_varchar_nokey), +UNIQUE KEY (col_int_key, col_varchar_key, col_date_key, col_time_key, col_datetime_key) +) ENGINE=INNODB; +INSERT INTO c (col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) VALUES +(1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(2, '2002-10-13', '00:00:00', '1900-01-01 00:00:00', 's'), +(4, '1900-01-01', '15:57:25.019666', '2005-08-15 00:00:00', 'r'); +ANALYZE TABLE c; +Table Op Msg_type Msg_text +test.c analyze status OK +explain SELECT COUNT(DISTINCT col_varchar_key) AS x +FROM c +WHERE col_varchar_key IN ('rr', 'rr') OR +col_int_nokey <> 9 AND +pk >= 8 +HAVING x > '2000-02-06' +ORDER BY col_time_nokey, pk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE c NULL index_merge PRIMARY,col_varchar_key,col_int_key_2,col_varchar_key_2,col_int_key_7 col_varchar_key,PRIMARY 4,4 NULL 2 100.00 Using sort_union(col_varchar_key,PRIMARY); Using where +Warnings: +Note 1003 /* select#1 */ select count(distinct `test`.`c`.`col_varchar_key`) AS `x` from `test`.`c` where ((`test`.`c`.`col_varchar_key` in ('rr','rr')) or ((`test`.`c`.`col_int_nokey` <> 9) and (`test`.`c`.`pk` >= 8))) having (`x` > '2000-02-06') +SELECT COUNT(DISTINCT col_varchar_key) AS x +FROM c +WHERE col_varchar_key IN ('rr', 'rr') OR +col_int_nokey <> 9 AND +pk >= 8 +HAVING x > '2000-02-06' +ORDER BY col_time_nokey, pk; +x +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2000-02-06' +DROP TABLE c; +# Bug#21341044: Conditional jump at sort_param::make_sort_key +CREATE TABLE t1 ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, +col_blob_nokey BLOB /*! NULL */, +col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, +col_longblob_nokey LONGBLOB /*! NULL */, +col_longtext_nokey LONGTEXT /*! NULL */, +col_longblob_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 20)) VIRTUAL, +col_longtext_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 18)) VIRTUAL, +col_text_nokey TEXT /*! NULL */, +col_text_key TEXT GENERATED ALWAYS AS (REPEAT(col_text_nokey, 30)) VIRTUAL, +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_text_key(50)), +KEY (col_blob_key(200)), +KEY (col_longtext_key(200)), +KEY (col_longblob_key(200)), +KEY (col_int_key, col_text_key(100)), +KEY (col_int_key, col_longtext_key(100)), +KEY (col_int_key, col_blob_key(100)), +KEY (col_int_key, col_longblob_key(100)), +KEY (col_longtext_key(10), col_longblob_key(100)), +KEY (col_int_key, col_text_key(10), col_blob_key(100), col_longtext_key(50), col_longblob_key(50)) +) engine=innodb; +INSERT INTO t1 (col_int_nokey,col_blob_nokey,col_longtext_nokey,col_longblob_nokey,col_text_nokey) +VALUES +(0, 'ijcszxw', 'ijcszxw', 'ijcszxw', 'ijcszxw'), +(5, 'jcszxwb', 'jcszxwb', 'jcszxwb', 'jcszxwb'), +(4, 'cszxwbjjvv', 'cszxwbjjvv', 'cszxwbjjvv', 'cszxwbjjvv'), +(3, 'szxw', 'szxw', 'szxw', 'szxw'), +(7, 'zxwb', 'zxwb', 'zxwb', 'zxwb'), +(42, 'xwbjjvvky', 'xwbjjvvky', 'xwbjjvvky', 'xwbjjvvky'), +(142, 'wbjj', 'wbjj', 'wbjj', 'wbjj'), +(5, 'bjjv', 'bjjv', 'bjjv', 'bjjv'), +(0, 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu'), +(3, 'j', 'j', 'j', 'j'); +SELECT alias1.pk AS field1 +FROM t1 AS alias1 LEFT OUTER JOIN t1 AS alias2 +ON alias1.col_int_key = alias2.col_int_key +WHERE alias2.col_int_key BETWEEN 8 AND (8 + 1 ) OR +alias2.col_int_key BETWEEN 8 AND (8 + 5 ) AND +alias2.col_int_key != 20 OR +alias2.col_int_key IN (8, 5, 8) AND +alias2.col_int_key >= 0 AND +alias2.col_int_key <= ( 8 + 75 ) AND +alias1.pk IS NOT NULL +ORDER BY field1; +field1 +2 +2 +3 +8 +8 +DROP TABLE t1; +# bug#21487651: gcols: memory leak after failed alter table +CREATE TABLE t(a int); +ALTER TABLE t ADD COLUMN b int GENERATED ALWAYS AS ( +date_sub(a,interval a month)) VIRTUAL; +ALTER TABLE t ADD COLUMN c int GENERATED ALWAYS AS (sum(a)); +ERROR HY000: Invalid use of group function +DROP TABLE t; +# +# Bug#21628840: CRASH/MEMORY CORRUPTION ADDING INDEXES TO VIRTUAL COLUMN +# (II) +# +CREATE TABLE t1( a INT ) ENGINE = INNODB; +INSERT INTO t1( a ) VALUES ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ); +ALTER TABLE t1 ADD COLUMN b INT GENERATED ALWAYS AS (a - 1) STORED; +ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS (b + 1) VIRTUAL; +# Used to cause valgrind warning. +ALTER TABLE t1 ADD INDEX( c ); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# Make sure the index is correct. That's kinda important. +EXPLAIN +SELECT c FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL c 5 NULL 5 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`c` AS `c` from `test`.`t1` +SELECT c FROM t1; +c +1 +2 +3 +4 +5 +DROP TABLE t1; +# +# Bug#21797776 ASSERTION `BIT < MAP->N_BITS' FAILED. +# +CREATE TABLE C ( +col_int_1 INT, +col_int_2 INT GENERATED ALWAYS AS (col_int_1 + col_int_1) STORED, +col_int_3 INT GENERATED ALWAYS AS (col_int_2 + col_int_1) VIRTUAL +); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS +SELECT +col_int_2 AS field1, col_int_2 AS field2, +col_int_3 AS field3, col_int_3 AS field4 +FROM C; +SELECT * FROM v1; +field1 field2 field3 field4 +DROP TABLE C; +DROP VIEW v1; +# +# Bug#21613615 GCOLS: ASSERTION FAILED: !TABLE || (!TABLE->READ_SET || BITMAP_IS_SET +# +CREATE TABLE t (a INT); +CREATE TABLE v ( +a INT, +c INT, +b CHAR(2) GENERATED ALWAYS AS (a IN (1)) VIRTUAL, +KEY(c,b(1))); +INSERT INTO v (a,c) VALUES (1,1); +EXPLAIN SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +2 SUBQUERY t NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t` where 0 +SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); +1 +EXPLAIN SELECT (SELECT MAX(c) FROM v); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select (/* select#2 */ select max(`test`.`v`.`c`) from `test`.`v`) AS `(SELECT MAX(c) FROM v)` +SELECT (SELECT MAX(c) FROM v); +(SELECT MAX(c) FROM v) +1 +DROP TABLE t, v; +CREATE TABLE v ( +a INT, +c INT, +b CHAR(2) GENERATED ALWAYS AS (a IN (1)) VIRTUAL, KEY(c,b(1))); +INSERT INTO v (a,c) VALUES (1,1); +SELECT MAX(c), COUNT(b) FROM v; +MAX(c) COUNT(b) +1 1 +DROP TABLE v; +CREATE TABLE v ( +a INT PRIMARY KEY, +b INT, KEY(b)); +INSERT INTO v (a,b) VALUES (1,1); +SELECT MAX(a) FROM v WHERE b=1; +MAX(a) +1 +DROP TABLE v; +# +# Bug#21824519: ASSERTION IN DROP TRIGGER WHEN TABLE HAS +# VIRTUAL GENERATED COLUMN +# +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL); +CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW BEGIN END; +INSERT INTO t (a) VALUES (1); +SELECT * FROM t; +a b +1 1 +DROP TRIGGER tr; +SELECT * FROM t; +a b +1 1 +CREATE FUNCTION f() RETURNS INT RETURN (SELECT COUNT(*) FROM t); +SELECT f(); +f() +1 +DROP FUNCTION f; +SELECT * FROM t; +a b +1 1 +DROP TABLE t; +# +# Bug#21833760 CALC_DAYNR: ASSERTION `DELSUM+(INT) Y/4-TEMP >= 0' FAILED. +# +CREATE TABLE C( +c1 INT AUTO_INCREMENT, +c8 DATETIME, +c9 TIME, +c11 TIME GENERATED ALWAYS AS(ADDTIME(c8,c9)) VIRTUAL, +c13 TIME GENERATED ALWAYS AS(ADDTIME(c8,c11)) VIRTUAL, +PRIMARY KEY(c1), +UNIQUE KEY(c13) +); +INSERT INTO C (c8,c9) VALUES('1970-01-01',0),('1970-01-01',1); +CREATE VIEW view_C AS SELECT * FROM C; +SELECT /*+ NO_BNL(t1) */ t1.c13 FROM C AS t2 STRAIGHT_JOIN C AS t1 FORCE INDEX(c13); +c13 +00:00:00 +00:00:01 +00:00:00 +00:00:01 +SELECT DISTINCT t1.c13 FROM C AS t1, view_C AS t2; +c13 +00:00:00 +00:00:01 +DROP TABLE C; +DROP VIEW view_C; +# +# Bug #21808680: JSON + GENERATED COLUMN CORRUPTS TABLE CACHE +# MEMORY, CRASHES +# +CREATE TABLE t (a INT, b JSON, c TEXT GENERATED ALWAYS AS (REPEAT(a=b, 2))); +INSERT INTO t (a, b) VALUES (1, '2'), (3, '3'); +SELECT * FROM t; +a b c +1 2 00 +3 3 11 +DROP TABLE t; +# +# Bug#21810529: CRASH IN ITEM_FUNC::WALK WHEN CODE JUMPS TO GARBAGE +# LOCATION +# +CREATE TABLE t (a TIME,b INT GENERATED ALWAYS AS (a=1) VIRTUAL); +ALTER TABLE t CHANGE COLUMN q w INT; +ERROR 42S22: Unknown column 'q' in 't' +ALTER TABLE t CHANGE COLUMN q w INT; +ERROR 42S22: Unknown column 'q' in 't' +ALTER TABLE t CHANGE COLUMN q w INT; +ERROR 42S22: Unknown column 'q' in 't' +ALTER TABLE t CHANGE COLUMN q w INT; +ERROR 42S22: Unknown column 'q' in 't' +DROP TABLE t; +# +# Bug#21940542 TOO MUCH SPAM: INNODB: COMPUTE VIRTUAL COLUMN VALUES FAILED +# +CREATE TABLE t(b BLOB); +ALTER TABLE t ADD COLUMN c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL; +ERROR HY000: Expression of generated column 'c' contains a disallowed function. +DROP TABLE t; +CREATE TABLE t(b BLOB, c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL); +ERROR HY000: Expression of generated column 'c' contains a disallowed function. +# +# Bug#21929967 GCOLS: GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE +# +CREATE TABLE t1(a CHAR(1), b CHAR(1), c CHAR(2) AS (a || b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + `b` char(1) DEFAULT NULL, + `c` char(2) GENERATED ALWAYS AS ((`a` or `b`)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES('1','1'); +SELECT * FROM t1; +a b c +1 1 1 +SET SQL_MODE=PIPES_AS_CONCAT; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +SELECT * FROM t1; +a b c +1 1 1 +FLUSH TABLES; +SELECT * FROM t1; +a b c +1 1 1 +DROP TABLE t1; +CREATE TABLE t1(a CHAR(1), b CHAR(1), c CHAR(2) AS (a || b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + `b` char(1) DEFAULT NULL, + `c` char(2) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES('1','1'); +SELECT * FROM t1; +a b c +1 1 11 +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +a b c +1 1 11 +FLUSH TABLES; +SELECT * FROM t1; +a b c +1 1 11 +DROP TABLE t1; +# Bug#22018999: gcols: assertion failed: !error +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; +ERROR 22007: Truncated incorrect INTEGER value: 'a' +CREATE TABLE t (a INTEGER) engine=innodb; +ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1)); +ERROR 22007: Truncated incorrect INTEGER value: 'a' +DROP TABLE t; +set sql_mode= @save_old_sql_mode; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +# Bug#21875520 Problems with virtual column indexes +CREATE TABLE t( +a TIMESTAMP, +b BLOB, +c TIMESTAMP GENERATED ALWAYS AS (GREATEST(a, '2000-01-01 00:00:00')) VIRTUAL, +UNIQUE KEY(c) +); +INSERT INTO t(b) VALUES (''); +UPDATE t SET a='2001-01-01 00:00:00'; +SELECT c FROM t; +c +2001-01-01 00:00:00 +SELECT c, a FROM t; +c a +2001-01-01 00:00:00 2001-01-01 00:00:00 +UPDATE t SET b='xyz'; +DO (SELECT @c1:= c FROM t); +DO (SELECT (@c2:= c) - a FROM t); +SELECT @c2 - @c1; +@c2 - @c1 +0 +DROP TABLE t; +# +# Bug#22133710 GCOLS: READ UNCOMMITTED: ASSERT !TABLE || (!TABLE->WRITE_SET || BITMAP_IS_SET(TA +# +CREATE TABLE t ( +a INT, +b INT GENERATED ALWAYS AS (1) VIRTUAL, +c INT GENERATED ALWAYS AS (1) VIRTUAL, +d INT GENERATED ALWAYS AS (1) VIRTUAL, +KEY (b,d) +) ENGINE=INNODB; +INSERT INTO t VALUES(); +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; +SELECT 1 FROM t WHERE c GROUP BY b; +1 +1 +COMMIT; +DROP TABLE t; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result new file mode 100644 index 00000000000..e750bf01d7d --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -0,0 +1,582 @@ +SET @@session.default_storage_engine = 'InnoDB'; +# +# Section 1. Wrong column definition options +# - DEFAULT +# - AUTO_INCREMENT +# NOT NULL +create table t1 (a int, b int generated always as (a+1) virtual not null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null)' at line 1 +create table t1 (a int, b int generated always as (a+1) stored not null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual not null; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null' at line 1 +drop table t1; +create table t1 (a int, b int generated always as (a+1) virtual null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual null; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null' at line 1 +drop table t1; +# Added columns mixed with virtual GC and other columns +create table t1 (a int); +insert into t1 values(1); +alter table t1 add column (b int generated always as (a+1) virtual, c int); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +alter table t1 add column (d int, e int generated always as (a+1) virtual); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +alter table t1 add column (f int generated always as (a+1) virtual, g int as(5) stored); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +alter table t1 add column (h int generated always as (a+1) virtual, i int as(5) virtual); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +drop table t1; +# DEFAULT +create table t1 (a int, b int generated always as (a+1) virtual default 0); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default 0)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual default 0; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default 0' at line 1 +drop table t1; +# AUTO_INCREMENT +create table t1 (a int, b int generated always as (a+1) virtual AUTO_INCREMENT); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT' at line 1 +drop table t1; +# [PRIMARY] KEY +create table t1 (a int, b int generated always as (a+1) stored key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 +create table t1 (a int, b int generated always as (a+1) stored primary key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) stored key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 add column c int generated always as (a+2) stored primary key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key' at line 1 +drop table t1; +# Section 2. Other column definition options +# - COMMENT +# - REFERENCES (only syntax testing here) +# - STORED (only systax testing here) +create table t1 (a int, b int generated always as (a % 2) virtual comment 'my comment'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) virtual comment 'my comment'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +insert into t1 (a) values (1); +select * from t1; +a b +1 1 +insert into t1 values (2,default); +select a,b from t1 order by a; +a b +1 1 +2 0 +create table t2 like t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t2; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +insert into t2 (a) values (1); +select * from t2; +a b +1 1 +insert into t2 values (2,default); +select a,b from t2 order by a; +a b +1 1 +2 0 +drop table t2; +drop table t1; +create table t1 (a int, b int generated always as (a % 2) stored); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL PERSISTENT +insert into t1 (a) values (1); +select * from t1; +a b +1 1 +insert into t1 values (2,default); +select a,b from t1 order by a; +a b +1 1 +2 0 +drop table t1; +create table t2 (a int); +create table t1 (a int, b int generated always as (a % 2) stored references t2(a)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) stored references t2(a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'references t2(a)' at line 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +drop table t2; +FK options +create table t1(a int, b int as (a % 2), c int as (a) stored); +create table t2 (a int); +alter table t1 add constraint foreign key fk(d) references t2(a); +ERROR 42000: Key column 'd' doesn't exist in table +alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +drop table t1; +drop table t2; +Generated always is optional +create table t1 (a int, b int as (a % 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +create table t1 (a int, b int as (a % 2) stored); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL PERSISTENT +drop table t1; +Default should be non-stored column +create table t1 (a int, b int as (a % 2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +Expression can be constant +create table t1 (a int, b int as (5 * 2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (5 * 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +Test generated columns referencing other generated columns +create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual); +insert into t1 (a) values (1), (2); +select * from t1; +a b c +1 -1 0 +2 -2 -1 +insert into t1(a) values (1) on duplicate key update a=3; +select * from t1; +a b c +2 -2 -1 +3 -3 -2 +update t1 set a=4 where a=2; +select * from t1; +a b c +3 -3 -2 +4 -4 -3 +drop table t1; +create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual); +ERROR 01000: Expression for field `b` is refering to uninitialized field `b` +create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); +ERROR 01000: Expression for field `b` is refering to uninitialized field `c` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); +ERROR 01000: Expression for field `col_int_nokey` is refering to uninitialized field `pk` +# Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE +create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); +insert into t1(a) values(1),(2); +create table tt as select * from t1; +select * from t1 order by a; +a b c +1 -1 0 +2 -2 -1 +select * from tt order by a; +a b c +1 -1 0 +2 -2 -1 +drop table t1,tt; +# Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON +# VIRTUAL GC FOR MYISAM +CREATE TABLE A ( +pk INTEGER, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY +(col_int_key)); +ERROR HY000: Key/Index cannot be defined on a non-stored computed column +# Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: +# THD->CHANGE_LIST.IS_EMPTY() +# +CREATE TABLE t1(a bigint AS (a between 1 and 1)); +ERROR 01000: Expression for field `a` is refering to uninitialized field `a` +# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +# IN FIND_FIELD_IN_TABLE +# +CREATE TABLE t1(a int); +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `z` +DROP TABLE t1; +# Bug#20566243: ERROR WHILE DOING CREATE TABLE T1 SELECT (QUERY ON GC COLUMNS) +CREATE TABLE t1(a int, b int as (a + 1), +c varchar(12) as ("aaaabb") stored, d blob as (c)); +INSERT INTO t1(a) VALUES(1),(3); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a + 1) VIRTUAL, + `c` varchar(12) AS ("aaaabb") PERSISTENT, + `d` blob AS (c) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1 order by a; +a b c d +1 2 aaaabb aaaabb +3 4 aaaabb aaaabb +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a + 1) VIRTUAL, + `c` varchar(12) AS ("aaaabb") PERSISTENT, + `d` blob AS (c) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE t3 AS SELECT * FROM t1; +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` varchar(12) DEFAULT NULL, + `d` blob DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t3 order by a; +a b c d +1 2 aaaabb aaaabb +3 4 aaaabb aaaabb +CREATE TABLE t4 AS SELECT b,c,d FROM t1; +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `b` int(11) DEFAULT NULL, + `c` varchar(12) DEFAULT NULL, + `d` blob DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t4 order by b; +b c d +2 aaaabb aaaabb +4 aaaabb aaaabb +DROP TABLE t1,t2,t3,t4; +# Bug#21025003:WL8149:ASSERTION `CTX->NUM_TO_DROP_FK +# == HA_ALTER_INFO->ALTER_INFO-> FAILED +# +CREATE TABLE t1 ( +col1 int(11) DEFAULT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) DEFAULT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS (col4 / col2) VIRTUAL, +col6 text +); +INSERT INTO t1(col1,col2,col3,col4,col6) VALUES(NULL,1,4,0,REPEAT(2,1000)); +ALTER TABLE t1 DROP PRIMARY KEY , ADD KEY idx ( col5, col2 ); +ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists +DROP TABLE t1; +# Bug#20949226:i CAN ASSIGN NON-DEFAULT() VALUE TO GENERATED COLUMN +# +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2; +Warnings: +Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +CREATE TABLE t2 (a int); +INSERT INTO t2 values(1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2; +Warnings: +Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5; +SELECT * FROM t1; +c2 c1 5 +2 1 5 +DROP TABLE t1, t2; +# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +# IN FIND_FIELD_IN_TABLE +# +CREATE TABLE t1(a int); +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `z` +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +DROP TABLE t1; +# Bug#21142905: PARTITIONED GENERATED COLS - +# !TABLE || (!TABLE->WRITE_SET || BITMAP_IS_SET +# +CREATE TABLE t1 ( +a int, +b int generated always as (a) virtual, +c int generated always as (b+a) virtual, +d int generated always as (b+a) virtual +) PARTITION BY LINEAR HASH (b); +INSERT INTO t1(a) VALUES(0); +DELETE FROM t1 WHERE c=1; +DROP TABLE t1; +CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar"))' at line 1 +CREATE TABLE t1 (i INT); +ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar")' at line 1 +DROP TABLE t1; +CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS (10))' at line 1 +# Check for a charset mismatch processing: +# Bug #21469535: VALGRIND ERROR (CONDITIONAL JUMP) WHEN INSERT +# ROWS INTO A PARTITIONED TABLE +# +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +INSERT INTO t1 VALUES(1, 2, default); +DROP TABLE t1; +# Bug#21465626:ASSERT/CRASH ON DROPPING/ADDING VIRTUAL COLUMN +CREATE TABLE t (a int(11), b int(11), +c int(11) GENERATED ALWAYS AS (a+b) VIRTUAL, +d int(11) GENERATED ALWAYS AS (a+b) VIRTUAL); +INSERT INTO t(a,b) VALUES(1,2); +# Mixed drop/add/rename virtual with non-virtual columns, +# ALGORITHM=INPLACE is not supported for InnoDB +ALTER TABLE t DROP d, ADD e varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD d int, ADD f char(10) AS ('aaa'); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE d dd int, CHANGE f ff varchar(10) AS ('bbb'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Only drop/add/change virtual, inplace is supported for Innodb +ALTER TABLE t DROP c, DROP ff; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD c int(11) as (a+b), ADD f varchar(10) as ('aaa'); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE c c int(11) as (a), CHANGE f f varchar(10) as('bbb'); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +# Change order should be ALGORITHM=INPLACE on Innodb +ALTER TABLE t CHANGE c c int(11) as (a) after f; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE b b int(11) after c; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +# TODO: Changing virtual column type should be ALGORITHM=INPLACE on InnoDB, current it goes only with COPY method +ALTER TABLE t CHANGE c c varchar(10) as ('a'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Changing stored column type is ALGORITHM=COPY +ALTER TABLE t CHANGE dd d varchar(10); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t; +# Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF +CREATE TABLE t1( +col1 INTEGER PRIMARY KEY, +col2 INTEGER, +col3 INTEGER, +col4 INTEGER, +vgc1 INTEGER AS (col2 + col3) VIRTUAL, +sgc1 INTEGER AS (col2 - col3) STORED +); +INSERT INTO t1(col1, col2, col3) VALUES +(1, 10, 100), (2, 20, 200); +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 110 -90 +2 20 200 NULL 220 -180 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 0 +2 20 200 NULL 4000 0 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 110 0 +2 20 200 NULL 220 0 +SELECT sgc1 FROM t1 order by sgc1; +sgc1 +0 +0 +ALTER TABLE t1 DROP INDEX sgc1; +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +ERROR 23000: Duplicate entry '0' for key 'sgc1' +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +SELECT vgc1 FROM t1 order by col1; +vgc1 +1000 +4000 +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 * col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 1000 +2 20 200 NULL 4000 4000 +SELECT sgc1 FROM t1 order by sgc1; +sgc1 +1000 +4000 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; +ERROR HY000: This is not yet supported for computed columns +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; +ERROR HY000: This is not yet supported for computed columns +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER AS (col1 + col2 + col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 111 1000 1000 +2 20 200 222 4000 4000 +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 111 1000 1000 +2 20 200 222 4000 4000 +DROP TABLE t1; +# +# Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE +# ALLOWED IN GENERATED COLUMNS +# +# Test 1: ALTER DEFAULT +# +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, +b INT AS (1 + DEFAULT(a)) STORED, +c INT AS (1 + DEFAULT(a)) VIRTUAL); +INSERT INTO t1 VALUES (); +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +# Test 2: ALTER DEFAULT + ADD GCOL +# +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5); +INSERT INTO t1 VALUES(); +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN b1 INT AS (1 + DEFAULT(a)) STORED; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN c1 INT AS (1 + DEFAULT(a)) VIRTUAL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN b INT AS (1 + DEFAULT(a)) STORED, +ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result new file mode 100644 index 00000000000..dff8208591d --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -0,0 +1,582 @@ +SET @@session.default_storage_engine = 'MyISAM'; +# +# Section 1. Wrong column definition options +# - DEFAULT +# - AUTO_INCREMENT +# NOT NULL +create table t1 (a int, b int generated always as (a+1) virtual not null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null)' at line 1 +create table t1 (a int, b int generated always as (a+1) stored not null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual not null; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null' at line 1 +drop table t1; +create table t1 (a int, b int generated always as (a+1) virtual null); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual null; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null' at line 1 +drop table t1; +# Added columns mixed with virtual GC and other columns +create table t1 (a int); +insert into t1 values(1); +alter table t1 add column (b int generated always as (a+1) virtual, c int); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +alter table t1 add column (d int, e int generated always as (a+1) virtual); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +alter table t1 add column (f int generated always as (a+1) virtual, g int as(5) stored); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +alter table t1 add column (h int generated always as (a+1) virtual, i int as(5) virtual); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +drop table t1; +# DEFAULT +create table t1 (a int, b int generated always as (a+1) virtual default 0); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default 0)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual default 0; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default 0' at line 1 +drop table t1; +# AUTO_INCREMENT +create table t1 (a int, b int generated always as (a+1) virtual AUTO_INCREMENT); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT' at line 1 +drop table t1; +# [PRIMARY] KEY +create table t1 (a int, b int generated always as (a+1) stored key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 +create table t1 (a int, b int generated always as (a+1) stored primary key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) stored key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 add column c int generated always as (a+2) stored primary key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key' at line 1 +drop table t1; +# Section 2. Other column definition options +# - COMMENT +# - REFERENCES (only syntax testing here) +# - STORED (only systax testing here) +create table t1 (a int, b int generated always as (a % 2) virtual comment 'my comment'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) virtual comment 'my comment'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +insert into t1 (a) values (1); +select * from t1; +a b +1 1 +insert into t1 values (2,default); +select a,b from t1 order by a; +a b +1 1 +2 0 +create table t2 like t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t2; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +insert into t2 (a) values (1); +select * from t2; +a b +1 1 +insert into t2 values (2,default); +select a,b from t2 order by a; +a b +1 1 +2 0 +drop table t2; +drop table t1; +create table t1 (a int, b int generated always as (a % 2) stored); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL PERSISTENT +insert into t1 (a) values (1); +select * from t1; +a b +1 1 +insert into t1 values (2,default); +select a,b from t1 order by a; +a b +1 1 +2 0 +drop table t1; +create table t2 (a int); +create table t1 (a int, b int generated always as (a % 2) stored references t2(a)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) stored references t2(a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'references t2(a)' at line 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +drop table t2; +FK options +create table t1(a int, b int as (a % 2), c int as (a) stored); +create table t2 (a int); +alter table t1 add constraint foreign key fk(d) references t2(a); +ERROR 42000: Key column 'd' doesn't exist in table +alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +drop table t1; +drop table t2; +Generated always is optional +create table t1 (a int, b int as (a % 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +create table t1 (a int, b int as (a % 2) stored); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL PERSISTENT +drop table t1; +Default should be non-stored column +create table t1 (a int, b int as (a % 2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +Expression can be constant +create table t1 (a int, b int as (5 * 2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (5 * 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL +drop table t1; +Test generated columns referencing other generated columns +create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual); +insert into t1 (a) values (1), (2); +select * from t1; +a b c +1 -1 0 +2 -2 -1 +insert into t1(a) values (1) on duplicate key update a=3; +select * from t1; +a b c +2 -2 -1 +3 -3 -2 +update t1 set a=4 where a=2; +select * from t1; +a b c +3 -3 -2 +4 -4 -3 +drop table t1; +create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual); +ERROR 01000: Expression for field `b` is refering to uninitialized field `b` +create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); +ERROR 01000: Expression for field `b` is refering to uninitialized field `c` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); +ERROR 01000: Expression for field `col_int_nokey` is refering to uninitialized field `pk` +# Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE +create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); +insert into t1(a) values(1),(2); +create table tt as select * from t1; +select * from t1 order by a; +a b c +1 -1 0 +2 -2 -1 +select * from tt order by a; +a b c +1 -1 0 +2 -2 -1 +drop table t1,tt; +# Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON +# VIRTUAL GC FOR MYISAM +CREATE TABLE A ( +pk INTEGER, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY +(col_int_key)); +ERROR HY000: Key/Index cannot be defined on a non-stored computed column +# Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: +# THD->CHANGE_LIST.IS_EMPTY() +# +CREATE TABLE t1(a bigint AS (a between 1 and 1)); +ERROR 01000: Expression for field `a` is refering to uninitialized field `a` +# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +# IN FIND_FIELD_IN_TABLE +# +CREATE TABLE t1(a int); +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `z` +DROP TABLE t1; +# Bug#20566243: ERROR WHILE DOING CREATE TABLE T1 SELECT (QUERY ON GC COLUMNS) +CREATE TABLE t1(a int, b int as (a + 1), +c varchar(12) as ("aaaabb") stored, d blob as (c)); +INSERT INTO t1(a) VALUES(1),(3); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a + 1) VIRTUAL, + `c` varchar(12) AS ("aaaabb") PERSISTENT, + `d` blob AS (c) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1 order by a; +a b c d +1 2 aaaabb aaaabb +3 4 aaaabb aaaabb +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a + 1) VIRTUAL, + `c` varchar(12) AS ("aaaabb") PERSISTENT, + `d` blob AS (c) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 AS SELECT * FROM t1; +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` varchar(12) DEFAULT NULL, + `d` blob DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t3 order by a; +a b c d +1 2 aaaabb aaaabb +3 4 aaaabb aaaabb +CREATE TABLE t4 AS SELECT b,c,d FROM t1; +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `b` int(11) DEFAULT NULL, + `c` varchar(12) DEFAULT NULL, + `d` blob DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t4 order by b; +b c d +2 aaaabb aaaabb +4 aaaabb aaaabb +DROP TABLE t1,t2,t3,t4; +# Bug#21025003:WL8149:ASSERTION `CTX->NUM_TO_DROP_FK +# == HA_ALTER_INFO->ALTER_INFO-> FAILED +# +CREATE TABLE t1 ( +col1 int(11) DEFAULT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) DEFAULT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS (col4 / col2) VIRTUAL, +col6 text +); +INSERT INTO t1(col1,col2,col3,col4,col6) VALUES(NULL,1,4,0,REPEAT(2,1000)); +ALTER TABLE t1 DROP PRIMARY KEY , ADD KEY idx ( col5, col2 ); +ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists +DROP TABLE t1; +# Bug#20949226:i CAN ASSIGN NON-DEFAULT() VALUE TO GENERATED COLUMN +# +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2; +Warnings: +Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +CREATE TABLE t2 (a int); +INSERT INTO t2 values(1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2; +Warnings: +Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5; +SELECT * FROM t1; +c2 c1 5 +2 1 5 +DROP TABLE t1, t2; +# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES +# IN FIND_FIELD_IN_TABLE +# +CREATE TABLE t1(a int); +ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS +( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `z` +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +DROP TABLE t1; +# Bug#21142905: PARTITIONED GENERATED COLS - +# !TABLE || (!TABLE->WRITE_SET || BITMAP_IS_SET +# +CREATE TABLE t1 ( +a int, +b int generated always as (a) virtual, +c int generated always as (b+a) virtual, +d int generated always as (b+a) virtual +) PARTITION BY LINEAR HASH (b); +INSERT INTO t1(a) VALUES(0); +DELETE FROM t1 WHERE c=1; +DROP TABLE t1; +CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar"))' at line 1 +CREATE TABLE t1 (i INT); +ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar")' at line 1 +DROP TABLE t1; +CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS (10))' at line 1 +# Check for a charset mismatch processing: +# Bug #21469535: VALGRIND ERROR (CONDITIONAL JUMP) WHEN INSERT +# ROWS INTO A PARTITIONED TABLE +# +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +INSERT INTO t1 VALUES(1, 2, default); +DROP TABLE t1; +# Bug#21465626:ASSERT/CRASH ON DROPPING/ADDING VIRTUAL COLUMN +CREATE TABLE t (a int(11), b int(11), +c int(11) GENERATED ALWAYS AS (a+b) VIRTUAL, +d int(11) GENERATED ALWAYS AS (a+b) VIRTUAL); +INSERT INTO t(a,b) VALUES(1,2); +# Mixed drop/add/rename virtual with non-virtual columns, +# ALGORITHM=INPLACE is not supported for InnoDB +ALTER TABLE t DROP d, ADD e varchar(10); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD d int, ADD f char(10) AS ('aaa'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE d dd int, CHANGE f ff varchar(10) AS ('bbb'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Only drop/add/change virtual, inplace is supported for Innodb +ALTER TABLE t DROP c, DROP ff; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD c int(11) as (a+b), ADD f varchar(10) as ('aaa'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE c c int(11) as (a), CHANGE f f varchar(10) as('bbb'); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +# Change order should be ALGORITHM=INPLACE on Innodb +ALTER TABLE t CHANGE c c int(11) as (a) after f; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t CHANGE b b int(11) after c; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# TODO: Changing virtual column type should be ALGORITHM=INPLACE on InnoDB, current it goes only with COPY method +ALTER TABLE t CHANGE c c varchar(10) as ('a'); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Changing stored column type is ALGORITHM=COPY +ALTER TABLE t CHANGE dd d varchar(10); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t; +# Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF +CREATE TABLE t1( +col1 INTEGER PRIMARY KEY, +col2 INTEGER, +col3 INTEGER, +col4 INTEGER, +vgc1 INTEGER AS (col2 + col3) VIRTUAL, +sgc1 INTEGER AS (col2 - col3) STORED +); +INSERT INTO t1(col1, col2, col3) VALUES +(1, 10, 100), (2, 20, 200); +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 110 -90 +2 20 200 NULL 220 -180 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 0 +2 20 200 NULL 4000 0 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 110 0 +2 20 200 NULL 220 0 +SELECT sgc1 FROM t1 order by sgc1; +sgc1 +0 +0 +ALTER TABLE t1 DROP INDEX sgc1; +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; +ERROR 23000: Duplicate entry '0' for key 'sgc1' +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +SELECT vgc1 FROM t1 order by col1; +vgc1 +1000 +4000 +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 * col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 1000 +2 20 200 NULL 4000 4000 +SELECT sgc1 FROM t1 order by sgc1; +sgc1 +1000 +4000 +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; +ERROR HY000: This is not yet supported for computed columns +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; +ERROR HY000: This is not yet supported for computed columns +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER AS (col1 + col2 + col3) STORED; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 111 1000 1000 +2 20 200 222 4000 4000 +ALTER TABLE t1 MODIFY COLUMN col4 INTEGER; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 111 1000 1000 +2 20 200 222 4000 4000 +DROP TABLE t1; +# +# Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE +# ALLOWED IN GENERATED COLUMNS +# +# Test 1: ALTER DEFAULT +# +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, +b INT AS (1 + DEFAULT(a)) STORED, +c INT AS (1 + DEFAULT(a)) VIRTUAL); +INSERT INTO t1 VALUES (); +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +# Test 2: ALTER DEFAULT + ADD GCOL +# +CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5); +INSERT INTO t1 VALUES(); +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN b1 INT AS (1 + DEFAULT(a)) STORED; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN c1 INT AS (1 + DEFAULT(a)) VIRTUAL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, +ADD COLUMN b INT AS (1 + DEFAULT(a)) STORED, +ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_csv.result b/mysql-test/suite/gcol/r/gcol_csv.result new file mode 100644 index 00000000000..20708586d51 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_csv.result @@ -0,0 +1,14 @@ +SET @@session.storage_engine = 'CSV'; +create table t1 (a int, b virtual int as (a+1)); +ERROR HY000: 'Specified storage engine' is not yet supported for generated columns. +create table t1 (a int not null); +alter table t1 add column b virtual int as (a+1); +ERROR HY000: 'Specified storage engine' is not yet supported for generated columns. +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_falcon.result b/mysql-test/suite/gcol/r/gcol_falcon.result new file mode 100644 index 00000000000..2eb558e6b69 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_falcon.result @@ -0,0 +1,14 @@ +SET @@session.storage_engine = 'falcon'; +create table t1 (a int, b virtual int as (a+1)); +ERROR HY000: 'Specified storage engine' is not yet supported for generated columns. +create table t1 (a int); +alter table t1 add column b virtual int as (a+1); +ERROR HY000: 'Specified storage engine' is not yet supported for generated columns. +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_handler_innodb.result b/mysql-test/suite/gcol/r/gcol_handler_innodb.result new file mode 100644 index 00000000000..6de4c2ae61d --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_handler_innodb.result @@ -0,0 +1,83 @@ +SET @@session.default_storage_engine = 'InnoDB'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +d char(1), +index (a), +index (c)); +insert into t1 (a,d) values (4,'a'), (2,'b'), (1,'c'), (3,'d'); +select * from t1; +a b c d +4 -4 -4 a +2 -2 -2 b +1 -1 -1 c +3 -3 -3 d +# HANDLER tbl_name OPEN +handler t1 open; +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) +handler t1 read a > (2); +a b c d +3 -3 -3 d +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read a > (2) where d='c'; +a b c d +# HANDLER tbl_name READ gcol_index_name = (value1,value2,...) +handler t1 read c = (-2); +a b c d +2 -2 -2 b +# HANDLER tbl_name READ gcol_index_name = (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read c = (-2) where d='c'; +a b c d +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read a > (2) where b=-3 && c=-3; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name <= (value1,value2,...) +handler t1 read c <= (-2); +a b c d +2 -2 -2 b +# HANDLER tbl_name READ gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read c <= (-2) where b=-3; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name FIRST +handler t1 read c first; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ gcol_index_name NEXT +handler t1 read c next; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name PREV +handler t1 read c prev; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ gcol_index_name LAST +handler t1 read c last; +a b c d +1 -1 -1 c +# HANDLER tbl_name READ FIRST where non-gcol=expr +handler t1 read FIRST where a >= 2; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ FIRST where gcol=expr +handler t1 read FIRST where b >= -2; +a b c d +2 -2 -2 b +# HANDLER tbl_name READ NEXT where non-gcol=expr +handler t1 read NEXT where d='c'; +a b c d +1 -1 -1 c +# HANDLER tbl_name READ NEXT where gcol=expr +handler t1 read NEXT where b<=-4; +a b c d +# HANDLER tbl_name CLOSE +handler t1 close; +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_handler_myisam.result b/mysql-test/suite/gcol/r/gcol_handler_myisam.result new file mode 100644 index 00000000000..3b03fd37cc0 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_handler_myisam.result @@ -0,0 +1,83 @@ +SET @@session.default_storage_engine = 'MyISAM'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +d char(1), +index (a), +index (c)); +insert into t1 (a,d) values (4,'a'), (2,'b'), (1,'c'), (3,'d'); +select * from t1; +a b c d +4 -4 -4 a +2 -2 -2 b +1 -1 -1 c +3 -3 -3 d +# HANDLER tbl_name OPEN +handler t1 open; +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) +handler t1 read a > (2); +a b c d +3 -3 -3 d +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read a > (2) where d='c'; +a b c d +# HANDLER tbl_name READ gcol_index_name = (value1,value2,...) +handler t1 read c = (-2); +a b c d +2 -2 -2 b +# HANDLER tbl_name READ gcol_index_name = (value1,value2,...) WHERE non-gcol_field=expr +handler t1 read c = (-2) where d='c'; +a b c d +# HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read a > (2) where b=-3 && c=-3; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name <= (value1,value2,...) +handler t1 read c <= (-2); +a b c d +2 -2 -2 b +# HANDLER tbl_name READ gcol_index_name > (value1,value2,...) WHERE gcol_field=expr +handler t1 read c <= (-2) where b=-3; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name FIRST +handler t1 read c first; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ gcol_index_name NEXT +handler t1 read c next; +a b c d +3 -3 -3 d +# HANDLER tbl_name READ gcol_index_name PREV +handler t1 read c prev; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ gcol_index_name LAST +handler t1 read c last; +a b c d +1 -1 -1 c +# HANDLER tbl_name READ FIRST where non-gcol=expr +handler t1 read FIRST where a >= 2; +a b c d +4 -4 -4 a +# HANDLER tbl_name READ FIRST where gcol=expr +handler t1 read FIRST where b >= -2; +a b c d +2 -2 -2 b +# HANDLER tbl_name READ NEXT where non-gcol=expr +handler t1 read NEXT where d='c'; +a b c d +1 -1 -1 c +# HANDLER tbl_name READ NEXT where gcol=expr +handler t1 read NEXT where b<=-4; +a b c d +# HANDLER tbl_name CLOSE +handler t1 close; +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result new file mode 100644 index 00000000000..924b8b8d7d9 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result @@ -0,0 +1,602 @@ +SET @@session.default_storage_engine = 'InnoDB'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +set sql_warnings = 1; +# +# *** INSERT *** +# +# INSERT INTO tbl_name VALUES... DEFAULT is specified against gcols +insert into t1 values (1,default,default); +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name VALUES... NULL is specified against gcols +insert into t1 values (1,null,null); +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols +insert into t1 values (1,2,3); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... DEFAULT is specified +# against gcols +insert into t1 (a,b) values (1,default), (2,default); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... NULL is specified against gcols +insert into t1 (a,b) values (1,null), (2,null); +select * from t1; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... a non-NULL value is specified +# against gcols +insert into t1 (a,b) values (1,3), (2,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +select * from t1; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +drop table t1; +# Table with UNIQUE non-gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +# KEY UPDATE =expr, =expr +create table t1 (a int unique, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) +on duplicate key update a=2, b=default; +select a,b,c from t1; +a b c +2 -2 -2 +delete from t1 where b in (1,2); +select * from t1; +a b c +2 -2 -2 +drop table t1; +# Table with UNIQUE gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +# KEY UPDATE =expr, =expr +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) +on duplicate key update a=2, b=default; +select a,b,c from t1; +a b c +2 -2 -2 +# CREATE new_table ... LIKE old_table +# INSERT INTO new_table SELECT * from old_table +create table t2 like t1; +insert into t2(a) select a from t1; +select * from t2; +a b c +2 -2 -2 +drop table t2; +# CREATE new_table ... LIKE old_table INSERT INTO new_table (, ) +# SELECT , from old_table +insert into t1 values (1,default,default); +select * from t1; +a b c +2 -2 -2 +1 -1 -1 +create table t2 like t1; +insert into t2 (a) select a from t1; +select * from t2 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t2; +drop table t1; +# +# *** UPDATE *** +# +# UPDATE tbl_name SET non-gcol=expr WHERE non-gcol=expr +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where a=2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET gcol=expr WHERE non-gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set c=3 where a=2; +Warnings: +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where b=-2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set c=3 where b=-2; +Warnings: +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +drop table t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=const +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where c=-2; +select * from t1; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where c between -3 and -2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# No INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where b between -3 and -2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE gcol=between const1 and const2 ORDER BY gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where c between -1 and 0 +order by c; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1 where c between -6 and 0; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE gcol=between const1 and const2 ORDER BY gcol LIMIT 2 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where c between -1 and 0 +order by c limit 2; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1 where c between -2 and 0 order by c; +select * from t1 order by a; +a b c +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where (c between -2 and 0) and (b=-1); +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +# ORDER BY indexed gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where (c between -2 and 0) and (b=-1) order by c; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +drop table t1; +# +# Verify ON UPDATE/DELETE actions of FOREIGN KEYs +create table t2 (a int primary key, name varchar(10)); +create table t1 (a int primary key, b int generated always as (a % 10) stored); +insert into t2 values (1, 'value1'), (2,'value2'), (3,'value3'); +insert into t1 (a) values (1),(2),(3); +select * from t1 order by a; +a b +1 1 +2 2 +3 3 +select * from t2 order by a; +a name +1 value1 +2 value2 +3 value3 +select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a order by t1.a; +a b name +1 1 value1 +2 2 value2 +3 3 value3 +# - ON UPDATE RESTRICT +alter table t1 add foreign key (b) references t2(a) on update restrict; +insert into t1 (a) values (4); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t2` (`a`)) +update t2 set a=4 where a=3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t2` (`a`)) +select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; +a b name +1 1 value1 +2 2 value2 +3 3 value3 +alter table t1 drop foreign key t1_ibfk_1; +# - ON DELETE RESTRICT +alter table t1 add foreign key (b) references t2(a) on delete restrict; +delete from t2 where a=3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t2` (`a`)) +select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; +a b name +1 1 value1 +2 2 value2 +3 3 value3 +select t1.a, t1.b, t2.name from t1 left outer join t2 on (t1.b=t2.a); +a b name +1 1 value1 +2 2 value2 +3 3 value3 +alter table t1 drop foreign key t1_ibfk_1; +# - ON DELETE CASCADE +alter table t1 add foreign key (b) references t2(a) on delete cascade; +delete from t2 where a=3; +select t1.a, t1.b, t2.name from t1,t2 where t1.b=t2.a; +a b name +1 1 value1 +2 2 value2 +select t1.a, t1.b, t2.name from t1 left outer join t2 on (t1.b=t2.a); +a b name +1 1 value1 +2 2 value2 +alter table t1 drop foreign key t1_ibfk_1; +drop table t1; +drop table t2; +# +# *** REPLACE *** +# +# UNIQUE INDEX on gcol +# REPLACE tbl_name (non-gcols) VALUES (non-gcols); +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique, +d varchar(16)); +insert into t1 (a,d) values (1,'a'), (2,'b'); +select * from t1 order by a; +a b c d +1 -1 -1 a +2 -2 -2 b +replace t1 (a,d) values (1,'c'); +select * from t1 order by a; +a b c d +1 -1 -1 c +2 -2 -2 b +delete from t1; +select * from t1; +a b c d +set sql_warnings = 0; +drop table t1; +Bug#20170778: WL411:FAILING ASSERTION `!TABLE || (!TABLE->WRITE_SET || +BITMAP_IS_SET(TABLE->WR +# +CREATE TABLE t1 (col1 INT, col2 INT, col3 INT, col4 INT, col5 +INT GENERATED ALWAYS AS (col3 * col2) VIRTUAL, col6 INT GENERATED ALWAYS AS +(col4 * col1) STORED, col7 INT GENERATED ALWAYS AS (col6 + col6) VIRTUAL, +col8 INT GENERATED ALWAYS AS (col6 / col5) STORED, col9 TEXT); +SET @fill_amount = (@@innodb_page_size / 2 ) + 1; +INSERT INTO t1 (col1,col2,col3,col4,col5,col6,col7,col8,col9) VALUES /* 3 */ +(3, 3 / 3, 3 + 3, 3 / 3, DEFAULT, DEFAULT, DEFAULT, DEFAULT ,REPEAT(CAST(3 AS +CHAR(1)),@fill_amount)) , (3, 3 * 3, 3 + 3, 3 / 3, DEFAULT, DEFAULT, DEFAULT, +DEFAULT ,REPEAT(CAST(3 AS CHAR(1)),@fill_amount)); +UPDATE t1 SET col1 = 2; +UPDATE t1 SET col7 = DEFAULT; +UPDATE t1 SET col8 = DEFAULT; +DROP TABLE t1; +# Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET || +# BITMAP_IS_SET(TABLE->WRITE_SET +# +CREATE TABLE b ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT INTO b (col_varchar_nokey) VALUES ('v'),('v'); +CREATE TABLE d ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +) ; +INSERT INTO d (col_varchar_nokey) VALUES ('q'),('g'),('e'),('l'),(NULL),('v'),('c'),('u'),('x'); +CREATE TABLE bb ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT INTO bb (col_varchar_nokey) VALUES ('j'),('h'); +EXPLAIN UPDATE +d AS OUTR1, b AS OUTR2 +SET OUTR1.col_varchar_nokey = NULL +WHERE +( 't', 'b' ) IN +( +SELECT +INNR1.col_varchar_nokey AS x, +INNR1.col_varchar_key AS y +FROM bb AS INNR1 +WHERE OUTR1.pk = 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY OUTR1 const PRIMARY PRIMARY 4 const 1 +1 PRIMARY INNR1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(OUTR1) +1 PRIMARY OUTR2 index NULL PRIMARY 4 NULL 2 Using index +DROP TABLE IF EXISTS b,bb,d; +# +# Bug#21216067 ASSERTION FAILED ROW_UPD_SEC_INDEX_ENTRY (INNOBASE/ROW/ROW0UPD.CC:2103) +# +CREATE TABLE t ( +x INT, y INT, gc INT GENERATED ALWAYS AS (x+1) STORED +); +INSERT INTO t VALUES (); +UPDATE t t1, t t2 SET t2.y = 1, t1.x = 2; +SELECT * FROM t; +x y gc +2 1 3 +DROP TABLE t; +# stored +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 ALL NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 ALL NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +# stored, indexed +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, +KEY (col_varchar_key, col_varchar_nokey) +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 ALL NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 ALL NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +# virtual +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 ALL NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 ALL NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +#Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE +CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL, +c2 INT GENERATED ALWAYS AS(2) STORED); +INSERT INTO t VALUES(DEFAULT, DEFAULT); +SELECT * FROM t; +c1 c2 +1 2 +CREATE TABLE t1(c1 INT, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t1(c2) VALUES(DEFAULT); +SELECT * FROM t1; +c1 c2 +NULL NULL +CREATE TABLE t2(c1 INT DEFAULT 1, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t2(c2) VALUES(DEFAULT); +SELECT * FROM t2; +c1 c2 +1 2 +DROP TABLE t, t1, t2; +# Bug#22179637: INSERT INTO TABLE FROM SELECT ACCEPTS TO INSERT INTO +# GENERATED COLUMNS +CREATE TABLE t1 ( +i1 INTEGER, +i2 INTEGER GENERATED ALWAYS AS (i1 + i1) +); +INSERT INTO t1 (i1) SELECT 5; +INSERT INTO t1 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t1; +i1 i2 +5 10 +5 10 +CREATE TABLE t2 ( +i1 INTEGER, +i2 INTEGER GENERATED ALWAYS AS (i1 + i1) STORED +); +INSERT INTO t2 (i1) SELECT 5; +INSERT INTO t2 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t2; +i1 i2 +5 10 +5 10 +DROP TABLE t1,t2; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result new file mode 100644 index 00000000000..a7db5508384 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result @@ -0,0 +1,524 @@ +SET @@session.default_storage_engine = 'MyISAM'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +set sql_warnings = 1; +# +# *** INSERT *** +# +# INSERT INTO tbl_name VALUES... DEFAULT is specified against gcols +insert into t1 values (1,default,default); +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name VALUES... NULL is specified against gcols +insert into t1 values (1,null,null); +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols +insert into t1 values (1,2,3); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1; +a b c +1 -1 -1 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... DEFAULT is specified +# against gcols +insert into t1 (a,b) values (1,default), (2,default); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... NULL is specified against gcols +insert into t1 (a,b) values (1,null), (2,null); +select * from t1; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# INSERT INTO tbl_name () VALUES... a non-NULL value is specified +# against gcols +insert into t1 (a,b) values (1,3), (2,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +select * from t1; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +drop table t1; +# Table with UNIQUE non-gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +# KEY UPDATE =expr, =expr +create table t1 (a int unique, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) +on duplicate key update a=2, b=default; +select a,b,c from t1; +a b c +2 -2 -2 +delete from t1 where b in (1,2); +select * from t1; +a b c +2 -2 -2 +drop table t1; +# Table with UNIQUE gcol field. INSERT INTO tbl_name VALUES... ON DUPLICATE +# KEY UPDATE =expr, =expr +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t1 values (1,default,default); +insert into t1 values (1,default,default) +on duplicate key update a=2, b=default; +select a,b,c from t1; +a b c +2 -2 -2 +# CREATE new_table ... LIKE old_table +# INSERT INTO new_table SELECT * from old_table +create table t2 like t1; +insert into t2(a) select a from t1; +select * from t2; +a b c +2 -2 -2 +drop table t2; +# CREATE new_table ... LIKE old_table INSERT INTO new_table (, ) +# SELECT , from old_table +insert into t1 values (1,default,default); +select * from t1; +a b c +2 -2 -2 +1 -1 -1 +create table t2 like t1; +insert into t2 (a) select a from t1; +select * from t2 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t2; +drop table t1; +# +# *** UPDATE *** +# +# UPDATE tbl_name SET non-gcol=expr WHERE non-gcol=expr +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where a=2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET gcol=expr WHERE non-gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set c=3 where a=2; +Warnings: +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where b=-2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# UPDATE tbl_name SET gcol=expr WHERE gcol=expr +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set c=3 where b=-2; +Warnings: +Warning 1906 The value specified for computed column 'c' in table 't1' ignored +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +delete from t1; +select * from t1; +a b c +drop table t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=const +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where c=-2; +select * from t1; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where c between -3 and -2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# No INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2 +insert into t1 (a) values (1), (2); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +update t1 set a=3 where b between -3 and -2; +select * from t1 order by a; +a b c +1 -1 -1 +3 -3 -3 +delete from t1; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE gcol=between const1 and const2 ORDER BY gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where c between -1 and 0 +order by c; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1 where c between -6 and 0; +select * from t1; +a b c +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE gcol=between const1 and const2 ORDER BY gcol LIMIT 2 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where c between -1 and 0 +order by c limit 2; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1 where c between -2 and 0 order by c; +select * from t1 order by a; +a b c +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where (c between -2 and 0) and (b=-1); +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +# INDEX created on gcol +# UPDATE tbl_name SET non-gcol=expr +# WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3 +# ORDER BY indexed gcol +insert into t1 (a) values (1), (2), (3), (4), (5); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +update t1 set a=6 where (c between -2 and 0) and (b=-1) order by c; +select * from t1 order by a; +a b c +2 -2 -2 +3 -3 -3 +4 -4 -4 +5 -5 -5 +6 -6 -6 +delete from t1; +drop table t1; +# +# *** REPLACE *** +# +# UNIQUE INDEX on gcol +# REPLACE tbl_name (non-gcols) VALUES (non-gcols); +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique, +d varchar(16)); +insert into t1 (a,d) values (1,'a'), (2,'b'); +select * from t1 order by a; +a b c d +1 -1 -1 a +2 -2 -2 b +replace t1 (a,d) values (1,'c'); +select * from t1 order by a; +a b c d +1 -1 -1 c +2 -2 -2 b +delete from t1; +select * from t1; +a b c d +set sql_warnings = 0; +drop table t1; +# Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET || +# BITMAP_IS_SET(TABLE->WRITE_SET +# +CREATE TABLE b ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT INTO b (col_varchar_nokey) VALUES ('v'),('v'); +CREATE TABLE d ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +) ; +INSERT INTO d (col_varchar_nokey) VALUES ('q'),('g'),('e'),('l'),(NULL),('v'),('c'),('u'),('x'); +CREATE TABLE bb ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT INTO bb (col_varchar_nokey) VALUES ('j'),('h'); +EXPLAIN UPDATE +d AS OUTR1, b AS OUTR2 +SET OUTR1.col_varchar_nokey = NULL +WHERE +( 't', 'b' ) IN +( +SELECT +INNR1.col_varchar_nokey AS x, +INNR1.col_varchar_key AS y +FROM bb AS INNR1 +WHERE OUTR1.pk = 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY OUTR1 const PRIMARY PRIMARY 4 const 1 +1 PRIMARY INNR1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(OUTR1) +1 PRIMARY OUTR2 index NULL PRIMARY 4 NULL 2 Using index +DROP TABLE IF EXISTS b,bb,d; +# +# Bug#21216067 ASSERTION FAILED ROW_UPD_SEC_INDEX_ENTRY (INNOBASE/ROW/ROW0UPD.CC:2103) +# +CREATE TABLE t ( +x INT, y INT, gc INT GENERATED ALWAYS AS (x+1) STORED +); +INSERT INTO t VALUES (); +UPDATE t t1, t t2 SET t2.y = 1, t1.x = 2; +SELECT * FROM t; +x y gc +2 1 3 +DROP TABLE t; +# stored +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 system NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 system NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +# stored, indexed +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, +KEY (col_varchar_key, col_varchar_nokey) +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 system NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 system NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +# virtual +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 system NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 system NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +#Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE +CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL, +c2 INT GENERATED ALWAYS AS(2) STORED); +INSERT INTO t VALUES(DEFAULT, DEFAULT); +SELECT * FROM t; +c1 c2 +1 2 +CREATE TABLE t1(c1 INT, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t1(c2) VALUES(DEFAULT); +SELECT * FROM t1; +c1 c2 +NULL NULL +CREATE TABLE t2(c1 INT DEFAULT 1, c2 INT GENERATED ALWAYS AS(c1 + 1) STORED); +INSERT INTO t2(c2) VALUES(DEFAULT); +SELECT * FROM t2; +c1 c2 +1 2 +DROP TABLE t, t1, t2; +# Bug#22179637: INSERT INTO TABLE FROM SELECT ACCEPTS TO INSERT INTO +# GENERATED COLUMNS +CREATE TABLE t1 ( +i1 INTEGER, +i2 INTEGER GENERATED ALWAYS AS (i1 + i1) +); +INSERT INTO t1 (i1) SELECT 5; +INSERT INTO t1 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t1; +i1 i2 +5 10 +5 10 +CREATE TABLE t2 ( +i1 INTEGER, +i2 INTEGER GENERATED ALWAYS AS (i1 + i1) STORED +); +INSERT INTO t2 (i1) SELECT 5; +INSERT INTO t2 (i1) SELECT 5 ON DUPLICATE KEY UPDATE i2= DEFAULT; +SELECT * FROM t2; +i1 i2 +5 10 +5 10 +DROP TABLE t1,t2; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result new file mode 100644 index 00000000000..ff3e7970f29 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -0,0 +1,421 @@ +SET @@session.default_storage_engine = 'InnoDB'; +# - UNIQUE KEY +# - INDEX +# - FULLTEXT INDEX +# - SPATIAL INDEX (not supported) +# - FOREIGN INDEX (partially supported) +# - CHECK (allowed but not used) +# UNIQUE +create table t1 (a int, b int generated always as (a*2) stored unique); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + UNIQUE KEY `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored, unique (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + UNIQUE KEY `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add unique key (b); +drop table t1; +# Testing data manipulation operations involving UNIQUE keys +# on generated columns can be found in: +# - gcol_ins_upd.inc +# - gcol_select.inc +# +# INDEX +create table t1 (a int, b int generated always as (a*2) stored, index (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + KEY `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES MUL NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored, index (a,b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + KEY `a` (`a`,`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES MUL NULL +b int(11) YES NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (b); +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (a,b); +create table t2 like t1; +drop table t2; +drop table t1; +# Testing data manipulation operations involving INDEX +# on generated columns can be found in: +# - gcol_select.inc +# +# TODO: FULLTEXT INDEX +# SPATIAL INDEX +# FOREIGN KEY +# Rejected FK options. +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on update set null); +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on update cascade); +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on delete set null); +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored); +alter table t1 add foreign key (b) references t2(a) on update set null; +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +alter table t1 add foreign key (b) references t2(a) on update cascade; +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +alter table t1 add foreign key (b) references t2(a) on delete set null; +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +drop table t1; +# Allowed FK options. +create table t2 (a int primary key, b char(5)); +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on update restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on update no action); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete cascade); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete no action); +drop table t1,t2; + +# Testing data manipulation operations involving FOREIGN KEY +# on generated columns can be found in: +# - gcol_ins_upd.inc +# - gcol_select.inc +# +# TODO: CHECK +# +# Test how optimizer picks indexes defined on a GC +# +CREATE TABLE t1 (f1 int, gc int AS (f1 + 1) STORED, UNIQUE(gc)); +INSERT INTO t1(f1) VALUES (1),(2),(0),(9),(3),(4),(8),(7),(5),(6); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# Should use index +SELECT * FROM t1 WHERE f1 + 1 > 7; +f1 gc +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 = 7; +f1 gc +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 = 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 IN (7,5); +f1 gc +4 5 +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 IN(7,5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; +f1 gc +4 5 +5 6 +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +# Check that expression isn't transformed for a disabled key +SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; +f1 gc +4 5 +5 6 +6 7 +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +# Check that ORDER BY could be optimized +SELECT * FROM t1 ORDER BY f1 + 1; +f1 gc +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 ORDER BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using filesort +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) ORDER BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using filesort +# Check that GROUP BY could be optimized +SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +f1 + 1 MAX(GC) +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +EXPLAIN SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +EXPLAIN SELECT f1 + 1, MAX(GC) +FROM t1 IGNORE KEY (gc) GROUP BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +# Shouldn't use index +SELECT * FROM t1 WHERE f1 + 1 > 7.0; +f1 gc +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7.0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +DROP TABLE t1; +# Pick index with proper type +CREATE TABLE t1 (f1 int, +gc_int int AS (f1 + 1) STORED, +gc_date DATE AS (f1 + 1) STORED, +KEY gc_int_idx(gc_int), +KEY gc_date_idx(gc_date)); +INSERT INTO t1(f1) VALUES +(030303),(040404), +(050505),(060606), +(010101),(020202), +(030303),(040404), +(050505),(060606), +(010101),(020202), +(090909),(101010), +(010101),(020202), +(070707),(080808); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT * FROM t1 WHERE f1 + 1 > 070707; +f1 gc_int gc_date +101010 101011 2010-10-11 +70707 70708 2007-07-08 +80808 80809 2008-08-09 +90909 90910 2009-09-10 +# INT column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 070707; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where +SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); +f1 gc_int gc_date +101010 101011 2010-10-11 +70707 70708 2007-07-08 +80808 80809 2008-08-09 +90909 90910 2009-09-10 +# DATE column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where +DROP TABLE t1; +# +# BUG#21229846: WL8170: SIGNAL 11 IN JOIN::MAKE_SUM_FUNC_LIST +# +CREATE TABLE t1 ( +pk int primary key auto_increment, +col_int_key INTEGER , +col_int_gc_key INT GENERATED ALWAYS AS (col_int_key + 1) STORED, +KEY col_int_gc_key(col_int_gc_key) +); +INSERT INTO t1 ( col_int_key) VALUES (7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +ORDER BY field1, field2; +field1 field2 +8 7 +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +ORDER BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE table1 ALL PRIMARY NULL NULL NULL 1 Using temporary; Using filesort +1 SIMPLE table2 eq_ref PRIMARY PRIMARY 4 test.table1.pk 1 +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +GROUP BY field1, field2; +field1 field2 +8 7 +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +GROUP BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE table1 ALL PRIMARY NULL NULL NULL 1 Using temporary; Using filesort +1 SIMPLE table2 eq_ref PRIMARY PRIMARY 4 test.table1.pk 1 +DROP TABLE t1; +# +# Bug#21770798 OPTIMIZER DOES NOT USE INDEX FOR GENERATED EXPRESSIONS +# WITH LOGICAL OPERATORS +# +CREATE TABLE t (a INT, b INT, +gc_and INT GENERATED ALWAYS AS (a AND b) STORED, +gc_or INT GENERATED ALWAYS AS (a OR b) STORED, +gc_xor INT GENERATED ALWAYS AS (a XOR b) STORED, +gc_not INT GENERATED ALWAYS AS (NOT a) STORED, +gc_case INT GENERATED ALWAYS AS +(CASE WHEN (a AND b) THEN a ELSE b END) STORED, +INDEX(gc_and), INDEX(gc_or), INDEX(gc_xor), INDEX(gc_not), +INDEX(gc_case)); +INSERT INTO t (a, b) VALUES (0, 0), (0, 1), (1, 0), (1, 1); +ANALYZE TABLE t; +Table Op Msg_type Msg_text +test.t analyze status OK +EXPLAIN SELECT a, b FROM t WHERE (a AND b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a AND b) = 1; +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (a AND b); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (a AND b); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a OR b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a OR b) = 1; +a b +0 1 +1 0 +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +a b +0 1 +1 0 +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a XOR b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a XOR b) = 1; +a b +0 1 +1 0 +EXPLAIN SELECT a FROM t WHERE (NOT a) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a FROM t WHERE (NOT a) = 1; +a +0 +0 +EXPLAIN SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +a +0 +1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (b AND a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (b AND a); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (b OR a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (b OR a); +a b +0 1 +1 0 +1 1 +DROP TABLE t; +# +# Bug#22810883: ASSERTION FAILED: +# !(USED_TABS & (~READ_TABLES & ~FILTER_FOR_TABLE)) +# +CREATE TABLE t1 (a1 INTEGER GENERATED ALWAYS AS (1 AND 0) STORED, +a2 INTEGER, KEY (a1)); +INSERT INTO t1 VALUES (); +CREATE TABLE t2 (b INTEGER); +INSERT INTO t2 VALUES (1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +# Used to choose the index on a1 and get wrong results. +EXPLAIN SELECT * FROM t1 WHERE (a2 AND a2) = 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where +SELECT * FROM t1 WHERE (a2 AND a2) = 0; +a1 a2 +# Used to get assertion or wrong results. +EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 ON b WHERE (b AND b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 1 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join) +SELECT * FROM t1 STRAIGHT_JOIN t2 ON b WHERE (b AND b) = 1; +a1 a2 b +0 NULL 1 +DROP TABLE t1, t2; +# +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result new file mode 100644 index 00000000000..f6a4ffe6c60 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -0,0 +1,421 @@ +SET @@session.default_storage_engine = 'MyISAM'; +# - UNIQUE KEY +# - INDEX +# - FULLTEXT INDEX +# - SPATIAL INDEX (not supported) +# - FOREIGN INDEX (partially supported) +# - CHECK (allowed but not used) +# UNIQUE +create table t1 (a int, b int generated always as (a*2) stored unique); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored, unique (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add unique key (b); +drop table t1; +# Testing data manipulation operations involving UNIQUE keys +# on generated columns can be found in: +# - gcol_ins_upd.inc +# - gcol_select.inc +# +# INDEX +create table t1 (a int, b int generated always as (a*2) stored, index (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES MUL NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored, index (a,b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) PERSISTENT, + KEY `a` (`a`,`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES MUL NULL +b int(11) YES NULL PERSISTENT +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (b); +drop table t1; +create table t1 (a int, b int generated always as (a*2) stored); +alter table t1 add index (a,b); +create table t2 like t1; +drop table t2; +drop table t1; +# Testing data manipulation operations involving INDEX +# on generated columns can be found in: +# - gcol_select.inc +# +# TODO: FULLTEXT INDEX +# SPATIAL INDEX +# FOREIGN KEY +# Rejected FK options. +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on update set null); +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on update cascade); +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored, +foreign key (b) references t2(a) on delete set null); +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +create table t1 (a int, b int generated always as (a+1) stored); +alter table t1 add foreign key (b) references t2(a) on update set null; +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +alter table t1 add foreign key (b) references t2(a) on update cascade; +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +alter table t1 add foreign key (b) references t2(a) on delete set null; +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +drop table t1; +# Allowed FK options. +create table t2 (a int primary key, b char(5)); +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on update restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on update no action); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete restrict); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete cascade); +drop table t1; +create table t1 (a int, b int generated always as (a % 10) stored, +foreign key (b) references t2(a) on delete no action); +drop table t1,t2; + +# Testing data manipulation operations involving FOREIGN KEY +# on generated columns can be found in: +# - gcol_ins_upd.inc +# - gcol_select.inc +# +# TODO: CHECK +# +# Test how optimizer picks indexes defined on a GC +# +CREATE TABLE t1 (f1 int, gc int AS (f1 + 1) STORED, UNIQUE(gc)); +INSERT INTO t1(f1) VALUES (1),(2),(0),(9),(3),(4),(8),(7),(5),(6); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# Should use index +SELECT * FROM t1 WHERE f1 + 1 > 7; +f1 gc +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 = 7; +f1 gc +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 = 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 IN (7,5); +f1 gc +4 5 +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 IN(7,5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; +f1 gc +4 5 +5 6 +6 7 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 BETWEEN 5 AND 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +# Check that expression isn't transformed for a disabled key +SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; +f1 gc +4 5 +5 6 +6 7 +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) WHERE f1 + 1 BETWEEN 5 AND 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +# Check that ORDER BY could be optimized +SELECT * FROM t1 ORDER BY f1 + 1; +f1 gc +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 ORDER BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using filesort +EXPLAIN SELECT * FROM t1 IGNORE KEY (gc) ORDER BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using filesort +# Check that GROUP BY could be optimized +SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +f1 + 1 MAX(GC) +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +EXPLAIN SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +EXPLAIN SELECT f1 + 1, MAX(GC) +FROM t1 IGNORE KEY (gc) GROUP BY f1 + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +# Shouldn't use index +SELECT * FROM t1 WHERE f1 + 1 > 7.0; +f1 gc +7 8 +8 9 +9 10 +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 7.0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where +DROP TABLE t1; +# Pick index with proper type +CREATE TABLE t1 (f1 int, +gc_int int AS (f1 + 1) STORED, +gc_date DATE AS (f1 + 1) STORED, +KEY gc_int_idx(gc_int), +KEY gc_date_idx(gc_date)); +INSERT INTO t1(f1) VALUES +(030303),(040404), +(050505),(060606), +(010101),(020202), +(030303),(040404), +(050505),(060606), +(010101),(020202), +(090909),(101010), +(010101),(020202), +(070707),(080808); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT * FROM t1 WHERE f1 + 1 > 070707; +f1 gc_int gc_date +101010 101011 2010-10-11 +70707 70708 2007-07-08 +80808 80809 2008-08-09 +90909 90910 2009-09-10 +# INT column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > 070707; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where +SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); +f1 gc_int gc_date +101010 101011 2010-10-11 +70707 70708 2007-07-08 +80808 80809 2008-08-09 +90909 90910 2009-09-10 +# DATE column & index should be picked +EXPLAIN SELECT * FROM t1 WHERE f1 + 1 > CAST(070707 AS DATE); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 18 Using where +DROP TABLE t1; +# +# BUG#21229846: WL8170: SIGNAL 11 IN JOIN::MAKE_SUM_FUNC_LIST +# +CREATE TABLE t1 ( +pk int primary key auto_increment, +col_int_key INTEGER , +col_int_gc_key INT GENERATED ALWAYS AS (col_int_key + 1) STORED, +KEY col_int_gc_key(col_int_gc_key) +); +INSERT INTO t1 ( col_int_key) VALUES (7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +ORDER BY field1, field2; +field1 field2 +8 7 +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +ORDER BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE table1 system PRIMARY NULL NULL NULL 1 +1 SIMPLE table2 system PRIMARY NULL NULL NULL 1 +SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +GROUP BY field1, field2; +field1 field2 +8 7 +EXPLAIN SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2 +FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk)) +GROUP BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE table1 system PRIMARY NULL NULL NULL 1 +1 SIMPLE table2 system PRIMARY NULL NULL NULL 1 +DROP TABLE t1; +# +# Bug#21770798 OPTIMIZER DOES NOT USE INDEX FOR GENERATED EXPRESSIONS +# WITH LOGICAL OPERATORS +# +CREATE TABLE t (a INT, b INT, +gc_and INT GENERATED ALWAYS AS (a AND b) STORED, +gc_or INT GENERATED ALWAYS AS (a OR b) STORED, +gc_xor INT GENERATED ALWAYS AS (a XOR b) STORED, +gc_not INT GENERATED ALWAYS AS (NOT a) STORED, +gc_case INT GENERATED ALWAYS AS +(CASE WHEN (a AND b) THEN a ELSE b END) STORED, +INDEX(gc_and), INDEX(gc_or), INDEX(gc_xor), INDEX(gc_not), +INDEX(gc_case)); +INSERT INTO t (a, b) VALUES (0, 0), (0, 1), (1, 0), (1, 1); +ANALYZE TABLE t; +Table Op Msg_type Msg_text +test.t analyze status OK +EXPLAIN SELECT a, b FROM t WHERE (a AND b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a AND b) = 1; +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (a AND b); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (a AND b); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a AND b) IN (1, 2, 3); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a OR b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a OR b) = 1; +a b +0 1 +1 0 +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a OR b) BETWEEN 1 AND 10; +a b +0 1 +1 0 +1 1 +EXPLAIN SELECT a, b FROM t WHERE (a XOR b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE (a XOR b) = 1; +a b +0 1 +1 0 +EXPLAIN SELECT a FROM t WHERE (NOT a) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a FROM t WHERE (NOT a) = 1; +a +0 +0 +EXPLAIN SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a FROM t WHERE (CASE WHEN (a AND b) THEN a ELSE b END) = 1; +a +0 +1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (b AND a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (b AND a); +a b +1 1 +EXPLAIN SELECT a, b FROM t WHERE 1 = (b OR a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where +SELECT a, b FROM t WHERE 1 = (b OR a); +a b +0 1 +1 0 +1 1 +DROP TABLE t; +# +# Bug#22810883: ASSERTION FAILED: +# !(USED_TABS & (~READ_TABLES & ~FILTER_FOR_TABLE)) +# +CREATE TABLE t1 (a1 INTEGER GENERATED ALWAYS AS (1 AND 0) STORED, +a2 INTEGER, KEY (a1)); +INSERT INTO t1 VALUES (); +CREATE TABLE t2 (b INTEGER); +INSERT INTO t2 VALUES (1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +# Used to choose the index on a1 and get wrong results. +EXPLAIN SELECT * FROM t1 WHERE (a2 AND a2) = 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * FROM t1 WHERE (a2 AND a2) = 0; +a1 a2 +# Used to get assertion or wrong results. +EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 ON b WHERE (b AND b) = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +1 SIMPLE t2 system NULL NULL NULL NULL 1 +SELECT * FROM t1 STRAIGHT_JOIN t2 ON b WHERE (b AND b) = 1; +a1 a2 b +0 NULL 1 +DROP TABLE t1, t2; +# +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_memory.result b/mysql-test/suite/gcol/r/gcol_memory.result new file mode 100644 index 00000000000..7ede64807f0 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_memory.result @@ -0,0 +1,14 @@ +SET @@session.default_storage_engine = 'memory'; +create table t1 (a int, b int generated always as (a+1) virtual); +ERROR HY000: MEMORY storage engine does not support computed columns +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual; +ERROR HY000: MEMORY storage engine does not support computed columns +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_merge.result b/mysql-test/suite/gcol/r/gcol_merge.result new file mode 100644 index 00000000000..5a9f3ad8770 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_merge.result @@ -0,0 +1,15 @@ +drop table if exists t1, t2, t3; +create table t1 (a int, b int generated always as (a % 10) virtual); +create table t2 (a int, b int generated always as (a % 10) virtual); +insert into t1 values (1,default); +insert into t2 values (2,default); +create table t3 (a int, b int generated always as (a % 10) virtual) engine=MERGE UNION=(t1,t2); +ERROR HY000: MRG_MyISAM storage engine does not support computed columns +drop table t1,t2; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_ndb.result b/mysql-test/suite/gcol/r/gcol_ndb.result new file mode 100644 index 00000000000..4c1c2a446e9 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_ndb.result @@ -0,0 +1,14 @@ +SET @@session.default_storage_engine = 'ndbcluster'; +create table t1 (a int, b int generated always as (a+1) virtual); +ERROR HY000: 'Specified storage engine' is not supported for generated columns. +create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual; +ERROR HY000: 'Specified storage engine' is not supported for generated columns. +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result new file mode 100644 index 00000000000..aed3fbc8e0b --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result @@ -0,0 +1,237 @@ +SET @@session.default_storage_engine = 'InnoDB'; +# Case 1. All non-stored columns. +create table t1 (a int generated always as (2+3) virtual); +insert into t1 values (default); +select * from t1; +a +5 +insert into t1 values (default); +select * from t1; +a +5 +5 +drop table t1; +# Case 2. CREATE +# - Column1: "real" +# - Column 2: virtual non-stored +create table t1 (a int, b int generated always as (-a) virtual); +insert into t1 values (1,default); +select * from t1; +a b +1 -1 +insert into t1 values (2,default); +select * from t1 order by a; +a b +1 -1 +2 -2 +drop table t1; +# Case 3. CREATE +# - Column1: "real" +# - Column 2: virtual stored +create table t1 (a int, b int generated always as (-a) stored); +insert into t1 values (1,default); +select * from t1; +a b +1 -1 +insert into t1 values (2,default); +select * from t1 order by a; +a b +1 -1 +2 -2 +drop table t1; +# Case 4. CREATE +# - Column1: virtual non-stored +# - Column2: "real" +create table t1 (a int generated always as (-b) virtual, b int); +insert into t1 values (default,1); +select * from t1; +a b +-1 1 +insert into t1 values (default,2); +select * from t1 order by a; +a b +-2 2 +-1 1 +drop table t1; +# Case 5. CREATE +# - Column1: virtual stored +# - Column2: "real" +create table t1 (a int generated always as (-b) stored, b int); +insert into t1 values (default,1); +select * from t1; +a b +-1 1 +insert into t1 values (default,2); +select * from t1 order by a; +a b +-2 2 +-1 1 +drop table t1; +# Case 6. CREATE +# - Column1: "real" +# - Column2: virtual non-stored +# - Column3: virtual stored +create table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +insert into t1 values (1,default,default); +select * from t1; +a b c +1 -1 -1 +insert into t1 values (2,default,default); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t1; +# Case 7. ALTER. Modify virtual stored -> virtual non-stored +create table t1 (a int, b int generated always as (a % 2) stored); +alter table t1 modify b int generated always as (a % 2) virtual; +ERROR HY000: This is not yet supported for computed columns +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 8. ALTER. Modify virtual non-stored -> virtual stored +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) stored; +ERROR HY000: This is not yet supported for computed columns +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 9. CREATE LIKE +# - Column1: "real" +# - Column2: virtual non-stored +# - Column3: virtual stored +create table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +create table t2 like t1; +insert into t2 values (1,default,default); +select * from t2; +a b c +1 -1 -1 +insert into t2 values (2,default,default); +select * from t2 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t2; +drop table t1; +# Case 10. ALTER. Dropping a virtual non-stored column. +# - Column1: virtual non-stored +# - Column2: "real" +create table t1 (a int generated always as (-b) virtual, b int, c varchar(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +a b c +-1 1 v1 +-2 2 v2 +alter table t1 drop column a; +select * from t1 order by b; +b c +1 v1 +2 v2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` int(11) DEFAULT NULL, + `c` varchar(5) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 11. ALTER. Dropping a virtual stored column. +# - Column1: virtual stored +# - Column2: "real" +create table t1 (a int generated always as (-b) stored, b int, c char(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +a b c +-1 1 v1 +-2 2 v2 +alter table t1 drop column a; +select * from t1 order by b; +b c +1 v1 +2 v2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` int(11) DEFAULT NULL, + `c` char(5) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 12. ALTER. Adding a new virtual non-stored column. +create table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +a b +1 2008-09-04 00:00:00 +2 2008-09-05 00:00:00 +alter table t1 add column c int generated always as (dayofyear(b)) virtual after a; +select * from t1 order by a; +a c b +1 248 2008-09-04 00:00:00 +2 249 2008-09-05 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` int(11) AS (dayofyear(b)) VIRTUAL, + `b` datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 13. ALTER. Adding a new virtual stored column. +create table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +a b +1 2008-09-04 00:00:00 +2 2008-09-05 00:00:00 +alter table t1 add column c int generated always as (dayofyear(b)) stored after a; +select * from t1 order by a; +a c b +1 248 2008-09-04 00:00:00 +2 249 2008-09-05 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` int(11) AS (dayofyear(b)) PERSISTENT, + `b` datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +# Case 15. ALTER. Changing the expression of a virtual non-stored column. +create table t1 (a int, b datetime, c int generated always as (week(b)) virtual); +insert into t1 values (1,'2008-09-04',default); +insert into t1 values (2,'2008-09-05',default); +select * from t1 order by a; +a b c +1 2008-09-04 00:00:00 35 +2 2008-09-05 00:00:00 35 +alter table t1 change column c c int generated always as (week(b,1)) virtual; +select * from t1 order by a; +a b c +1 2008-09-04 00:00:00 36 +2 2008-09-05 00:00:00 36 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` int(11) AS (week(b,1)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result new file mode 100644 index 00000000000..2ebe751009c --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result @@ -0,0 +1,237 @@ +SET @@session.default_storage_engine = 'MyISAM'; +# Case 1. All non-stored columns. +create table t1 (a int generated always as (2+3) virtual); +insert into t1 values (default); +select * from t1; +a +5 +insert into t1 values (default); +select * from t1; +a +5 +5 +drop table t1; +# Case 2. CREATE +# - Column1: "real" +# - Column 2: virtual non-stored +create table t1 (a int, b int generated always as (-a) virtual); +insert into t1 values (1,default); +select * from t1; +a b +1 -1 +insert into t1 values (2,default); +select * from t1 order by a; +a b +1 -1 +2 -2 +drop table t1; +# Case 3. CREATE +# - Column1: "real" +# - Column 2: virtual stored +create table t1 (a int, b int generated always as (-a) stored); +insert into t1 values (1,default); +select * from t1; +a b +1 -1 +insert into t1 values (2,default); +select * from t1 order by a; +a b +1 -1 +2 -2 +drop table t1; +# Case 4. CREATE +# - Column1: virtual non-stored +# - Column2: "real" +create table t1 (a int generated always as (-b) virtual, b int); +insert into t1 values (default,1); +select * from t1; +a b +-1 1 +insert into t1 values (default,2); +select * from t1 order by a; +a b +-2 2 +-1 1 +drop table t1; +# Case 5. CREATE +# - Column1: virtual stored +# - Column2: "real" +create table t1 (a int generated always as (-b) stored, b int); +insert into t1 values (default,1); +select * from t1; +a b +-1 1 +insert into t1 values (default,2); +select * from t1 order by a; +a b +-2 2 +-1 1 +drop table t1; +# Case 6. CREATE +# - Column1: "real" +# - Column2: virtual non-stored +# - Column3: virtual stored +create table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +insert into t1 values (1,default,default); +select * from t1; +a b c +1 -1 -1 +insert into t1 values (2,default,default); +select * from t1 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t1; +# Case 7. ALTER. Modify virtual stored -> virtual non-stored +create table t1 (a int, b int generated always as (a % 2) stored); +alter table t1 modify b int generated always as (a % 2) virtual; +ERROR HY000: This is not yet supported for computed columns +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 8. ALTER. Modify virtual non-stored -> virtual stored +create table t1 (a int, b int generated always as (a % 2) virtual); +alter table t1 modify b int generated always as (a % 2) stored; +ERROR HY000: This is not yet supported for computed columns +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 9. CREATE LIKE +# - Column1: "real" +# - Column2: virtual non-stored +# - Column3: virtual stored +create table t1 (a int, b int generated always as (-a), c int generated always as (-a) stored); +create table t2 like t1; +insert into t2 values (1,default,default); +select * from t2; +a b c +1 -1 -1 +insert into t2 values (2,default,default); +select * from t2 order by a; +a b c +1 -1 -1 +2 -2 -2 +drop table t2; +drop table t1; +# Case 10. ALTER. Dropping a virtual non-stored column. +# - Column1: virtual non-stored +# - Column2: "real" +create table t1 (a int generated always as (-b) virtual, b int, c varchar(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +a b c +-1 1 v1 +-2 2 v2 +alter table t1 drop column a; +select * from t1 order by b; +b c +1 v1 +2 v2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` int(11) DEFAULT NULL, + `c` varchar(5) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 11. ALTER. Dropping a virtual stored column. +# - Column1: virtual stored +# - Column2: "real" +create table t1 (a int generated always as (-b) stored, b int, c char(5)); +insert into t1 values (default,1,'v1'); +insert into t1 values (default,2,'v2'); +select * from t1 order by b; +a b c +-1 1 v1 +-2 2 v2 +alter table t1 drop column a; +select * from t1 order by b; +b c +1 v1 +2 v2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` int(11) DEFAULT NULL, + `c` char(5) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 12. ALTER. Adding a new virtual non-stored column. +create table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +a b +1 2008-09-04 00:00:00 +2 2008-09-05 00:00:00 +alter table t1 add column c int generated always as (dayofyear(b)) virtual after a; +select * from t1 order by a; +a c b +1 248 2008-09-04 00:00:00 +2 249 2008-09-05 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` int(11) AS (dayofyear(b)) VIRTUAL, + `b` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 13. ALTER. Adding a new virtual stored column. +create table t1 (a int, b datetime); +insert into t1 values (1,'2008-09-04'); +insert into t1 values (2,'2008-09-05'); +select * from t1 order by a; +a b +1 2008-09-04 00:00:00 +2 2008-09-05 00:00:00 +alter table t1 add column c int generated always as (dayofyear(b)) stored after a; +select * from t1 order by a; +a c b +1 248 2008-09-04 00:00:00 +2 249 2008-09-05 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` int(11) AS (dayofyear(b)) PERSISTENT, + `b` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# Case 15. ALTER. Changing the expression of a virtual non-stored column. +create table t1 (a int, b datetime, c int generated always as (week(b)) virtual); +insert into t1 values (1,'2008-09-04',default); +insert into t1 values (2,'2008-09-05',default); +select * from t1 order by a; +a b c +1 2008-09-04 00:00:00 35 +2 2008-09-05 00:00:00 35 +alter table t1 change column c c int generated always as (week(b,1)) virtual; +select * from t1 order by a; +a b c +1 2008-09-04 00:00:00 36 +2 2008-09-05 00:00:00 36 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` int(11) AS (week(b,1)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_partition_innodb.result b/mysql-test/suite/gcol/r/gcol_partition_innodb.result new file mode 100644 index 00000000000..9a0e676e76f --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_partition_innodb.result @@ -0,0 +1,95 @@ +SET @@session.default_storage_engine = 'InnoDB'; +drop table if exists t1; +# Case 1. Partitioning by RANGE based on a non-stored generated column. +CREATE TABLE t1 ( +a DATE NOT NULL, +b int generated always as (year(a)) virtual +) +PARTITION BY RANGE( b ) ( +PARTITION p0 VALUES LESS THAN (2006), +PARTITION p2 VALUES LESS THAN (2008) +); +insert into t1 values ('2006-01-01',default); +insert into t1 values ('2007-01-01',default); +insert into t1 values ('2005-01-01',default); +select * from t1; +a b +2005-01-01 2005 +2006-01-01 2006 +2007-01-01 2007 +# Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; +select * from t1; +a b +2005-01-01 2004 +2006-01-01 2005 +2007-01-01 2006 +drop table t1; +# Case 2. Partitioning by LIST based on a stored generated column. +CREATE TABLE t1 (a int, b int generated always as (a % 3 ) stored) +PARTITION BY LIST (a+1) +(PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); +insert into t1 values (1,default); +select * from t1; +a b +1 1 +select * from t1; +a b +1 1 +drop table t1; +# Case 3. Partitioning by HASH based on a non-stored generated column. +CREATE TABLE t1 ( +a DATE NOT NULL, +b int generated always as (year(a)) virtual +) +PARTITION BY HASH( b % 3 ) PARTITIONS 3; +insert into t1 values ('2005-01-01',default); +insert into t1 values ('2006-01-01',default); +select * from t1; +a b +2005-01-01 2005 +2006-01-01 2006 +# Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; +select * from t1; +a b +2005-01-01 2004 +2006-01-01 2005 +drop table t1; +# +# Bug#21779011 INVALID READS AND SENDING RANDOM SERVER MEMORY BACK +# TO CLIENT +# +CREATE TABLE t ( +c INTEGER GENERATED ALWAYS AS (2) VIRTUAL, +d INTEGER, +KEY (d) +) PARTITION BY KEY (d) PARTITIONS 2; +INSERT INTO t (d) VALUES (1),(1),(2),(2); +SELECT c FROM t WHERE d >= 1 GROUP BY d LIMIT 2; +c +2 +2 +DROP TABLE t; +# +# Bug#21779554: CHECK_MISPLACED_ROWS BOGUS "FOUND A MISPLACED ROW" +# AND CRASHES +# +CREATE TABLE t(a INT,b INT GENERATED ALWAYS AS (1) VIRTUAL,c INT) +PARTITION BY KEY (b)PARTITIONS 6; +INSERT INTO t VALUES(); +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +FLUSH TABLES; +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +DROP TABLE t; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_partition_myisam.result b/mysql-test/suite/gcol/r/gcol_partition_myisam.result new file mode 100644 index 00000000000..81324da6fcd --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_partition_myisam.result @@ -0,0 +1,95 @@ +SET @@session.default_storage_engine = 'MyISAM'; +drop table if exists t1; +# Case 1. Partitioning by RANGE based on a non-stored generated column. +CREATE TABLE t1 ( +a DATE NOT NULL, +b int generated always as (year(a)) virtual +) +PARTITION BY RANGE( b ) ( +PARTITION p0 VALUES LESS THAN (2006), +PARTITION p2 VALUES LESS THAN (2008) +); +insert into t1 values ('2006-01-01',default); +insert into t1 values ('2007-01-01',default); +insert into t1 values ('2005-01-01',default); +select * from t1; +a b +2005-01-01 2005 +2006-01-01 2006 +2007-01-01 2007 +# Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; +select * from t1; +a b +2005-01-01 2004 +2006-01-01 2005 +2007-01-01 2006 +drop table t1; +# Case 2. Partitioning by LIST based on a stored generated column. +CREATE TABLE t1 (a int, b int generated always as (a % 3 ) stored) +PARTITION BY LIST (a+1) +(PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); +insert into t1 values (1,default); +select * from t1; +a b +1 1 +select * from t1; +a b +1 1 +drop table t1; +# Case 3. Partitioning by HASH based on a non-stored generated column. +CREATE TABLE t1 ( +a DATE NOT NULL, +b int generated always as (year(a)) virtual +) +PARTITION BY HASH( b % 3 ) PARTITIONS 3; +insert into t1 values ('2005-01-01',default); +insert into t1 values ('2006-01-01',default); +select * from t1; +a b +2005-01-01 2005 +2006-01-01 2006 +# Modify the expression of generated column b +ALTER TABLE t1 modify b int generated always as (year(a)-1) virtual; +select * from t1; +a b +2005-01-01 2004 +2006-01-01 2005 +drop table t1; +# +# Bug#21779011 INVALID READS AND SENDING RANDOM SERVER MEMORY BACK +# TO CLIENT +# +CREATE TABLE t ( +c INTEGER GENERATED ALWAYS AS (2) VIRTUAL, +d INTEGER, +KEY (d) +) PARTITION BY KEY (d) PARTITIONS 2; +INSERT INTO t (d) VALUES (1),(1),(2),(2); +SELECT c FROM t WHERE d >= 1 GROUP BY d LIMIT 2; +c +2 +2 +DROP TABLE t; +# +# Bug#21779554: CHECK_MISPLACED_ROWS BOGUS "FOUND A MISPLACED ROW" +# AND CRASHES +# +CREATE TABLE t(a INT,b INT GENERATED ALWAYS AS (1) VIRTUAL,c INT) +PARTITION BY KEY (b)PARTITIONS 6; +INSERT INTO t VALUES(); +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +FLUSH TABLES; +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +DROP TABLE t; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_rejected_innodb.result b/mysql-test/suite/gcol/r/gcol_rejected_innodb.result new file mode 100644 index 00000000000..b8d0db567ca --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_rejected_innodb.result @@ -0,0 +1,8 @@ +SET @@session.default_storage_engine = 'InnoDB'; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_rollback.result b/mysql-test/suite/gcol/r/gcol_rollback.result new file mode 100644 index 00000000000..006c8408a84 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_rollback.result @@ -0,0 +1,75 @@ +CREATE TABLE t ( +a INTEGER, +b BLOB GENERATED ALWAYS AS (a) VIRTUAL, +INDEX (b(57)) +)ENGINE=INNODB; +INSERT INTO t (a) VALUES (9); +BEGIN; +SAVEPOINT a; +UPDATE t set a = 12; +DELETE FROM t where a = 12; +ROLLBACK TO SAVEPOINT a; +COMMIT; +CHECK TABLE t; +Table Op Msg_type Msg_text +test.t check status OK +SELECT * FROM t; +a b +9 9 +BEGIN; +INSERT INTO t (a) VALUES (10); +# Kill and restart +SELECT * FROM t; +a b +9 9 +DROP TABLE t; +CREATE TABLE t ( +a INTEGER, +b BLOB GENERATED ALWAYS AS (a) VIRTUAL, +c INTEGER +)ENGINE=INNODB; +INSERT INTO t (a,c) VALUES (9, 10); +SELECT * FROM t; +a b c +9 9 10 +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; +ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE; +SET DEBUG_SYNC = 'now WAIT_FOR created'; +BEGIN; +INSERT INTO t (a,c) VALUES (10, 12); +SELECT * FROM t; +a b c +9 9 10 +10 10 12 +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done'; +SELECT * FROM t; +a b c +9 9 10 +DROP TABLE t; +CREATE TABLE t ( +a INT, +b INT, +c INT GENERATED ALWAYS AS(a+b), +d INT GENERATED ALWAYS AS(a+b+b), +KEY(c, d) +)ENGINE=INNODB; +INSERT INTO t (a,b) VALUES (9, 10); +SELECT * FROM t; +a b c d +9 10 19 29 +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; +SET DEBUG_SYNC = 'now WAIT_FOR created'; +BEGIN; +INSERT INTO t (a,b) VALUES (10, 12); +SELECT * FROM t; +a b c d +9 10 19 29 +10 12 22 34 +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done'; +SELECT * FROM t; +a b d +9 10 29 +DROP TABLE t; diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result new file mode 100644 index 00000000000..e815cfcbe8e --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result @@ -0,0 +1,976 @@ +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; +SET @@session.default_storage_engine = 'InnoDB'; +SET optimizer_switch='derived_merge=off'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +index (c)); +insert into t1 (a) values (2), (1), (1), (3), (NULL); +create table t2 like t1; +insert into t2 (a) values (1); +create table t3 (a int primary key, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t3 (a) values (2),(1),(3); +analyze table t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +# select_type=SIMPLE, type=system +select * from t2; +a b c +1 -1 -1 +explain select * from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +select * from t2 where c=-1; +a b c +1 -1 -1 +explain select * from t2 where c=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c c 5 const 1 +# select_type=SIMPLE, type=ALL +select * from t1 where b=-1; +a b c +1 -1 -1 +1 -1 -1 +explain select * from t1 where b=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +# select_type=SIMPLE, type=const +select * from t3 where a=1; +a b c +1 -1 -1 +explain select * from t3 where a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1 +# select_type=SIMPLE, type=range +select * from t3 where c>=-1; +a b c +1 -1 -1 +explain select * from t3 where c>=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 1 Using index condition +# select_type=SIMPLE, type=ref +select * from t1,t3 where t1.c=t3.c and t3.c=-1; +a b c a b c +1 -1 -1 1 -1 -1 +1 -1 -1 1 -1 -1 +explain select * from t1,t3 where t1.c=t3.c and t3.c=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 const c c 5 const 1 +1 SIMPLE t1 ref c c 5 const 2 +# select_type=PRIMARY, type=index,ALL +select * from t1 where b in (select c from t3); +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +3 -3 -3 +explain select * from t1 where b in (select c from t3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 index c c 5 NULL 3 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) +# select_type=PRIMARY, type=range,ref +select * from t1 where c in (select c from t3 where c between -2 and -1); +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +explain select * from t1 where c in (select c from t3 where c between -2 and -1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 index c c 5 NULL 3 Using where; Using index +1 PRIMARY t1 ALL c NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) +# select_type=UNION, type=system +# select_type=UNION RESULT, type= +select * from t1 union select * from t2; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +NULL NULL NULL +explain select * from t1 union select * from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +2 UNION t2 ALL NULL NULL NULL NULL 1 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL +# select_type=DERIVED, type=system +select * from (select a,b,c from t1) as t11; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +3 -3 -3 +NULL NULL NULL +explain select * from (select a,b,c from t1) as t11; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 5 +2 DERIVED t1 ALL NULL NULL NULL NULL 5 +### +### Using aggregate functions with/without DISTINCT +### +# SELECT COUNT(*) FROM tbl_name +select count(*) from t1; +count(*) +5 +explain select count(*) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL c 5 NULL 5 Using index +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct a) from t1; +count(distinct a) +3 +explain select count(distinct a) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct b) from t1; +count(distinct b) +3 +explain select count(distinct b) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct c) from t1; +count(distinct c) +3 +explain select count(distinct c) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by (scanning) +### +### filesort & range-based utils +### +# SELECT * FROM tbl_name WHERE +select * from t3 where c >= -2; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where c >= -2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition +# SELECT * FROM tbl_name WHERE +select * from t3 where a between 1 and 2; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where a between 1 and 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 2 Using where +# SELECT * FROM tbl_name WHERE +select * from t3 where b between -2 and -1; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where b between -2 and -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where +# SELECT * FROM tbl_name WHERE +select * from t3 where c between -2 and -1; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where c between -2 and -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where a between 1 and 2 order by b; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where a between 1 and 2 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 2 Using where; Using filesort +# bug#20022189: WL411:DEBUG ASSERT AT FIELD_LONG::VAL_INT IN SQL/FIELD.CC +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where a between 1 and 2 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where a between 1 and 2 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 2 Using where; Using filesort +# bug#20022189: WL411:DEBUG ASSERT AT FIELD_LONG::VAL_INT IN SQL/FIELD.CC +CREATE TABLE t4 ( +`pk` int(11) NOT NULL , +`col_int_nokey` int(11) GENERATED ALWAYS AS (pk + col_int_key) STORED, +`col_int_key` int(11) DEFAULT NULL, +`col_date_nokey` date DEFAULT NULL, +`col_datetime_key` datetime DEFAULT NULL, +PRIMARY KEY (`pk`), +KEY `col_int_key` (`col_int_key`), +KEY `col_datetime_key` (`col_datetime_key`) +); +INSERT INTO t4 VALUES +(1,default,4,'2008-12-05','1900-01-01 00:00:00'); +SELECT +SQL_BIG_RESULT +GRANDPARENT1 . `col_int_nokey` AS g1 +FROM t4 AS GRANDPARENT1 LEFT JOIN t4 AS GRANDPARENT2 ON ( GRANDPARENT2 . +`col_datetime_key` <= GRANDPARENT1 . `col_date_nokey` ) +GROUP BY GRANDPARENT1 . `pk`; +g1 +5 +DROP TABLE t4; +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where a between 1 and 2 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where a between 1 and 2 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 2 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by a; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where b between -2 and -1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL PRIMARY 4 NULL 3 Using where +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by b; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where b between -2 and -1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where c between -2 and -1 order by b; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where c between -2 and -1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where b between -2 and -1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where c between -2 and -1 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where c between -2 and -1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition +# SELECT sum() FROM tbl_name GROUP BY +select sum(b) from t1 group by b; +sum(b) +NULL +-3 +-2 +-2 +explain select sum(b) from t1 group by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +# SELECT sum() FROM tbl_name GROUP BY +select sum(c) from t1 group by c; +sum(c) +NULL +-3 +-2 +-2 +explain select sum(c) from t1 group by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL c 5 NULL 5 Using index +# SELECT sum() FROM tbl_name GROUP BY +select sum(b) from t1 group by c; +sum(b) +NULL +-3 +-2 +-2 +explain select sum(b) from t1 group by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL c 5 NULL 5 +# SELECT sum() FROM tbl_name GROUP BY +select sum(c) from t1 group by b; +sum(c) +NULL +-3 +-2 +-2 +explain select sum(c) from t1 group by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +drop table t1; +# +# Bug#20241655: WL411:FAILING ASSERTION ASSERTION +# +CREATE TABLE BB ( +col_time_key time NOT NULL, +col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, +col_datetime_key datetime NOT NULL); +INSERT INTO BB VALUES('23:28:02', default, '2005-03-15 22:48:25'); +Warnings: +Note 1265 Data truncated for column 'col_time_nokey' at row 1 +CREATE TABLE CC ( +col_time_key time NOT NULL, +col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, +col_datetime_key datetime NOT NULL +); +INSERT INTO CC VALUES('16:22:51', default, '1900-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'col_time_nokey' at row 1 +SELECT 1 AS g1 FROM BB AS gp1 LEFT JOIN BB AS gp2 USING ( col_time_nokey); +g1 +1 +DROP TABLE BB, CC; +# +# Bug#20328786: WL411:VALGRIND WARNINGS OF CONDITIONAL +# JUMP WHILE SELECTING FROM VIEW +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, +PRIMARY KEY (pk) +); +CREATE TABLE C ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key, col_int_key) +); +INSERT INTO C ( +col_int_nokey, +col_varchar_nokey +) VALUES (4, 'v'),(62, 'v'),(7, 'c'),(1, NULL),(0, 'x'),(7, 'i'),(7, 'e'),(1, 'p'),(7, 's'),(1, 'j'),(5, 'z'),(2, 'c'),(0, 'a'),(1, 'q'),(8, 'y'),(1, NULL),(1, 'r'),(9, 'v'),(1, NULL),(5, 'r'); +CREATE OR REPLACE ALGORITHM=MERGE VIEW V1 AS SELECT alias1. +col_varchar_key AS field1 , alias1.pk AS field2, alias2. +col_int_nokey AS field3 FROM C AS alias1 LEFT JOIN A AS alias2 ON +alias1.pk = alias2.col_int_key WHERE alias1.pk > 8 AND alias1 +.pk < ( 9 + 2 ) AND alias1.col_int_key <> 1 OR alias1.col_int_key +> 0 AND alias1.col_int_key <= ( 3 + 2 ) ORDER BY field1, field2, field3 +LIMIT 100 OFFSET 6; +Warnings: +Warning 1354 View merge algorithm can't be used here for now (assumed undefined algorithm) +SELECT * FROM V1; +field1 field2 field3 +qq 14 NULL +rr 17 NULL +ss 9 NULL +xx 5 NULL +DROP VIEW V1; +DROP TABLE A,C; +# +# Bug#20406510: WL411:VALGRIND WARNINGS WITH +# COUNT DISTINCT QUERY ON VIRTUAL GC VARCHAR COLUMN +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_time_key TIME NOT NULL, +col_datetime_key DATETIME NOT NULL, +PRIMARY KEY (pk), +KEY (col_time_key), +KEY (col_datetime_key) +); +CREATE TABLE C ( +pk INTEGER AUTO_INCREMENT, +col_int_key INTEGER NOT NULL, +col_varchar_key VARCHAR(1) NOT NULL, +col_varchar_nokey VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_key, col_varchar_key)), +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key, col_int_key) +); +INSERT INTO C (col_int_key,col_varchar_key) VALUES (0, 'j'),(8, 'v'),(1, 'c'),(8, 'm'),(9, 'd'); +SELECT MIN( alias2 . col_int_key ) AS field1, +COUNT( DISTINCT alias2 . col_varchar_nokey ) AS field2 +FROM ( A AS alias1 , C AS alias2 ) +ORDER BY alias1.col_time_key, alias1.col_datetime_key, alias1.pk ASC; +field1 field2 +NULL 0 +DROP TABLE A,C; +# +# Bug#20566325: WL8149: INNODB: FAILING ASSERTION: +# COL_NR < TABLE->N_DEF +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT /*! IGNORE */ INTO A (col_varchar_nokey) VALUES ('k'); +CREATE TABLE CC ( +pk INTEGER AUTO_INCREMENT, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk)); +INSERT INTO CC (col_time_nokey,col_datetime_nokey,col_varchar_nokey) VALUES +('13:06:13.033877','1900-01-01 00:00:00', 'p'), +(NULL, '2007-05-25 11:58:54.015689', 'g'); +SELECT +table1.col_time_key AS field1, +'z' AS field2 +FROM +(CC AS table1 LEFT OUTER JOIN (A AS table2 STRAIGHT_JOIN CC AS table3 ON +(table3.col_varchar_key = table2.col_varchar_nokey)) ON +(table3.col_varchar_key = table2.col_varchar_nokey)) +WHERE +table2.pk != 6 +AND table1.col_varchar_key IN ('l', 's' , 'b' ) +AND table3.col_varchar_key != table1.col_varchar_key +ORDER BY table1.col_varchar_key , field1 , field2; +field1 field2 +DROP TABLE A,CC; +CREATE TABLE cc ( +pk int(11) NOT NULL AUTO_INCREMENT, +col_int_nokey int(11) NOT NULL, +col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) STORED, +col_date_nokey date NOT NULL, +col_date_key date GENERATED ALWAYS AS (col_date_nokey) STORED, +col_datetime_nokey datetime NOT NULL, +col_time_nokey time NOT NULL, +col_datetime_key datetime GENERATED ALWAYS AS (col_datetime_nokey)STORED, +col_time_key time GENERATED ALWAYS AS (col_time_nokey) STORED, +col_varchar_nokey varchar(1) NOT NULL, +col_varchar_key varchar(1) GENERATED ALWAYS AS (col_varchar_nokey)STORED, +PRIMARY KEY (pk), +KEY gc_idx1 (col_int_key), +KEY gc_idx2 (col_varchar_key), +KEY gc_idx3 (col_date_key), +KEY gc_idx4 (col_time_key), +KEY gc_idx5 (col_datetime_key), +KEY gc_idx6 (col_varchar_key,col_int_key), +KEY gc_idx7 (col_date_key,col_datetime_key,col_time_key), +KEY gc_idx8(col_int_key,col_varchar_key,col_date_key,col_time_key, +col_datetime_key) +); +INSERT INTO cc ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES (1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(24, '2000-10-08', '10:14:58.018534', '2006-10-12 04:32:53.031976', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(1, '2008-01-23', '11:14:24.032949', '2004-10-02 20:31:15.022553', 't'); +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; +SELECT DISTINCT alias1.col_varchar_key AS field1 +FROM ( cc AS alias1 STRAIGHT_JOIN +(( cc AS alias2 STRAIGHT_JOIN cc AS alias3 ON +(alias3.col_varchar_key > alias2.col_varchar_key ) ) ) ON +(( alias3 .pk >= alias2.col_int_nokey ) AND +(alias3 .pk >= alias2.col_int_nokey ) )) +WHERE alias1.col_varchar_key <= 'v' +GROUP BY field1 HAVING field1 = 91 +ORDER BY field1, alias1.col_date_key, field1 ASC, field1 DESC, +alias1.col_time_key ASC, field1; +field1 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'c' +Warning 1292 Truncated incorrect DOUBLE value: 't' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +DROP TABLE cc; +SET sql_mode=@save_old_sql_mode; +# +# Bug#20797941: WL8149:ASSERTION !TABLE || +# (!TABLE->READ_SET || BITMAP_IS_SET(TABLE->READ_SET +# +CREATE TABLE t(a int, b int as(a+1)); +INSERT INTO t(a) values(1),(2); +SELECT * FROM t ORDER BY b; +a b +1 2 +2 3 +DROP TABLE t; +DROP TABLE t2, t3; +# +# Bug#21317507:GC: STORED COLUMN REJECTED, BUT VIRTUAL IS ACCEPTED +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN b; +ALTER TABLE t1 ADD COLUMN c SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN c; +ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL; +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL; +ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a c +2147483647 127 +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL; +ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY; +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED +ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED +ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'g' at row 1 +DROP TABLE t1; +# +# Bug#21980430 GCOLS: CRASHING +# +CREATE TABLE t ( +a INT, +b BLOB, +c BLOB GENERATED ALWAYS AS (a+b) VIRTUAL, +UNIQUE KEY i0008 (a) +); +INSERT INTO t(a,b) VALUES(1,'cccc'); +EXPLAIN SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c +WHERE b.b>c.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE b ALL i0008 NULL NULL NULL 1 +1 SIMPLE c ALL i0008 NULL NULL NULL 1 Range checked for each record (index map: 0x1) +SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c +WHERE b.b>c.a; +c +DROP TABLE t; +set @optimizer_switch_save = @@optimizer_switch; +set optimizer_switch='mrr_cost_based=off'; +set @read_rnd_buffer_size_save= @@read_rnd_buffer_size; +set read_rnd_buffer_size=32; +CREATE TABLE t0 ( +i1 INTEGER NOT NULL +); +INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t1 ( +pk INTEGER NOT NULL, +i1 INTEGER NOT NULL, +i2 INTEGER NOT NULL, +v1 INTEGER GENERATED ALWAYS AS (i2 + 1) VIRTUAL, +v2 INTEGER GENERATED ALWAYS AS (i1 / (i1 - i2 + 57)) VIRTUAL, +PRIMARY KEY (pk), +INDEX idx(i1) +); +INSERT INTO t1 (pk, i1, i2) +SELECT a0.i1 + a1.i1*10 + a2.i1*100, +a0.i1 + a1.i1*10, +a0.i1 + a1.i1*10 +FROM t0 AS a0, t0 AS a1, t0 AS a2; +EXPLAIN SELECT * FROM t1 +WHERE i1 > 41 AND i1 <= 43; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx idx 4 NULL 20 Using index condition +SELECT * FROM t1 +WHERE i1 > 41 AND i1 <= 43; +pk i1 i2 v1 v2 +142 42 42 43 1 +143 43 43 44 1 +242 42 42 43 1 +243 43 43 44 1 +342 42 42 43 1 +343 43 43 44 1 +42 42 42 43 1 +43 43 43 44 1 +442 42 42 43 1 +443 43 43 44 1 +542 42 42 43 1 +543 43 43 44 1 +642 42 42 43 1 +643 43 43 44 1 +742 42 42 43 1 +743 43 43 44 1 +842 42 42 43 1 +843 43 43 44 1 +942 42 42 43 1 +943 43 43 44 1 +EXPLAIN SELECT * FROM t1 +WHERE v1 > 41 AND v1 <= 43; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +SELECT * FROM t1 +WHERE v1 > 41 AND v1 <= 43; +pk i1 i2 v1 v2 +141 41 41 42 1 +142 42 42 43 1 +241 41 41 42 1 +242 42 42 43 1 +341 41 41 42 1 +342 42 42 43 1 +41 41 41 42 1 +42 42 42 43 1 +441 41 41 42 1 +442 42 42 43 1 +541 41 41 42 1 +542 42 42 43 1 +641 41 41 42 1 +642 42 42 43 1 +741 41 41 42 1 +742 42 42 43 1 +841 41 41 42 1 +842 42 42 43 1 +941 41 41 42 1 +942 42 42 43 1 +DROP TABLE t0, t1; +set optimizer_switch= @optimizer_switch_save; +set @@read_rnd_buffer_size= @read_rnd_buffer_size_save; +# +# Bug#21872184 CONDITIONAL JUMP AT JOIN_CACHE::WRITE_RECORD_DATA IN +# SQL_JOIN_BUFFER.CC +# +# +# Test 1: Dynamic range scan with one covering index +# +CREATE TABLE t1 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t1 +VALUES (10, 'c'), (10, 'i'), (2, 't'), (4, 'g'); +CREATE TABLE t2 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t2 +VALUES (2, 'k'), (9, 'k'), (7, 'o'), (5, 'n'), (7, 'e'); +CREATE TABLE t3 ( +pk INTEGER NOT NULL, +i1 INTEGER, +i2_key INTEGER GENERATED ALWAYS AS (i1 + i1) VIRTUAL, +PRIMARY KEY (pk) +); +INSERT INTO t3 (pk, i1) +VALUES (1, 1), (2, 48), (3, 228), (4, 3), (5, 5), +(6, 39), (7, 6), (8, 8), (9, 3); +CREATE TABLE t4 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t4 +VALUES (1, 'j'), (2, 'c'), (0, 'a'); +ANALYZE TABLE t1, t2, t3, t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 2: Two alternative covering indexes for the range scan +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 3: One covering index including the base column for the virtual +# column +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 4: One non-covering index +# +# Add more data to the table so that it will run the dynamic range scan +# as both table scan and range scan (the purpose of this is to make the +# table scan more expensive). +INSERT INTO t3 (pk, i1) +VALUES (10,1), (11,1), (12,1), (13,1), (14,1),(15,1), (16,1),(17,1), (18,1), +(19,1), (20,1), (21,1), (22,1), (23,1), (24,1),(25,1),(26,1),(27,1), +(28,1), (29,1); +# Change the query to read an extra column (t3.i1) making the index +# non-covering. +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 i1 +c 2 48 +c 5 48 +c 7 48 +c 7 48 +c 9 48 +g 2 48 +g 5 48 +g 7 48 +g 7 48 +g 9 48 +i 2 48 +i 5 48 +i 7 48 +i 7 48 +i 9 48 +t 2 1 +t 2 48 +t 5 1 +t 5 48 +t 7 1 +t 7 1 +t 7 48 +t 7 48 +t 9 1 +t 9 48 +# +# Test 5: Test where the added primary key to secondary indexes is +# used after it has been included in the join buffer +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) +) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join) +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) +) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +DROP TABLE t1, t2, t3, t4; +SET optimizer_switch='derived_merge=default'; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result new file mode 100644 index 00000000000..5a2af800a91 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -0,0 +1,978 @@ +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; +SET @@session.default_storage_engine = 'MyISAM'; +SET optimizer_switch='derived_merge=off'; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +index (c)); +insert into t1 (a) values (2), (1), (1), (3), (NULL); +create table t2 like t1; +insert into t2 (a) values (1); +create table t3 (a int primary key, +b int generated always as (-a) virtual, +c int generated always as (-a) stored unique); +insert into t3 (a) values (2),(1),(3); +analyze table t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +# select_type=SIMPLE, type=system +select * from t2; +a b c +1 -1 -1 +explain select * from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 +select * from t2 where c=-1; +a b c +1 -1 -1 +explain select * from t2 where c=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 system c NULL NULL NULL 1 +# select_type=SIMPLE, type=ALL +select * from t1 where b=-1; +a b c +1 -1 -1 +1 -1 -1 +explain select * from t1 where b=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +# select_type=SIMPLE, type=const +select * from t3 where a=1; +a b c +1 -1 -1 +explain select * from t3 where a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1 +# select_type=SIMPLE, type=range +select * from t3 where c>=-1; +a b c +1 -1 -1 +explain select * from t3 where c>=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition +# select_type=SIMPLE, type=ref +select * from t1,t3 where t1.c=t3.c and t3.c=-1; +a b c a b c +1 -1 -1 1 -1 -1 +1 -1 -1 1 -1 -1 +explain select * from t1,t3 where t1.c=t3.c and t3.c=-1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 const c c 5 const 1 +1 SIMPLE t1 ref c c 5 const 2 +# select_type=PRIMARY, type=index,ALL +select * from t1 where b in (select c from t3); +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +3 -3 -3 +explain select * from t1 where b in (select c from t3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 index c c 5 NULL 3 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) +# select_type=PRIMARY, type=range,ref +select * from t1 where c in (select c from t3 where c between -2 and -1); +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +explain select * from t1 where c in (select c from t3 where c between -2 and -1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 index c c 5 NULL 3 Using where; Using index +1 PRIMARY t1 ref c c 5 test.t3.c 1 +# select_type=UNION, type=system +# select_type=UNION RESULT, type= +select * from t1 union select * from t2; +a b c +1 -1 -1 +2 -2 -2 +3 -3 -3 +NULL NULL NULL +explain select * from t1 union select * from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +2 UNION t2 system NULL NULL NULL NULL 1 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL +# select_type=DERIVED, type=system +select * from (select a,b,c from t1) as t11; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +3 -3 -3 +NULL NULL NULL +explain select * from (select a,b,c from t1) as t11; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 5 +2 DERIVED t1 ALL NULL NULL NULL NULL 5 +### +### Using aggregate functions with/without DISTINCT +### +# SELECT COUNT(*) FROM tbl_name +select count(*) from t1; +count(*) +5 +explain select count(*) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct a) from t1; +count(distinct a) +3 +explain select count(distinct a) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct b) from t1; +count(distinct b) +3 +explain select count(distinct b) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +# SELECT COUNT(DISTINCT ) FROM tbl_name +select count(distinct c) from t1; +count(distinct c) +3 +explain select count(distinct c) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by (scanning) +### +### filesort & range-based utils +### +# SELECT * FROM tbl_name WHERE +select * from t3 where c >= -2; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where c >= -2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 2 Using index condition +# SELECT * FROM tbl_name WHERE +select * from t3 where a between 1 and 2; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where a between 1 and 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 1 Using index condition +# SELECT * FROM tbl_name WHERE +select * from t3 where b between -2 and -1; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where b between -2 and -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where +# SELECT * FROM tbl_name WHERE +select * from t3 where c between -2 and -1; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where c between -2 and -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 1 Using index condition +# bug#20022189: WL411:DEBUG ASSERT AT FIELD_LONG::VAL_INT IN SQL/FIELD.CC +CREATE TABLE t4 ( +`pk` int(11) NOT NULL , +`col_int_nokey` int(11) GENERATED ALWAYS AS (pk + col_int_key) STORED, +`col_int_key` int(11) DEFAULT NULL, +`col_date_nokey` date DEFAULT NULL, +`col_datetime_key` datetime DEFAULT NULL, +PRIMARY KEY (`pk`), +KEY `col_int_key` (`col_int_key`), +KEY `col_datetime_key` (`col_datetime_key`) +); +INSERT INTO t4 VALUES +(1,default,4,'2008-12-05','1900-01-01 00:00:00'); +SELECT +SQL_BIG_RESULT +GRANDPARENT1 . `col_int_nokey` AS g1 +FROM t4 AS GRANDPARENT1 LEFT JOIN t4 AS GRANDPARENT2 ON ( GRANDPARENT2 . +`col_datetime_key` <= GRANDPARENT1 . `col_date_nokey` ) +GROUP BY GRANDPARENT1 . `pk`; +g1 +5 +DROP TABLE t4; +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where a between 1 and 2 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where a between 1 and 2 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by a; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where b between -2 and -1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where c between -2 and -1 order by a; +a b c +1 -1 -1 +2 -2 -2 +explain select * from t3 where c between -2 and -1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 1 Using index condition; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by b; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where b between -2 and -1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where c between -2 and -1 order by b; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where c between -2 and -1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 1 Using index condition; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where b between -2 and -1 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where b between -2 and -1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +# SELECT * FROM tbl_name WHERE ORDER BY +select * from t3 where c between -2 and -1 order by c; +a b c +2 -2 -2 +1 -1 -1 +explain select * from t3 where c between -2 and -1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range c c 5 NULL 1 Using index condition +# SELECT sum() FROM tbl_name GROUP BY +select sum(b) from t1 group by b; +sum(b) +NULL +-3 +-2 +-2 +explain select sum(b) from t1 group by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +# SELECT sum() FROM tbl_name GROUP BY +select sum(c) from t1 group by c; +sum(c) +NULL +-3 +-2 +-2 +explain select sum(c) from t1 group by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL c 5 NULL 5 Using index +# SELECT sum() FROM tbl_name GROUP BY +select sum(b) from t1 group by c; +sum(b) +NULL +-3 +-2 +-2 +explain select sum(b) from t1 group by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +# SELECT sum() FROM tbl_name GROUP BY +select sum(c) from t1 group by b; +sum(c) +NULL +-3 +-2 +-2 +explain select sum(c) from t1 group by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort +drop table t1; +# +# Bug#20241655: WL411:FAILING ASSERTION ASSERTION +# +CREATE TABLE BB ( +col_time_key time NOT NULL, +col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, +col_datetime_key datetime NOT NULL); +INSERT INTO BB VALUES('23:28:02', default, '2005-03-15 22:48:25'); +Warnings: +Note 1265 Data truncated for column 'col_time_nokey' at row 1 +CREATE TABLE CC ( +col_time_key time NOT NULL, +col_time_nokey time GENERATED ALWAYS AS (ADDTIME(col_datetime_key, col_time_key)) VIRTUAL, +col_datetime_key datetime NOT NULL +); +INSERT INTO CC VALUES('16:22:51', default, '1900-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'col_time_nokey' at row 1 +SELECT 1 AS g1 FROM BB AS gp1 LEFT JOIN BB AS gp2 USING ( col_time_nokey); +g1 +1 +DROP TABLE BB, CC; +# +# Bug#20328786: WL411:VALGRIND WARNINGS OF CONDITIONAL +# JUMP WHILE SELECTING FROM VIEW +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, +PRIMARY KEY (pk) +); +CREATE TABLE C ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS (2 + 2 + col_int_nokey) STORED, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) STORED, +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key, col_int_key) +); +INSERT INTO C ( +col_int_nokey, +col_varchar_nokey +) VALUES (4, 'v'),(62, 'v'),(7, 'c'),(1, NULL),(0, 'x'),(7, 'i'),(7, 'e'),(1, 'p'),(7, 's'),(1, 'j'),(5, 'z'),(2, 'c'),(0, 'a'),(1, 'q'),(8, 'y'),(1, NULL),(1, 'r'),(9, 'v'),(1, NULL),(5, 'r'); +CREATE OR REPLACE ALGORITHM=MERGE VIEW V1 AS SELECT alias1. +col_varchar_key AS field1 , alias1.pk AS field2, alias2. +col_int_nokey AS field3 FROM C AS alias1 LEFT JOIN A AS alias2 ON +alias1.pk = alias2.col_int_key WHERE alias1.pk > 8 AND alias1 +.pk < ( 9 + 2 ) AND alias1.col_int_key <> 1 OR alias1.col_int_key +> 0 AND alias1.col_int_key <= ( 3 + 2 ) ORDER BY field1, field2, field3 +LIMIT 100 OFFSET 6; +Warnings: +Warning 1354 View merge algorithm can't be used here for now (assumed undefined algorithm) +SELECT * FROM V1; +field1 field2 field3 +qq 14 NULL +rr 17 NULL +ss 9 NULL +xx 5 NULL +DROP VIEW V1; +DROP TABLE A,C; +# +# Bug#20406510: WL411:VALGRIND WARNINGS WITH +# COUNT DISTINCT QUERY ON VIRTUAL GC VARCHAR COLUMN +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_time_key TIME NOT NULL, +col_datetime_key DATETIME NOT NULL, +PRIMARY KEY (pk), +KEY (col_time_key), +KEY (col_datetime_key) +); +CREATE TABLE C ( +pk INTEGER AUTO_INCREMENT, +col_int_key INTEGER NOT NULL, +col_varchar_key VARCHAR(1) NOT NULL, +col_varchar_nokey VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_key, col_varchar_key)), +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key, col_int_key) +); +INSERT INTO C (col_int_key,col_varchar_key) VALUES (0, 'j'),(8, 'v'),(1, 'c'),(8, 'm'),(9, 'd'); +SELECT MIN( alias2 . col_int_key ) AS field1, +COUNT( DISTINCT alias2 . col_varchar_nokey ) AS field2 +FROM ( A AS alias1 , C AS alias2 ) +ORDER BY alias1.col_time_key, alias1.col_datetime_key, alias1.pk ASC; +field1 field2 +NULL 0 +DROP TABLE A,C; +# +# Bug#20566325: WL8149: INNODB: FAILING ASSERTION: +# COL_NR < TABLE->N_DEF +# +CREATE TABLE A ( +pk INTEGER AUTO_INCREMENT, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk) +); +INSERT /*! IGNORE */ INTO A (col_varchar_nokey) VALUES ('k'); +CREATE TABLE CC ( +pk INTEGER AUTO_INCREMENT, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk)); +INSERT INTO CC (col_time_nokey,col_datetime_nokey,col_varchar_nokey) VALUES +('13:06:13.033877','1900-01-01 00:00:00', 'p'), +(NULL, '2007-05-25 11:58:54.015689', 'g'); +SELECT +table1.col_time_key AS field1, +'z' AS field2 +FROM +(CC AS table1 LEFT OUTER JOIN (A AS table2 STRAIGHT_JOIN CC AS table3 ON +(table3.col_varchar_key = table2.col_varchar_nokey)) ON +(table3.col_varchar_key = table2.col_varchar_nokey)) +WHERE +table2.pk != 6 +AND table1.col_varchar_key IN ('l', 's' , 'b' ) +AND table3.col_varchar_key != table1.col_varchar_key +ORDER BY table1.col_varchar_key , field1 , field2; +field1 field2 +DROP TABLE A,CC; +CREATE TABLE cc ( +pk int(11) NOT NULL AUTO_INCREMENT, +col_int_nokey int(11) NOT NULL, +col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) STORED, +col_date_nokey date NOT NULL, +col_date_key date GENERATED ALWAYS AS (col_date_nokey) STORED, +col_datetime_nokey datetime NOT NULL, +col_time_nokey time NOT NULL, +col_datetime_key datetime GENERATED ALWAYS AS (col_datetime_nokey)STORED, +col_time_key time GENERATED ALWAYS AS (col_time_nokey) STORED, +col_varchar_nokey varchar(1) NOT NULL, +col_varchar_key varchar(1) GENERATED ALWAYS AS (col_varchar_nokey)STORED, +PRIMARY KEY (pk), +KEY gc_idx1 (col_int_key), +KEY gc_idx2 (col_varchar_key), +KEY gc_idx3 (col_date_key), +KEY gc_idx4 (col_time_key), +KEY gc_idx5 (col_datetime_key), +KEY gc_idx6 (col_varchar_key,col_int_key), +KEY gc_idx7 (col_date_key,col_datetime_key,col_time_key), +KEY gc_idx8(col_int_key,col_varchar_key,col_date_key,col_time_key, +col_datetime_key) +); +INSERT INTO cc ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES (1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(24, '2000-10-08', '10:14:58.018534', '2006-10-12 04:32:53.031976', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(1, '2008-01-23', '11:14:24.032949', '2004-10-02 20:31:15.022553', 't'); +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; +SELECT DISTINCT alias1.col_varchar_key AS field1 +FROM ( cc AS alias1 STRAIGHT_JOIN +(( cc AS alias2 STRAIGHT_JOIN cc AS alias3 ON +(alias3.col_varchar_key > alias2.col_varchar_key ) ) ) ON +(( alias3 .pk >= alias2.col_int_nokey ) AND +(alias3 .pk >= alias2.col_int_nokey ) )) +WHERE alias1.col_varchar_key <= 'v' +GROUP BY field1 HAVING field1 = 91 +ORDER BY field1, alias1.col_date_key, field1 ASC, field1 DESC, +alias1.col_time_key ASC, field1; +field1 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'c' +Warning 1292 Truncated incorrect DOUBLE value: 't' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +DROP TABLE cc; +SET sql_mode=@save_old_sql_mode; +# +# Bug#20797941: WL8149:ASSERTION !TABLE || +# (!TABLE->READ_SET || BITMAP_IS_SET(TABLE->READ_SET +# +CREATE TABLE t(a int, b int as(a+1)); +INSERT INTO t(a) values(1),(2); +SELECT * FROM t ORDER BY b; +a b +1 2 +2 3 +DROP TABLE t; +DROP TABLE t2, t3; +# +# Bug#21317507:GC: STORED COLUMN REJECTED, BUT VIRTUAL IS ACCEPTED +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +ALTER TABLE t1 DROP COLUMN b; +ALTER TABLE t1 ADD COLUMN c SMALLINT AS (a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +ALTER TABLE t1 DROP COLUMN c; +ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL; +ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL; +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a c +2147483647 127 +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(2147483647); +ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL; +ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY; +ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED +ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED +ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'g' at row 1 +DROP TABLE t1; +# +# Bug#21980430 GCOLS: CRASHING +# +CREATE TABLE t ( +a INT, +b BLOB, +c BLOB GENERATED ALWAYS AS (a+b) VIRTUAL, +UNIQUE KEY i0008 (a) +); +INSERT INTO t(a,b) VALUES(1,'cccc'); +EXPLAIN SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c +WHERE b.b>c.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c +WHERE b.b>c.a; +c +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +DROP TABLE t; +set @optimizer_switch_save = @@optimizer_switch; +set optimizer_switch='mrr_cost_based=off'; +set @read_rnd_buffer_size_save= @@read_rnd_buffer_size; +set read_rnd_buffer_size=32; +CREATE TABLE t0 ( +i1 INTEGER NOT NULL +); +INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t1 ( +pk INTEGER NOT NULL, +i1 INTEGER NOT NULL, +i2 INTEGER NOT NULL, +v1 INTEGER GENERATED ALWAYS AS (i2 + 1) VIRTUAL, +v2 INTEGER GENERATED ALWAYS AS (i1 / (i1 - i2 + 57)) VIRTUAL, +PRIMARY KEY (pk), +INDEX idx(i1) +); +INSERT INTO t1 (pk, i1, i2) +SELECT a0.i1 + a1.i1*10 + a2.i1*100, +a0.i1 + a1.i1*10, +a0.i1 + a1.i1*10 +FROM t0 AS a0, t0 AS a1, t0 AS a2; +EXPLAIN SELECT * FROM t1 +WHERE i1 > 41 AND i1 <= 43; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx idx 4 NULL 19 Using index condition +SELECT * FROM t1 +WHERE i1 > 41 AND i1 <= 43; +pk i1 i2 v1 v2 +142 42 42 43 1 +143 43 43 44 1 +242 42 42 43 1 +243 43 43 44 1 +342 42 42 43 1 +343 43 43 44 1 +42 42 42 43 1 +43 43 43 44 1 +442 42 42 43 1 +443 43 43 44 1 +542 42 42 43 1 +543 43 43 44 1 +642 42 42 43 1 +643 43 43 44 1 +742 42 42 43 1 +743 43 43 44 1 +842 42 42 43 1 +843 43 43 44 1 +942 42 42 43 1 +943 43 43 44 1 +EXPLAIN SELECT * FROM t1 +WHERE v1 > 41 AND v1 <= 43; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +SELECT * FROM t1 +WHERE v1 > 41 AND v1 <= 43; +pk i1 i2 v1 v2 +141 41 41 42 1 +142 42 42 43 1 +241 41 41 42 1 +242 42 42 43 1 +341 41 41 42 1 +342 42 42 43 1 +41 41 41 42 1 +42 42 42 43 1 +441 41 41 42 1 +442 42 42 43 1 +541 41 41 42 1 +542 42 42 43 1 +641 41 41 42 1 +642 42 42 43 1 +741 41 41 42 1 +742 42 42 43 1 +841 41 41 42 1 +842 42 42 43 1 +941 41 41 42 1 +942 42 42 43 1 +DROP TABLE t0, t1; +set optimizer_switch= @optimizer_switch_save; +set @@read_rnd_buffer_size= @read_rnd_buffer_size_save; +# +# Bug#21872184 CONDITIONAL JUMP AT JOIN_CACHE::WRITE_RECORD_DATA IN +# SQL_JOIN_BUFFER.CC +# +# +# Test 1: Dynamic range scan with one covering index +# +CREATE TABLE t1 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t1 +VALUES (10, 'c'), (10, 'i'), (2, 't'), (4, 'g'); +CREATE TABLE t2 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t2 +VALUES (2, 'k'), (9, 'k'), (7, 'o'), (5, 'n'), (7, 'e'); +CREATE TABLE t3 ( +pk INTEGER NOT NULL, +i1 INTEGER, +i2_key INTEGER GENERATED ALWAYS AS (i1 + i1) VIRTUAL, +PRIMARY KEY (pk) +); +INSERT INTO t3 (pk, i1) +VALUES (1, 1), (2, 48), (3, 228), (4, 3), (5, 5), +(6, 39), (7, 6), (8, 8), (9, 3); +CREATE TABLE t4 ( +i1 INTEGER NOT NULL, +c1 VARCHAR(1) NOT NULL +); +INSERT INTO t4 +VALUES (1, 'j'), (2, 'c'), (0, 'a'); +ANALYZE TABLE t1, t2, t3, t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 2: Two alternative covering indexes for the range scan +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 3: One covering index including the base column for the virtual +# column +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +# +# Test 4: One non-covering index +# +# Add more data to the table so that it will run the dynamic range scan +# as both table scan and range scan (the purpose of this is to make the +# table scan more expensive). +INSERT INTO t3 (pk, i1) +VALUES (10,1), (11,1), (12,1), (13,1), (14,1),(15,1), (16,1),(17,1), (18,1), +(19,1), (20,1), (21,1), (22,1), (23,1), (24,1),(25,1),(26,1),(27,1), +(28,1), (29,1); +# Change the query to read an extra column (t3.i1) making the index +# non-covering. +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' + ) +) +AND t1.i1 <= t3.i2_key; +c1 i1 i1 +c 2 48 +c 5 48 +c 7 48 +c 7 48 +c 9 48 +g 2 48 +g 5 48 +g 7 48 +g 7 48 +g 9 48 +i 2 48 +i 5 48 +i 7 48 +i 7 48 +i 9 48 +t 2 1 +t 2 48 +t 5 1 +t 5 48 +t 7 1 +t 7 1 +t 7 48 +t 7 48 +t 9 1 +t 9 48 +# +# Test 5: Test where the added primary key to secondary indexes is +# used after it has been included in the join buffer +# +EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) +) +) +AND t1.i1 <= t3.i2_key; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join) +SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 +FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 +WHERE ( t3.pk IN +( +SELECT /*+ QB_NAME(subq1) */ t4.i1 +FROM t4 +WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) +) +) +AND t1.i1 <= t3.i2_key; +c1 i1 +c 2 +c 5 +c 7 +c 7 +c 9 +g 2 +g 5 +g 7 +g 7 +g 9 +i 2 +i 5 +i 7 +i 7 +i 9 +t 2 +t 2 +t 5 +t 5 +t 7 +t 7 +t 7 +t 7 +t 9 +t 9 +DROP TABLE t1, t2, t3, t4; +SET optimizer_switch='derived_merge=default'; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result new file mode 100644 index 00000000000..72021909e0f --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result @@ -0,0 +1,3000 @@ +SET @@session.default_storage_engine = 'InnoDB'; +set time_zone="+03:00"; +# +# NUMERIC FUNCTIONS +# +# ABS() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (abs(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (abs(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-1, default); +select * from t1; +a b +-1 1 +drop table t1; +set sql_warnings = 0; +# ACOS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(acos(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(acos(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1, default); +insert into t1 values (1.0001,default); +insert into t1 values (0,default); +select * from t1; +a b +0 1.570796 +1 0 +1.0001 NULL +drop table t1; +set sql_warnings = 0; +# ASIN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(asin(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(asin(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (0.2, default); +insert into t1 values (1.0001,default); +select * from t1; +a b +0.2 0.201358 +1.0001 NULL +drop table t1; +set sql_warnings = 0; +#ATAN +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(atan(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(atan(a,b),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-2,2,default); +insert into t1 values (format(PI(),6),0,default); +select * from t1; +a b c +-2 2 -0.785398 +3.141593 0 1.570796 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, c double generated always as (format(atan(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `c` double AS (format(atan(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-2,default); +insert into t1 values (format(PI(),6),default); +select * from t1; +a c +-2 -1.107149 +3.141593 1.262627 +drop table t1; +set sql_warnings = 0; +# ATAN2 +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(atan2(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(atan2(a,b),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-2,2,default); +insert into t1 values (format(PI(),6),0,default); +select * from t1; +a b c +-2 2 -0.785398 +3.141593 0 1.570796 +drop table t1; +set sql_warnings = 0; +# CEIL() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (ceil(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (ceil(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1.23,default); +insert into t1 values (-1.23,default); +select * from t1; +a b +-1.23 -1 +1.23 2 +drop table t1; +set sql_warnings = 0; +# CONV() +set sql_warnings = 1; +create table t1 (a varchar(10), b int, c int, d varchar(10) generated always as (conv(a,b,c)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(10) AS (conv(a,b,c)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a',16,2,default); +insert into t1 values ('6e',18,8,default); +insert into t1 values (-17,10,-18,default); +insert into t1 values (10+'10'+'10'+0xa,10,10,default); +select * from t1; +a b c d +-17 10 -18 -H +40 10 10 40 +6e 18 8 172 +a 16 2 1010 +drop table t1; +set sql_warnings = 0; +# COS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(cos(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(cos(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +select * from t1; +a b +3.141593 -1 +drop table t1; +set sql_warnings = 0; +# COT() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(cot(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(cot(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (12,default); +select * from t1; +a b +12 -1.572673 +drop table t1; +set sql_warnings = 0; +# CRC32() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (crc32(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (crc32(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +insert into t1 values ('mysql',default); +select * from t1; +a b +MySQL 3259397556 +mysql 2501908538 +drop table t1; +set sql_warnings = 0; +# DEGREES() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(degrees(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(degrees(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +insert into t1 values (format(PI()/2,6),default); +select * from t1; +a b +1.570796 89.999981 +3.141593 180.00002 +drop table t1; +set sql_warnings = 0; +# / +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a/2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a/2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +select * from t1; +a b +2 1 +drop table t1; +set sql_warnings = 0; +# EXP() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(exp(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(exp(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +insert into t1 values (0,default); +select * from t1; +a b +-2 0.135335 +0 1 +2 7.389056 +drop table t1; +set sql_warnings = 0; +# FLOOR() +set sql_warnings = 1; +create table t1 (a double, b bigint generated always as (floor(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` bigint(20) AS (floor(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1.23,default); +insert into t1 values (-1.23,default); +select * from t1; +a b +-1.23 -2 +1.23 1 +drop table t1; +set sql_warnings = 0; +# LN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(ln(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(ln(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +select * from t1; +a b +-2 NULL +2 0.693147 +drop table t1; +set sql_warnings = 0; +# LOG() +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(log(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(log(a,b),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,65536,default); +insert into t1 values (10,100,default); +insert into t1 values (1,100,default); +select * from t1; +a b c +1 100 NULL +10 100 2 +2 65536 16 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +select * from t1; +a b +-2 NULL +2 0.693147 +drop table t1; +set sql_warnings = 0; +# LOG2() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log2(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log2(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (65536,default); +insert into t1 values (-100,default); +select * from t1; +a b +-100 NULL +65536 16 +drop table t1; +set sql_warnings = 0; +# LOG10() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log10(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log10(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (100,default); +insert into t1 values (-100,default); +select * from t1; +a b +-100 NULL +100 2 +2 0.30103 +drop table t1; +set sql_warnings = 0; +# - +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a-1) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a-1) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +select * from t1; +a b +2 1 +drop table t1; +set sql_warnings = 0; +# MOD() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (mod(a,10)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (mod(a,10)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (11,default); +select * from t1; +a b +1 1 +11 1 +drop table t1; +set sql_warnings = 0; +# % +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a % 10) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 10) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (11,default); +select * from t1; +a b +1 1 +11 1 +drop table t1; +set sql_warnings = 0; +# OCT() +set sql_warnings = 1; +create table t1 (a double, b varchar(10) generated always as (oct(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` varchar(10) AS (oct(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 14 +drop table t1; +set sql_warnings = 0; +# PI() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(PI()*a*a,6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(PI()*a*a,6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +select * from t1; +a b +1 3.141593 +drop table t1; +set sql_warnings = 0; +# + +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a+1) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a+1) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +select * from t1; +a b +1 2 +drop table t1; +set sql_warnings = 0; +# POW, POWER +set sql_warnings = 1; +create table t1 (a int, b int generated always as (pow(a,2)) virtual, c int generated always as (power(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (pow(a,2)) VIRTUAL, + `c` int(11) AS (power(a,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default,default); +insert into t1 values (2,default,default); +select * from t1; +a b c +1 1 1 +2 4 4 +drop table t1; +set sql_warnings = 0; +# RADIANS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(radians(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(radians(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (90,default); +select * from t1; +a b +90 1.570796 +drop table t1; +set sql_warnings = 0; +# ROUND() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (round(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (round(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-1.23,default); +insert into t1 values (-1.58,default); +insert into t1 values (1.58,default); +select * from t1; +a b +-1.23 -1 +-1.58 -2 +1.58 2 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, b double, c int generated always as (round(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` int(11) AS (round(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1.298,1,default); +insert into t1 values (1.298,0,default); +insert into t1 values (23.298,-1,default); +select * from t1; +a b c +1.298 0 1 +1.298 1 1 +23.298 -1 20 +drop table t1; +set sql_warnings = 0; +# SIGN() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (sign(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (sign(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-32,default); +insert into t1 values (0,default); +insert into t1 values (234,default); +select * from t1; +a b +-32 -1 +0 0 +234 1 +drop table t1; +set sql_warnings = 0; +# SIN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(sin(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(sin(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (format(PI()/2,6),default); +select * from t1; +a b +1.570796 1 +drop table t1; +set sql_warnings = 0; +# SQRT() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(sqrt(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(sqrt(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (4,default); +insert into t1 values (20,default); +insert into t1 values (-16,default); +select * from t1; +a b +-16 NULL +20 4.472136 +4 2 +drop table t1; +set sql_warnings = 0; +# TAN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(tan(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(tan(a),6)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +insert into t1 values (format(PI()+1,6),default); +select * from t1; +a b +3.141593 0 +4.141593 1.557409 +drop table t1; +set sql_warnings = 0; +# * +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a*3) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a*3) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +a b +0 0 +1 3 +2 6 +drop table t1; +set sql_warnings = 0; +# TRUNCATE() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (truncate(a,4)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (truncate(a,4)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1.223,default); +insert into t1 values (1.999,default); +insert into t1 values (1.999,default); +insert into t1 values (122,default); +select * from t1; +a b +1.223 1.223 +1.999 1.999 +1.999 1.999 +122 122 +drop table t1; +set sql_warnings = 0; +# Unary - +set sql_warnings = 1; +create table t1 (a double, b double generated always as (-a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (-a) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +select * from t1; +a b +-1 1 +1 -1 +drop table t1; +set sql_warnings = 0; +# +# STRING FUNCTIONS +# +# ASCII() +set sql_warnings = 1; +create table t1 (a char(2), b int generated always as (ascii(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(2) DEFAULT NULL, + `b` int(11) AS (ascii(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2',default); +insert into t1 values (2,default); +insert into t1 values ('dx',default); +select * from t1; +a b +2 50 +2 50 +dx 100 +drop table t1; +set sql_warnings = 0; +# BIN() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (bin(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (bin(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 1100 +drop table t1; +set sql_warnings = 0; +# BIT_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (bit_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (bit_length(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 32 +drop table t1; +set sql_warnings = 0; +# CHAR_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (char_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (char_length(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# CHAR() +set sql_warnings = 1; +create table t1 (a int, b int, c varbinary(10) generated always as (char(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` varbinary(10) AS (char(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (77,121,default); +select * from t1; +a b c +77 121 My +drop table t1; +set sql_warnings = 0; +# CHARACTER_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (character_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (character_length(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# CONCAT_WS() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (concat_ws(',',a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',default); +select * from t1; +a b c +value1 value2 value1,value2 +drop table t1; +set sql_warnings = 0; +# CONCAT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (concat(a,',',b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (concat(a,',',b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',default); +select * from t1; +a b c +value1 value2 value1,value2 +drop table t1; +set sql_warnings = 0; +# ELT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int, d varchar(10) generated always as (elt(c,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(10) AS (elt(c,a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',1,default); +insert into t1 values ('value1','value2',2,default); +select * from t1; +a b c d +value1 value2 1 value1 +value1 value2 2 value2 +drop table t1; +set sql_warnings = 0; +# EXPORT_SET() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (export_set(a,'1','0','',10)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (6,default); +select * from t1; +a b +6 0110000000 +drop table t1; +set sql_warnings = 0; +# FIELD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (field('aa',a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (field('aa',a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('aa','bb',default); +insert into t1 values ('bb','aa',default); +select * from t1; +a b c +aa bb 1 +bb aa 2 +drop table t1; +set sql_warnings = 0; +# FIND_IN_SET() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (find_in_set(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (find_in_set(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('aa','aa,bb,cc',default); +insert into t1 values ('aa','bb,aa,cc',default); +select * from t1; +a b c +aa aa,bb,cc 1 +aa bb,aa,cc 2 +drop table t1; +set sql_warnings = 0; +# FORMAT() +set sql_warnings = 1; +create table t1 (a double, b varchar(20) generated always as (format(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` varchar(20) AS (format(a,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (12332.123456,default); +select * from t1; +a b +12332.123456 12,332.12 +drop table t1; +set sql_warnings = 0; +# HEX() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (hex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (hex(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (17,default); +select * from t1; +a b +17 11 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (hex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (hex(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 616263 +drop table t1; +set sql_warnings = 0; +# INSERT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (insert(a,length(a),length(b),b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('start,','end',default); +select * from t1; +a b c +start, end startend +drop table t1; +set sql_warnings = 0; +# INSTR() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (instr(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (instr(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar,','bar',default); +insert into t1 values ('xbar,','foobar',default); +select * from t1; +a b c +foobarbar, bar 4 +xbar, foobar 0 +drop table t1; +set sql_warnings = 0; +# LCASE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lcase(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lcase(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL mysql +drop table t1; +set sql_warnings = 0; +# LEFT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(5) generated always as (left(a,5)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(5) AS (left(a,5)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar fooba +drop table t1; +set sql_warnings = 0; +# LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b int generated always as (length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) AS (length(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a like 'H%o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a like 'H%o') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 1 +MySQL 0 +drop table t1; +set sql_warnings = 0; +# LOCATE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (locate('bar',a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (locate('bar',a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar 4 +drop table t1; +set sql_warnings = 0; +# LOWER() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lower(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lower(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL mysql +drop table t1; +set sql_warnings = 0; +# LPAD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lpad(a,4,' ')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +insert into t1 values ('M',default); +select * from t1; +a b +M M +MySQL MySQ +drop table t1; +set sql_warnings = 0; +# LTRIM() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (ltrim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (ltrim(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (' MySQL',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b + MySQL MySQL +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# MAKE_SET() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int, d varchar(30) generated always as (make_set(c,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',1,default); +insert into t1 values ('a','b',3,default); +select * from t1; +a b c d +a b 1 a +a b 3 a,b +drop table t1; +set sql_warnings = 0; +# MID() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (mid(a,1,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (mid(a,1,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar fo +drop table t1; +set sql_warnings = 0; +# NOT LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a not like 'H%o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a not like 'H%o') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 0 +MySQL 1 +drop table t1; +set sql_warnings = 0; +# NOT REGEXP +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a not regexp 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('hello',default); +select * from t1; +a b +Hello 0 +hello 0 +drop table t1; +set sql_warnings = 0; +# OCTET_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b int generated always as (octet_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) AS (octet_length(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# ORD() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (ord(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (ord(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2',default); +select * from t1; +a b +2 50 +drop table t1; +set sql_warnings = 0; +# POSITION() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (position('bar' in a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (position('bar' in a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar 4 +drop table t1; +set sql_warnings = 0; +# QUOTE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (quote(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (quote(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Don\'t',default); +select * from t1; +a b +Don't 'Don\'t' +drop table t1; +set sql_warnings = 0; +# REGEXP() +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a regexp 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('hello',default); +select * from t1; +a b +Hello 1 +hello 1 +drop table t1; +set sql_warnings = 0; +# REPEAT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (repeat(a,3)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (repeat(a,3)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQLMySQLMySQL +drop table t1; +set sql_warnings = 0; +# REPLACE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (replace(a,'aa','bb')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('maa',default); +select * from t1; +a b +maa mbb +drop table t1; +set sql_warnings = 0; +# REVERSE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (reverse(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (reverse(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('maa',default); +select * from t1; +a b +maa aam +drop table t1; +set sql_warnings = 0; +# RIGHT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (right(a,4)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (right(a,4)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar rbar +drop table t1; +set sql_warnings = 0; +# RLIKE() +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a rlike 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 1 +MySQL 0 +drop table t1; +set sql_warnings = 0; +# RPAD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (rpad(a,4,'??')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('He',default); +select * from t1; +a b +He He?? +drop table t1; +set sql_warnings = 0; +# RTRIM(); +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (rtrim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (rtrim(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello ',default); +select * from t1; +a b +Hello Hello +drop table t1; +set sql_warnings = 0; +# SOUNDEX() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(20) generated always as (soundex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(20) AS (soundex(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello H400 +drop table t1; +set sql_warnings = 0; +# SOUNDS LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a sounds like b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a sounds like b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello','Hello',default); +insert into t1 values ('Hello','MySQL',default); +insert into t1 values ('Hello','hello',default); +select * from t1; +a b c +Hello Hello 1 +Hello MySQL 0 +Hello hello 1 +drop table t1; +set sql_warnings = 0; +# SPACE() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (concat(a,space(5))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (concat(a,space(5))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello', default); +select * from t1; +a b +Hello Hello +drop table t1; +set sql_warnings = 0; +# STRCMP() +set sql_warnings = 1; +create table t1 (a varchar(9), b varchar(9), c tinyint(1) generated always as (strcmp(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(9) DEFAULT NULL, + `b` varchar(9) DEFAULT NULL, + `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello','Hello', default); +insert into t1 values ('Hello','Hello1', default); +select * from t1; +a b c +Hello Hello 0 +Hello Hello1 -1 +drop table t1; +set sql_warnings = 0; +# SUBSTR() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (substr(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (substr(a,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello ello +drop table t1; +set sql_warnings = 0; +# SUBSTRING_INDEX() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (substring_index(a,'.',2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('www.mysql.com',default); +select * from t1; +a b +www.mysql.com www.mysql +drop table t1; +set sql_warnings = 0; +# SUBSTRING() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (substring(a from 2 for 2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello el +drop table t1; +set sql_warnings = 0; +# TRIM() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (trim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (trim(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (' aa ',default); +select * from t1; +a b + aa aa +drop table t1; +set sql_warnings = 0; +# UCASE() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (ucase(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (ucase(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQL +drop table t1; +set sql_warnings = 0; +# UNHEX() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (unhex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (unhex(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('4D7953514C',default); +select * from t1; +a b +4D7953514C MySQL +drop table t1; +set sql_warnings = 0; +# UPPER() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (upper(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (upper(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQL +drop table t1; +set sql_warnings = 0; +# WEIGHT_STRING() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (weight_string(a as char(4))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (weight_string(a as char(4))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQ +drop table t1; +set sql_warnings = 0; +# +# CONTROL FLOW FUNCTIONS +# +# CASE +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(16) generated always as (case a when NULL then 'asd' when 'b' then 'B' else a end) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (NULL,default); +insert into t1 values ('b',default); +insert into t1 values ('c',default); +select * from t1; +a b +NULL NULL +b B +c c +drop table t1; +set sql_warnings = 0; +# IF +set sql_warnings = 1; +create table t1 (a int, b int, c int generated always as (if(a=1,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS (if(a=1,a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,2,default); +insert into t1 values (3,4,default); +select * from t1; +a b c +1 2 1 +3 4 4 +drop table t1; +set sql_warnings = 0; +# IFNULL +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(10) generated always as (ifnull(a,'DEFAULT')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (NULL,'adf',default); +insert into t1 values ('a','adf',default); +select * from t1; +a b c +NULL adf DEFAULT +a adf a +drop table t1; +set sql_warnings = 0; +# NULLIF +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (nullif(a,'DEFAULT')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('DEFAULT',default); +insert into t1 values ('a',default); +select * from t1; +a b +DEFAULT NULL +a a +drop table t1; +set sql_warnings = 0; +# +# OPERATORS +# +# AND, && +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a>0 && a<2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a>0 && a<2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 0 +1 1 +drop table t1; +set sql_warnings = 0; +# BETWEEN ... AND ... +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a between 0 and 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a between 0 and 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 0 +1 1 +drop table t1; +set sql_warnings = 0; +# BINARY +set sql_warnings = 1; +create table t1 (a varchar(10), b varbinary(10) generated always as (binary a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varbinary(10) AS (binary a) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('11',default); +insert into t1 values (1,default); +select * from t1; +a b +1 1 +11 11 +drop table t1; +set sql_warnings = 0; +# & +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a & 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a & 5) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +select * from t1; +a b +0 0 +1 1 +drop table t1; +set sql_warnings = 0; +# ~ +set sql_warnings = 1; +create table t1 (a int, b int generated always as (~a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (~a) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +select * from t1; +a b +1 2147483647 +drop table t1; +set sql_warnings = 0; +# | +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a | 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a | 5) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +insert into t1 values (2,default); +select * from t1; +a b +0 5 +1 5 +2 7 +drop table t1; +set sql_warnings = 0; +# ^ +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a ^ 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a ^ 5) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +insert into t1 values (2,default); +select * from t1; +a b +0 5 +1 4 +2 7 +drop table t1; +set sql_warnings = 0; +# DIV +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a div 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a div 5) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (7,default); +select * from t1; +a b +1 0 +7 1 +drop table t1; +set sql_warnings = 0; +# <=> +set sql_warnings = 1; +create table t1 (a int, b int, c bool generated always as (a <=> b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` tinyint(1) AS (a <=> b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,1,default); +insert into t1 values (NULL,NULL,default); +insert into t1 values (1,NULL,default); +select * from t1; +a b c +1 1 1 +1 NULL 0 +NULL NULL 1 +drop table t1; +set sql_warnings = 0; +# = +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a=b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a=b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 1 +a b 0 +drop table t1; +set sql_warnings = 0; +# >= +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a >= b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a >= b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 1 +a b 0 +drop table t1; +set sql_warnings = 0; +# > +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a > b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a > b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 0 +a b 0 +drop table t1; +set sql_warnings = 0; +# IS NOT NULL +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a is not null) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a is not null) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (NULL,default); +select * from t1; +a b +1 1 +NULL 0 +drop table t1; +set sql_warnings = 0; +# IS NULL +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a is null) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a is null) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (NULL,default); +select * from t1; +a b +1 0 +NULL 1 +drop table t1; +set sql_warnings = 0; +# << +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a << 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a << 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (3,default); +select * from t1; +a b +1 4 +3 12 +drop table t1; +set sql_warnings = 0; +# <= +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a <= b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a <= b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 0 +b b 1 +b c 1 +drop table t1; +set sql_warnings = 0; +# < +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a < b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a < b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 0 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# NOT BETWEEN ... AND ... +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a not between 0 and 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 1 +1 0 +drop table t1; +set sql_warnings = 0; +# <> +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a <> b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a <> b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 1 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# != +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a != b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a != b) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 1 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# ||, OR +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a>5 || a<3) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a>5 || a<3) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (4,default); +select * from t1; +a b +1 1 +4 0 +drop table t1; +set sql_warnings = 0; +# >> +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a >> 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a >> 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (8,default); +insert into t1 values (3,default); +select * from t1; +a b +3 0 +8 2 +drop table t1; +set sql_warnings = 0; +# XOR +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a xor 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a xor 5) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +a b +0 1 +1 0 +2 0 +drop table t1; +set sql_warnings = 0; +# +# DATE AND TIME FUNCTIONS +# +# ADDDATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (adddate(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-09-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# ADDTIME() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (addtime(a,'02:00:00')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-31 02:00:00 +drop table t1; +set sql_warnings = 0; +# CONVERT_TZ() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (convert_tz(a,'MET','UTC')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-30 22:00:00 +drop table t1; +set sql_warnings = 0; +# DATE_ADD() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date_add(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-09-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATE_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(64) generated always as (date_format(a,'%W %M %D')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 Sunday August 31st +drop table t1; +set sql_warnings = 0; +# DATE_SUB() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date_sub(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-07-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:00:00',default); +select * from t1; +a b +2008-08-31 02:00:00 2008-08-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATEDIFF() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (datediff(a,'2000-01-01')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (datediff(a,'2000-01-01')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 3165 +drop table t1; +set sql_warnings = 0; +# DAY() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (day(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (day(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31 +drop table t1; +set sql_warnings = 0; +# DAYNAME() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(10) generated always as (dayname(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(10) AS (dayname(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 Sunday +drop table t1; +set sql_warnings = 0; +# DAYOFMONTH() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofmonth(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofmonth(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31 +drop table t1; +set sql_warnings = 0; +# DAYOFWEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofweek(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofweek(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 1 +drop table t1; +set sql_warnings = 0; +# DAYOFYEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofyear(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofyear(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 244 +drop table t1; +set sql_warnings = 0; +# EXTRACT +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (extract(year from a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (extract(year from a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008 +drop table t1; +set sql_warnings = 0; +# FROM_DAYS() +set sql_warnings = 1; +create table t1 (a bigint, b datetime generated always as (from_days(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` datetime AS (from_days(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (730669,default); +select * from t1; +a b +730669 2000-07-03 00:00:00 +drop table t1; +set sql_warnings = 0; +# FROM_UNIXTIME() +set sql_warnings = 1; +create table t1 (a bigint, b datetime generated always as (from_unixtime(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` datetime AS (from_unixtime(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1196440219,default); +select * from t1; +a b +1196440219 2007-11-30 19:30:19 +drop table t1; +set sql_warnings = 0; +# GET_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(32) generated always as (date_format(a,get_format(DATE,'EUR'))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31.08.2008 +drop table t1; +set sql_warnings = 0; +# HOUR() +set sql_warnings = 1; +create table t1 (a time, b bigint generated always as (hour(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` bigint(20) AS (hour(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('10:05:03',default); +select * from t1; +a b +10:05:03 10 +drop table t1; +set sql_warnings = 0; +# LAST_DAY() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (last_day(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (last_day(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2003-02-05',default); +insert into t1 values ('2003-02-32',default); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a b +0000-00-00 00:00:00 NULL +2003-02-05 00:00:00 2003-02-28 00:00:00 +drop table t1; +set sql_warnings = 0; +# MAKEDATE() +set sql_warnings = 1; +create table t1 (a int, b datetime generated always as (makedate(a,1)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` datetime AS (makedate(a,1)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2001,default); +select * from t1; +a b +2001 2001-01-01 00:00:00 +drop table t1; +set sql_warnings = 0; +# MAKETIME() +set sql_warnings = 1; +create table t1 (a int, b time generated always as (maketime(a,1,3)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` time AS (maketime(a,1,3)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 12:01:03 +drop table t1; +set sql_warnings = 0; +# MICROSECOND() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (microsecond(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (microsecond(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 12:00:00.123456',default); +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 12:00:00 0 +2009-12-31 23:59:59 0 +drop table t1; +set sql_warnings = 0; +# MINUTE() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (minute(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (minute(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 59 +drop table t1; +set sql_warnings = 0; +# MONTH() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (month(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (month(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 12 +drop table t1; +set sql_warnings = 0; +# MONTHNAME() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(16) generated always as (monthname(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(16) AS (monthname(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 December +drop table t1; +set sql_warnings = 0; +# PERIOD_ADD() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (period_add(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (period_add(a,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (200801,default); +select * from t1; +a b +200801 200803 +drop table t1; +set sql_warnings = 0; +# PERIOD_DIFF() +set sql_warnings = 1; +create table t1 (a int, b int, c int generated always as (period_diff(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS (period_diff(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (200802,200703,default); +select * from t1; +a b c +200802 200703 11 +drop table t1; +set sql_warnings = 0; +# QUARTER() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (quarter(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (quarter(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 3 +drop table t1; +set sql_warnings = 0; +# SEC_TO_TIME() +set sql_warnings = 1; +create table t1 (a bigint, b time generated always as (sec_to_time(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` time AS (sec_to_time(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (2378,default); +select * from t1; +a b +2378 00:39:38 +drop table t1; +set sql_warnings = 0; +# SECOND() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (second(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (second(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('10:05:03',default); +select * from t1; +a b +2010-05-03 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# STR_TO_DATE() +set sql_warnings = 1; +create table t1 (a varchar(64), b datetime generated always as (str_to_date(a,'%m/%d/%Y')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) DEFAULT NULL, + `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('04/30/2004',default); +select * from t1; +a b +04/30/2004 2004-04-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# SUBDATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (subdate(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-07-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# SUBTIME() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (subtime(a,'02:00:00')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-30 22:00:00 +drop table t1; +set sql_warnings = 0; +# TIME_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(32) generated always as (time_format(a,'%r')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:03:04',default); +select * from t1; +a b +2008-08-31 02:03:04 02:03:04 AM +drop table t1; +set sql_warnings = 0; +# TIME_TO_SEC() +set sql_warnings = 1; +create table t1 (a time, b bigint generated always as (time_to_sec(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` bigint(20) AS (time_to_sec(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('22:23:00',default); +select * from t1; +a b +22:23:00 80580 +drop table t1; +set sql_warnings = 0; +# TIME() +set sql_warnings = 1; +create table t1 (a datetime, b time generated always as (time(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` time AS (time(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:03:04',default); +select * from t1; +a b +2008-08-31 02:03:04 02:03:04 +drop table t1; +set sql_warnings = 0; +# TIMEDIFF() +set sql_warnings = 1; +create table t1 (a datetime, b datetime, c time generated always as (timediff(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` time AS (timediff(a,b)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); +select * from t1; +a b c +2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58 +drop table t1; +set sql_warnings = 0; +# TIMESTAMP() +set sql_warnings = 1; +create table t1 (a datetime, b timestamp generated always as (timestamp(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` timestamp AS (timestamp(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-12-31',default); +select * from t1; +a b +2008-12-31 00:00:00 2008-12-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# TIMESTAMPADD() +set sql_warnings = 1; +create table t1 (a datetime, b timestamp generated always as (timestampadd(minute,1,a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2003-01-02',default); +select * from t1; +a b +2003-01-02 00:00:00 2003-01-02 00:01:00 +drop table t1; +set sql_warnings = 0; +# TIMESTAMPDIFF() +set sql_warnings = 1; +create table t1 (a timestamp, c bigint generated always as (timestampdiff(MONTH, a, a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c` bigint(20) AS (timestampdiff(MONTH, a, a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2003-02-01',default); +select * from t1; +a c +2003-02-01 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# TO_DAYS() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (to_days(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (to_days(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2007-10-07',default); +select * from t1; +a b +2007-10-07 00:00:00 733321 +drop table t1; +set sql_warnings = 0; +# WEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (week(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (week(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 35 +drop table t1; +set sql_warnings = 0; +# WEEKDAY() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (weekday(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (weekday(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# WEEKOFYEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (weekofyear(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (weekofyear(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 36 +drop table t1; +set sql_warnings = 0; +# YEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (year(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (year(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 2008 +drop table t1; +set sql_warnings = 0; +# YEARWEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (yearweek(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (yearweek(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 200835 +drop table t1; +set sql_warnings = 0; +# +# FULL TEXT SEARCH FUNCTIONS +# +# None. +# +# CAST FUNCTIONS AND OPERATORS +# +# CAST() +set sql_warnings = 1; +create table t1 (a int, b bigint unsigned generated always as (cast(a as unsigned)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` bigint(20) unsigned AS (cast(a as unsigned)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +select * from t1; +a b +-1 18446744073709551615 +1 1 +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warnings: +drop table t1; +set sql_warnings = 0; +# Convert() +set sql_warnings = 1; +create table t1 (a int, b bigint unsigned generated always as (convert(a,unsigned)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` bigint(20) unsigned AS (convert(a,unsigned)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +select * from t1; +a b +-1 18446744073709551615 +1 1 +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warnings: +drop table t1; +set sql_warnings = 0; +# +# XML FUNCTIONS +# +# ExtractValue() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (ExtractValue(a,'/b')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (ExtractValue(a,'/b')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text text +drop table t1; +set sql_warnings = 0; +# None. +# +# OTHER FUNCTIONS +# +# AES_DECRYPT(), AES_ENCRYPT() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (aes_encrypt(aes_decrypt(a,'adf'),'adf')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL NULL +drop table t1; +set sql_warnings = 0; +# BIT_COUNT() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (bit_count(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (bit_count(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values (5,default); +select * from t1; +a b +5 2 +drop table t1; +set sql_warnings = 0; +# CHARSET() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (charset(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (charset(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc latin1 +drop table t1; +set sql_warnings = 0; +# COERCIBILITY() +set sql_warnings = 1; +create table t1 (a varchar(1024), b int generated always as (coercibility(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` int(11) AS (coercibility(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 2 +drop table t1; +set sql_warnings = 0; +# COLLATION() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (collation(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (collation(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc latin1_swedish_ci +drop table t1; +set sql_warnings = 0; +# COMPRESS(), UNCOMPRESS() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (uncompress(compress(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# ENCODE(), DECODE() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (decode(encode(a,'abc'),'abc')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# DEFAULT() +set sql_warnings = 1; +create table t1 (a varchar(1024) default 'aaa', b varchar(1024) generated always as (ifnull(a,default(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT 'aaa', + `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('any value',default); +select * from t1; +a b +any value any value +drop table t1; +set sql_warnings = 0; +# DES_ENCRYPT(), DES_DECRYPT() +create table t1 (a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (des_encrypt(des_decrypt(a,'adf'),'adf')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL ÿw2¥ð +èõÁ +drop table t1; +# INET_ATON(), INET_NTOA() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('127.0.0.1',default); +select * from t1; +a b +127.0.0.1 127.0.0.1 +drop table t1; +set sql_warnings = 0; +# MD5() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varbinary(32) generated always as (md5(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varbinary(32) AS (md5(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('testing',default); +select * from t1; +a b +testing ae2b1fca515949e5d54fb22b8ed95575 +drop table t1; +set sql_warnings = 0; +# PASSWORD() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (password(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (password(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('badpwd',default); +select * from t1; +a b +badpwd *AAB3E285149C0135D51A520E1940DD3263DC008C +drop table t1; +set sql_warnings = 0; +# SHA1() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha1(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha1(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc a9993e364706816aba3e25717850c26c9cd0d89d +drop table t1; +set sql_warnings = 0; +# SHA() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha(a)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc a9993e364706816aba3e25717850c26c9cd0d89d +drop table t1; +set sql_warnings = 0; +# SHA2() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha2(a,224)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha2(a,224)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 +drop table t1; +set sql_warnings = 0; +# UNCOMPRESSED_LENGTH() +set sql_warnings = 1; +create table t1 (a char, b varchar(1024) generated always as (uncompressed_length(compress(repeat(a,30)))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a',default); +select * from t1; +a b +a 30 +drop table t1; +set sql_warnings = 0; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result new file mode 100644 index 00000000000..add3a6a3fe0 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result @@ -0,0 +1,3000 @@ +SET @@session.default_storage_engine = 'MyISAM'; +set time_zone="+03:00"; +# +# NUMERIC FUNCTIONS +# +# ABS() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (abs(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (abs(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-1, default); +select * from t1; +a b +-1 1 +drop table t1; +set sql_warnings = 0; +# ACOS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(acos(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(acos(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1, default); +insert into t1 values (1.0001,default); +insert into t1 values (0,default); +select * from t1; +a b +0 1.570796 +1 0 +1.0001 NULL +drop table t1; +set sql_warnings = 0; +# ASIN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(asin(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(asin(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0.2, default); +insert into t1 values (1.0001,default); +select * from t1; +a b +0.2 0.201358 +1.0001 NULL +drop table t1; +set sql_warnings = 0; +#ATAN +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(atan(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(atan(a,b),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-2,2,default); +insert into t1 values (format(PI(),6),0,default); +select * from t1; +a b c +-2 2 -0.785398 +3.141593 0 1.570796 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, c double generated always as (format(atan(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `c` double AS (format(atan(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-2,default); +insert into t1 values (format(PI(),6),default); +select * from t1; +a c +-2 -1.107149 +3.141593 1.262627 +drop table t1; +set sql_warnings = 0; +# ATAN2 +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(atan2(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(atan2(a,b),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-2,2,default); +insert into t1 values (format(PI(),6),0,default); +select * from t1; +a b c +-2 2 -0.785398 +3.141593 0 1.570796 +drop table t1; +set sql_warnings = 0; +# CEIL() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (ceil(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (ceil(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1.23,default); +insert into t1 values (-1.23,default); +select * from t1; +a b +-1.23 -1 +1.23 2 +drop table t1; +set sql_warnings = 0; +# CONV() +set sql_warnings = 1; +create table t1 (a varchar(10), b int, c int, d varchar(10) generated always as (conv(a,b,c)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(10) AS (conv(a,b,c)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a',16,2,default); +insert into t1 values ('6e',18,8,default); +insert into t1 values (-17,10,-18,default); +insert into t1 values (10+'10'+'10'+0xa,10,10,default); +select * from t1; +a b c d +-17 10 -18 -H +40 10 10 40 +6e 18 8 172 +a 16 2 1010 +drop table t1; +set sql_warnings = 0; +# COS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(cos(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(cos(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +select * from t1; +a b +3.141593 -1 +drop table t1; +set sql_warnings = 0; +# COT() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(cot(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(cot(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (12,default); +select * from t1; +a b +12 -1.572673 +drop table t1; +set sql_warnings = 0; +# CRC32() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (crc32(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (crc32(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +insert into t1 values ('mysql',default); +select * from t1; +a b +MySQL 3259397556 +mysql 2501908538 +drop table t1; +set sql_warnings = 0; +# DEGREES() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(degrees(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(degrees(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +insert into t1 values (format(PI()/2,6),default); +select * from t1; +a b +1.570796 89.999981 +3.141593 180.00002 +drop table t1; +set sql_warnings = 0; +# / +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a/2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a/2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +select * from t1; +a b +2 1 +drop table t1; +set sql_warnings = 0; +# EXP() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(exp(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(exp(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +insert into t1 values (0,default); +select * from t1; +a b +-2 0.135335 +0 1 +2 7.389056 +drop table t1; +set sql_warnings = 0; +# FLOOR() +set sql_warnings = 1; +create table t1 (a double, b bigint generated always as (floor(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` bigint(20) AS (floor(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1.23,default); +insert into t1 values (-1.23,default); +select * from t1; +a b +-1.23 -2 +1.23 1 +drop table t1; +set sql_warnings = 0; +# LN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(ln(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(ln(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +select * from t1; +a b +-2 NULL +2 0.693147 +drop table t1; +set sql_warnings = 0; +# LOG() +set sql_warnings = 1; +create table t1 (a double, b double, c double generated always as (format(log(a,b),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` double AS (format(log(a,b),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,65536,default); +insert into t1 values (10,100,default); +insert into t1 values (1,100,default); +select * from t1; +a b c +1 100 NULL +10 100 2 +2 65536 16 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (-2,default); +select * from t1; +a b +-2 NULL +2 0.693147 +drop table t1; +set sql_warnings = 0; +# LOG2() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log2(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log2(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (65536,default); +insert into t1 values (-100,default); +select * from t1; +a b +-100 NULL +65536 16 +drop table t1; +set sql_warnings = 0; +# LOG10() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(log10(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(log10(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +insert into t1 values (100,default); +insert into t1 values (-100,default); +select * from t1; +a b +-100 NULL +100 2 +2 0.30103 +drop table t1; +set sql_warnings = 0; +# - +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a-1) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a-1) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2,default); +select * from t1; +a b +2 1 +drop table t1; +set sql_warnings = 0; +# MOD() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (mod(a,10)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (mod(a,10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (11,default); +select * from t1; +a b +1 1 +11 1 +drop table t1; +set sql_warnings = 0; +# % +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a % 10) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a % 10) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (11,default); +select * from t1; +a b +1 1 +11 1 +drop table t1; +set sql_warnings = 0; +# OCT() +set sql_warnings = 1; +create table t1 (a double, b varchar(10) generated always as (oct(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` varchar(10) AS (oct(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 14 +drop table t1; +set sql_warnings = 0; +# PI() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(PI()*a*a,6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(PI()*a*a,6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +select * from t1; +a b +1 3.141593 +drop table t1; +set sql_warnings = 0; +# + +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a+1) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a+1) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +select * from t1; +a b +1 2 +drop table t1; +set sql_warnings = 0; +# POW, POWER +set sql_warnings = 1; +create table t1 (a int, b int generated always as (pow(a,2)) virtual, c int generated always as (power(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (pow(a,2)) VIRTUAL, + `c` int(11) AS (power(a,2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default,default); +insert into t1 values (2,default,default); +select * from t1; +a b c +1 1 1 +2 4 4 +drop table t1; +set sql_warnings = 0; +# RADIANS() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(radians(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(radians(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (90,default); +select * from t1; +a b +90 1.570796 +drop table t1; +set sql_warnings = 0; +# ROUND() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (round(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (round(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-1.23,default); +insert into t1 values (-1.58,default); +insert into t1 values (1.58,default); +select * from t1; +a b +-1.23 -1 +-1.58 -2 +1.58 2 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a double, b double, c int generated always as (round(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT NULL, + `c` int(11) AS (round(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1.298,1,default); +insert into t1 values (1.298,0,default); +insert into t1 values (23.298,-1,default); +select * from t1; +a b c +1.298 0 1 +1.298 1 1 +23.298 -1 20 +drop table t1; +set sql_warnings = 0; +# SIGN() +set sql_warnings = 1; +create table t1 (a double, b int generated always as (sign(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) AS (sign(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-32,default); +insert into t1 values (0,default); +insert into t1 values (234,default); +select * from t1; +a b +-32 -1 +0 0 +234 1 +drop table t1; +set sql_warnings = 0; +# SIN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(sin(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(sin(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (format(PI()/2,6),default); +select * from t1; +a b +1.570796 1 +drop table t1; +set sql_warnings = 0; +# SQRT() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(sqrt(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(sqrt(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (4,default); +insert into t1 values (20,default); +insert into t1 values (-16,default); +select * from t1; +a b +-16 NULL +20 4.472136 +4 2 +drop table t1; +set sql_warnings = 0; +# TAN() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (format(tan(a),6)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (format(tan(a),6)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (format(PI(),6),default); +insert into t1 values (format(PI()+1,6),default); +select * from t1; +a b +3.141593 0 +4.141593 1.557409 +drop table t1; +set sql_warnings = 0; +# * +set sql_warnings = 1; +create table t1 (a double, b double generated always as (a*3) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (a*3) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +a b +0 0 +1 3 +2 6 +drop table t1; +set sql_warnings = 0; +# TRUNCATE() +set sql_warnings = 1; +create table t1 (a double, b double generated always as (truncate(a,4)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (truncate(a,4)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1.223,default); +insert into t1 values (1.999,default); +insert into t1 values (1.999,default); +insert into t1 values (122,default); +select * from t1; +a b +1.223 1.223 +1.999 1.999 +1.999 1.999 +122 122 +drop table t1; +set sql_warnings = 0; +# Unary - +set sql_warnings = 1; +create table t1 (a double, b double generated always as (-a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double AS (-a) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +select * from t1; +a b +-1 1 +1 -1 +drop table t1; +set sql_warnings = 0; +# +# STRING FUNCTIONS +# +# ASCII() +set sql_warnings = 1; +create table t1 (a char(2), b int generated always as (ascii(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(2) DEFAULT NULL, + `b` int(11) AS (ascii(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2',default); +insert into t1 values (2,default); +insert into t1 values ('dx',default); +select * from t1; +a b +2 50 +2 50 +dx 100 +drop table t1; +set sql_warnings = 0; +# BIN() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (bin(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (bin(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 1100 +drop table t1; +set sql_warnings = 0; +# BIT_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (bit_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (bit_length(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 32 +drop table t1; +set sql_warnings = 0; +# CHAR_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (char_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (char_length(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# CHAR() +set sql_warnings = 1; +create table t1 (a int, b int, c varbinary(10) generated always as (char(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` varbinary(10) AS (char(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (77,121,default); +select * from t1; +a b c +77 121 My +drop table t1; +set sql_warnings = 0; +# CHARACTER_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (character_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (character_length(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# CONCAT_WS() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (concat_ws(',',a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',default); +select * from t1; +a b c +value1 value2 value1,value2 +drop table t1; +set sql_warnings = 0; +# CONCAT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (concat(a,',',b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (concat(a,',',b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',default); +select * from t1; +a b c +value1 value2 value1,value2 +drop table t1; +set sql_warnings = 0; +# ELT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int, d varchar(10) generated always as (elt(c,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(10) AS (elt(c,a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('value1','value2',1,default); +insert into t1 values ('value1','value2',2,default); +select * from t1; +a b c d +value1 value2 1 value1 +value1 value2 2 value2 +drop table t1; +set sql_warnings = 0; +# EXPORT_SET() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (export_set(a,'1','0','',10)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (6,default); +select * from t1; +a b +6 0110000000 +drop table t1; +set sql_warnings = 0; +# FIELD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (field('aa',a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (field('aa',a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('aa','bb',default); +insert into t1 values ('bb','aa',default); +select * from t1; +a b c +aa bb 1 +bb aa 2 +drop table t1; +set sql_warnings = 0; +# FIND_IN_SET() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (find_in_set(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (find_in_set(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('aa','aa,bb,cc',default); +insert into t1 values ('aa','bb,aa,cc',default); +select * from t1; +a b c +aa aa,bb,cc 1 +aa bb,aa,cc 2 +drop table t1; +set sql_warnings = 0; +# FORMAT() +set sql_warnings = 1; +create table t1 (a double, b varchar(20) generated always as (format(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` varchar(20) AS (format(a,2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (12332.123456,default); +select * from t1; +a b +12332.123456 12,332.12 +drop table t1; +set sql_warnings = 0; +# HEX() +set sql_warnings = 1; +create table t1 (a int, b varchar(10) generated always as (hex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) AS (hex(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (17,default); +select * from t1; +a b +17 11 +drop table t1; +set sql_warnings = 0; +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (hex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (hex(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 616263 +drop table t1; +set sql_warnings = 0; +# INSERT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(20) generated always as (insert(a,length(a),length(b),b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('start,','end',default); +select * from t1; +a b c +start, end startend +drop table t1; +set sql_warnings = 0; +# INSTR() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int generated always as (instr(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) AS (instr(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar,','bar',default); +insert into t1 values ('xbar,','foobar',default); +select * from t1; +a b c +foobarbar, bar 4 +xbar, foobar 0 +drop table t1; +set sql_warnings = 0; +# LCASE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lcase(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lcase(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL mysql +drop table t1; +set sql_warnings = 0; +# LEFT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(5) generated always as (left(a,5)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(5) AS (left(a,5)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar fooba +drop table t1; +set sql_warnings = 0; +# LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b int generated always as (length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) AS (length(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a like 'H%o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a like 'H%o') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 1 +MySQL 0 +drop table t1; +set sql_warnings = 0; +# LOCATE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (locate('bar',a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (locate('bar',a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar 4 +drop table t1; +set sql_warnings = 0; +# LOWER() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lower(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lower(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL mysql +drop table t1; +set sql_warnings = 0; +# LPAD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (lpad(a,4,' ')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +insert into t1 values ('M',default); +select * from t1; +a b +M M +MySQL MySQ +drop table t1; +set sql_warnings = 0; +# LTRIM() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (ltrim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (ltrim(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (' MySQL',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b + MySQL MySQL +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# MAKE_SET() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c int, d varchar(30) generated always as (make_set(c,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',1,default); +insert into t1 values ('a','b',3,default); +select * from t1; +a b c d +a b 1 a +a b 3 a,b +drop table t1; +set sql_warnings = 0; +# MID() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (mid(a,1,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (mid(a,1,2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar fo +drop table t1; +set sql_warnings = 0; +# NOT LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a not like 'H%o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a not like 'H%o') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 0 +MySQL 1 +drop table t1; +set sql_warnings = 0; +# NOT REGEXP +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a not regexp 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('hello',default); +select * from t1; +a b +Hello 0 +hello 0 +drop table t1; +set sql_warnings = 0; +# OCTET_LENGTH() +set sql_warnings = 1; +create table t1 (a varchar(10), b int generated always as (octet_length(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) AS (octet_length(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text 4 +drop table t1; +set sql_warnings = 0; +# ORD() +set sql_warnings = 1; +create table t1 (a varchar(10), b bigint generated always as (ord(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) AS (ord(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2',default); +select * from t1; +a b +2 50 +drop table t1; +set sql_warnings = 0; +# POSITION() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (position('bar' in a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (position('bar' in a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar 4 +drop table t1; +set sql_warnings = 0; +# QUOTE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (quote(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (quote(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Don\'t',default); +select * from t1; +a b +Don't 'Don\'t' +drop table t1; +set sql_warnings = 0; +# REGEXP() +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a regexp 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('hello',default); +select * from t1; +a b +Hello 1 +hello 1 +drop table t1; +set sql_warnings = 0; +# REPEAT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (repeat(a,3)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (repeat(a,3)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQLMySQLMySQL +drop table t1; +set sql_warnings = 0; +# REPLACE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (replace(a,'aa','bb')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('maa',default); +select * from t1; +a b +maa mbb +drop table t1; +set sql_warnings = 0; +# REVERSE() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(30) generated always as (reverse(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) AS (reverse(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('maa',default); +select * from t1; +a b +maa aam +drop table t1; +set sql_warnings = 0; +# RIGHT() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (right(a,4)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (right(a,4)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('foobarbar',default); +select * from t1; +a b +foobarbar rbar +drop table t1; +set sql_warnings = 0; +# RLIKE() +set sql_warnings = 1; +create table t1 (a varchar(10), b bool generated always as (a rlike 'H.+o') virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +insert into t1 values ('MySQL',default); +select * from t1; +a b +Hello 1 +MySQL 0 +drop table t1; +set sql_warnings = 0; +# RPAD() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (rpad(a,4,'??')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('He',default); +select * from t1; +a b +He He?? +drop table t1; +set sql_warnings = 0; +# RTRIM(); +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (rtrim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (rtrim(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello ',default); +select * from t1; +a b +Hello Hello +drop table t1; +set sql_warnings = 0; +# SOUNDEX() +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(20) generated always as (soundex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(20) AS (soundex(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello H400 +drop table t1; +set sql_warnings = 0; +# SOUNDS LIKE +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a sounds like b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a sounds like b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello','Hello',default); +insert into t1 values ('Hello','MySQL',default); +insert into t1 values ('Hello','hello',default); +select * from t1; +a b c +Hello Hello 1 +Hello MySQL 0 +Hello hello 1 +drop table t1; +set sql_warnings = 0; +# SPACE() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (concat(a,space(5))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (concat(a,space(5))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello', default); +select * from t1; +a b +Hello Hello +drop table t1; +set sql_warnings = 0; +# STRCMP() +set sql_warnings = 1; +create table t1 (a varchar(9), b varchar(9), c tinyint(1) generated always as (strcmp(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(9) DEFAULT NULL, + `b` varchar(9) DEFAULT NULL, + `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello','Hello', default); +insert into t1 values ('Hello','Hello1', default); +select * from t1; +a b c +Hello Hello 0 +Hello Hello1 -1 +drop table t1; +set sql_warnings = 0; +# SUBSTR() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (substr(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (substr(a,2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello ello +drop table t1; +set sql_warnings = 0; +# SUBSTRING_INDEX() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (substring_index(a,'.',2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('www.mysql.com',default); +select * from t1; +a b +www.mysql.com www.mysql +drop table t1; +set sql_warnings = 0; +# SUBSTRING() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (substring(a from 2 for 2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('Hello',default); +select * from t1; +a b +Hello el +drop table t1; +set sql_warnings = 0; +# TRIM() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (trim(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (trim(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (' aa ',default); +select * from t1; +a b + aa aa +drop table t1; +set sql_warnings = 0; +# UCASE() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (ucase(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (ucase(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQL +drop table t1; +set sql_warnings = 0; +# UNHEX() +set sql_warnings = 1; +create table t1 (a varchar(15), b varchar(10) generated always as (unhex(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(15) DEFAULT NULL, + `b` varchar(10) AS (unhex(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('4D7953514C',default); +select * from t1; +a b +4D7953514C MySQL +drop table t1; +set sql_warnings = 0; +# UPPER() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (upper(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (upper(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQL +drop table t1; +set sql_warnings = 0; +# WEIGHT_STRING() +set sql_warnings = 1; +create table t1 (a varchar(5), b varchar(10) generated always as (weight_string(a as char(4))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(10) AS (weight_string(a as char(4))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MYSQ +drop table t1; +set sql_warnings = 0; +# +# CONTROL FLOW FUNCTIONS +# +# CASE +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(16) generated always as (case a when NULL then 'asd' when 'b' then 'B' else a end) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (NULL,default); +insert into t1 values ('b',default); +insert into t1 values ('c',default); +select * from t1; +a b +NULL NULL +b B +c c +drop table t1; +set sql_warnings = 0; +# IF +set sql_warnings = 1; +create table t1 (a int, b int, c int generated always as (if(a=1,a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS (if(a=1,a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,2,default); +insert into t1 values (3,4,default); +select * from t1; +a b c +1 2 1 +3 4 4 +drop table t1; +set sql_warnings = 0; +# IFNULL +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c varchar(10) generated always as (ifnull(a,'DEFAULT')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (NULL,'adf',default); +insert into t1 values ('a','adf',default); +select * from t1; +a b c +NULL adf DEFAULT +a adf a +drop table t1; +set sql_warnings = 0; +# NULLIF +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10) generated always as (nullif(a,'DEFAULT')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('DEFAULT',default); +insert into t1 values ('a',default); +select * from t1; +a b +DEFAULT NULL +a a +drop table t1; +set sql_warnings = 0; +# +# OPERATORS +# +# AND, && +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a>0 && a<2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a>0 && a<2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 0 +1 1 +drop table t1; +set sql_warnings = 0; +# BETWEEN ... AND ... +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a between 0 and 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a between 0 and 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 0 +1 1 +drop table t1; +set sql_warnings = 0; +# BINARY +set sql_warnings = 1; +create table t1 (a varchar(10), b varbinary(10) generated always as (binary a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varbinary(10) AS (binary a) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('11',default); +insert into t1 values (1,default); +select * from t1; +a b +1 1 +11 11 +drop table t1; +set sql_warnings = 0; +# & +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a & 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a & 5) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +select * from t1; +a b +0 0 +1 1 +drop table t1; +set sql_warnings = 0; +# ~ +set sql_warnings = 1; +create table t1 (a int, b int generated always as (~a) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (~a) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +select * from t1; +a b +1 2147483647 +drop table t1; +set sql_warnings = 0; +# | +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a | 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a | 5) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +insert into t1 values (2,default); +select * from t1; +a b +0 5 +1 5 +2 7 +drop table t1; +set sql_warnings = 0; +# ^ +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a ^ 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a ^ 5) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (0,default); +insert into t1 values (2,default); +select * from t1; +a b +0 5 +1 4 +2 7 +drop table t1; +set sql_warnings = 0; +# DIV +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a div 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a div 5) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (7,default); +select * from t1; +a b +1 0 +7 1 +drop table t1; +set sql_warnings = 0; +# <=> +set sql_warnings = 1; +create table t1 (a int, b int, c bool generated always as (a <=> b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` tinyint(1) AS (a <=> b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,1,default); +insert into t1 values (NULL,NULL,default); +insert into t1 values (1,NULL,default); +select * from t1; +a b c +1 1 1 +1 NULL 0 +NULL NULL 1 +drop table t1; +set sql_warnings = 0; +# = +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a=b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a=b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 1 +a b 0 +drop table t1; +set sql_warnings = 0; +# >= +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a >= b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a >= b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 1 +a b 0 +drop table t1; +set sql_warnings = 0; +# > +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a > b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a > b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a','b',default); +insert into t1 values ('a','a',default); +select * from t1; +a b c +a a 0 +a b 0 +drop table t1; +set sql_warnings = 0; +# IS NOT NULL +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a is not null) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a is not null) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (NULL,default); +select * from t1; +a b +1 1 +NULL 0 +drop table t1; +set sql_warnings = 0; +# IS NULL +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a is null) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a is null) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (NULL,default); +select * from t1; +a b +1 0 +NULL 1 +drop table t1; +set sql_warnings = 0; +# << +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a << 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a << 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (3,default); +select * from t1; +a b +1 4 +3 12 +drop table t1; +set sql_warnings = 0; +# <= +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a <= b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a <= b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 0 +b b 1 +b c 1 +drop table t1; +set sql_warnings = 0; +# < +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a < b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a < b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 0 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# NOT BETWEEN ... AND ... +set sql_warnings = 1; +create table t1 (a int, b bool generated always as (a not between 0 and 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (-1,default); +insert into t1 values (1,default); +select * from t1; +a b +-1 1 +1 0 +drop table t1; +set sql_warnings = 0; +# <> +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a <> b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a <> b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 1 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# != +set sql_warnings = 1; +create table t1 (a varchar(10), b varchar(10), c bool generated always as (a != b) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` tinyint(1) AS (a != b) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('b','a',default); +insert into t1 values ('b','b',default); +insert into t1 values ('b','c',default); +select * from t1; +a b c +b a 1 +b b 0 +b c 1 +drop table t1; +set sql_warnings = 0; +# ||, OR +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a>5 || a<3) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a>5 || a<3) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (4,default); +select * from t1; +a b +1 1 +4 0 +drop table t1; +set sql_warnings = 0; +# >> +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a >> 2) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a >> 2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (8,default); +insert into t1 values (3,default); +select * from t1; +a b +3 0 +8 2 +drop table t1; +set sql_warnings = 0; +# XOR +set sql_warnings = 1; +create table t1 (a int, b int generated always as (a xor 5) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a xor 5) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0,default); +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +a b +0 1 +1 0 +2 0 +drop table t1; +set sql_warnings = 0; +# +# DATE AND TIME FUNCTIONS +# +# ADDDATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (adddate(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-09-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# ADDTIME() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (addtime(a,'02:00:00')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-31 02:00:00 +drop table t1; +set sql_warnings = 0; +# CONVERT_TZ() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (convert_tz(a,'MET','UTC')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-30 22:00:00 +drop table t1; +set sql_warnings = 0; +# DATE_ADD() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date_add(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-09-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATE_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(64) generated always as (date_format(a,'%W %M %D')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 Sunday August 31st +drop table t1; +set sql_warnings = 0; +# DATE_SUB() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date_sub(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-07-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (date(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (date(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:00:00',default); +select * from t1; +a b +2008-08-31 02:00:00 2008-08-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# DATEDIFF() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (datediff(a,'2000-01-01')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (datediff(a,'2000-01-01')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 3165 +drop table t1; +set sql_warnings = 0; +# DAY() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (day(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (day(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31 +drop table t1; +set sql_warnings = 0; +# DAYNAME() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(10) generated always as (dayname(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(10) AS (dayname(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 Sunday +drop table t1; +set sql_warnings = 0; +# DAYOFMONTH() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofmonth(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofmonth(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31 +drop table t1; +set sql_warnings = 0; +# DAYOFWEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofweek(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofweek(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 1 +drop table t1; +set sql_warnings = 0; +# DAYOFYEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (dayofyear(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (dayofyear(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 244 +drop table t1; +set sql_warnings = 0; +# EXTRACT +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (extract(year from a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (extract(year from a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008 +drop table t1; +set sql_warnings = 0; +# FROM_DAYS() +set sql_warnings = 1; +create table t1 (a bigint, b datetime generated always as (from_days(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` datetime AS (from_days(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (730669,default); +select * from t1; +a b +730669 2000-07-03 00:00:00 +drop table t1; +set sql_warnings = 0; +# FROM_UNIXTIME() +set sql_warnings = 1; +create table t1 (a bigint, b datetime generated always as (from_unixtime(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` datetime AS (from_unixtime(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1196440219,default); +select * from t1; +a b +1196440219 2007-11-30 19:30:19 +drop table t1; +set sql_warnings = 0; +# GET_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(32) generated always as (date_format(a,get_format(DATE,'EUR'))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 31.08.2008 +drop table t1; +set sql_warnings = 0; +# HOUR() +set sql_warnings = 1; +create table t1 (a time, b bigint generated always as (hour(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` bigint(20) AS (hour(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('10:05:03',default); +select * from t1; +a b +10:05:03 10 +drop table t1; +set sql_warnings = 0; +# LAST_DAY() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (last_day(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (last_day(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2003-02-05',default); +insert into t1 values ('2003-02-32',default); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a b +0000-00-00 00:00:00 NULL +2003-02-05 00:00:00 2003-02-28 00:00:00 +drop table t1; +set sql_warnings = 0; +# MAKEDATE() +set sql_warnings = 1; +create table t1 (a int, b datetime generated always as (makedate(a,1)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` datetime AS (makedate(a,1)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2001,default); +select * from t1; +a b +2001 2001-01-01 00:00:00 +drop table t1; +set sql_warnings = 0; +# MAKETIME() +set sql_warnings = 1; +create table t1 (a int, b time generated always as (maketime(a,1,3)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` time AS (maketime(a,1,3)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (12,default); +select * from t1; +a b +12 12:01:03 +drop table t1; +set sql_warnings = 0; +# MICROSECOND() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (microsecond(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (microsecond(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 12:00:00.123456',default); +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 12:00:00 0 +2009-12-31 23:59:59 0 +drop table t1; +set sql_warnings = 0; +# MINUTE() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (minute(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (minute(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 59 +drop table t1; +set sql_warnings = 0; +# MONTH() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (month(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (month(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 12 +drop table t1; +set sql_warnings = 0; +# MONTHNAME() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(16) generated always as (monthname(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(16) AS (monthname(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2009-12-31 23:59:59.000010',default); +select * from t1; +a b +2009-12-31 23:59:59 December +drop table t1; +set sql_warnings = 0; +# PERIOD_ADD() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (period_add(a,2)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (period_add(a,2)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (200801,default); +select * from t1; +a b +200801 200803 +drop table t1; +set sql_warnings = 0; +# PERIOD_DIFF() +set sql_warnings = 1; +create table t1 (a int, b int, c int generated always as (period_diff(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS (period_diff(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (200802,200703,default); +select * from t1; +a b c +200802 200703 11 +drop table t1; +set sql_warnings = 0; +# QUARTER() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (quarter(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (quarter(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 3 +drop table t1; +set sql_warnings = 0; +# SEC_TO_TIME() +set sql_warnings = 1; +create table t1 (a bigint, b time generated always as (sec_to_time(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` time AS (sec_to_time(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (2378,default); +select * from t1; +a b +2378 00:39:38 +drop table t1; +set sql_warnings = 0; +# SECOND() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (second(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (second(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('10:05:03',default); +select * from t1; +a b +2010-05-03 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# STR_TO_DATE() +set sql_warnings = 1; +create table t1 (a varchar(64), b datetime generated always as (str_to_date(a,'%m/%d/%Y')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) DEFAULT NULL, + `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('04/30/2004',default); +select * from t1; +a b +04/30/2004 2004-04-30 00:00:00 +drop table t1; +set sql_warnings = 0; +# SUBDATE() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (subdate(a,interval 1 month)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-07-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# SUBTIME() +set sql_warnings = 1; +create table t1 (a datetime, b datetime generated always as (subtime(a,'02:00:00')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31',default); +select * from t1; +a b +2008-08-31 00:00:00 2008-08-30 22:00:00 +drop table t1; +set sql_warnings = 0; +# TIME_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(32) generated always as (time_format(a,'%r')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:03:04',default); +select * from t1; +a b +2008-08-31 02:03:04 02:03:04 AM +drop table t1; +set sql_warnings = 0; +# TIME_TO_SEC() +set sql_warnings = 1; +create table t1 (a time, b bigint generated always as (time_to_sec(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` bigint(20) AS (time_to_sec(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('22:23:00',default); +select * from t1; +a b +22:23:00 80580 +drop table t1; +set sql_warnings = 0; +# TIME() +set sql_warnings = 1; +create table t1 (a datetime, b time generated always as (time(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` time AS (time(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-08-31 02:03:04',default); +select * from t1; +a b +2008-08-31 02:03:04 02:03:04 +drop table t1; +set sql_warnings = 0; +# TIMEDIFF() +set sql_warnings = 1; +create table t1 (a datetime, b datetime, c time generated always as (timediff(a,b)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` time AS (timediff(a,b)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); +select * from t1; +a b c +2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58 +drop table t1; +set sql_warnings = 0; +# TIMESTAMP() +set sql_warnings = 1; +create table t1 (a datetime, b timestamp generated always as (timestamp(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` timestamp AS (timestamp(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-12-31',default); +select * from t1; +a b +2008-12-31 00:00:00 2008-12-31 00:00:00 +drop table t1; +set sql_warnings = 0; +# TIMESTAMPADD() +set sql_warnings = 1; +create table t1 (a datetime, b timestamp generated always as (timestampadd(minute,1,a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2003-01-02',default); +select * from t1; +a b +2003-01-02 00:00:00 2003-01-02 00:01:00 +drop table t1; +set sql_warnings = 0; +# TIMESTAMPDIFF() +set sql_warnings = 1; +create table t1 (a timestamp, c bigint generated always as (timestampdiff(MONTH, a, a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c` bigint(20) AS (timestampdiff(MONTH, a, a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2003-02-01',default); +select * from t1; +a c +2003-02-01 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# TO_DAYS() +set sql_warnings = 1; +create table t1 (a datetime, b bigint generated always as (to_days(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) AS (to_days(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2007-10-07',default); +select * from t1; +a b +2007-10-07 00:00:00 733321 +drop table t1; +set sql_warnings = 0; +# WEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (week(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (week(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 35 +drop table t1; +set sql_warnings = 0; +# WEEKDAY() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (weekday(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (weekday(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 0 +drop table t1; +set sql_warnings = 0; +# WEEKOFYEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (weekofyear(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (weekofyear(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 36 +drop table t1; +set sql_warnings = 0; +# YEAR() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (year(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (year(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 2008 +drop table t1; +set sql_warnings = 0; +# YEARWEEK() +set sql_warnings = 1; +create table t1 (a datetime, b int generated always as (yearweek(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) AS (yearweek(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2008-09-01',default); +select * from t1; +a b +2008-09-01 00:00:00 200835 +drop table t1; +set sql_warnings = 0; +# +# FULL TEXT SEARCH FUNCTIONS +# +# None. +# +# CAST FUNCTIONS AND OPERATORS +# +# CAST() +set sql_warnings = 1; +create table t1 (a int, b bigint unsigned generated always as (cast(a as unsigned)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` bigint(20) unsigned AS (cast(a as unsigned)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +select * from t1; +a b +-1 18446744073709551615 +1 1 +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warnings: +drop table t1; +set sql_warnings = 0; +# Convert() +set sql_warnings = 1; +create table t1 (a int, b bigint unsigned generated always as (convert(a,unsigned)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` bigint(20) unsigned AS (convert(a,unsigned)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (-1,default); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +select * from t1; +a b +-1 18446744073709551615 +1 1 +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warnings: +drop table t1; +set sql_warnings = 0; +# +# XML FUNCTIONS +# +# ExtractValue() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (ExtractValue(a,'/b')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (ExtractValue(a,'/b')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('text',default); +select * from t1; +a b +text text +drop table t1; +set sql_warnings = 0; +# None. +# +# OTHER FUNCTIONS +# +# AES_DECRYPT(), AES_ENCRYPT() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (aes_encrypt(aes_decrypt(a,'adf'),'adf')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL NULL +drop table t1; +set sql_warnings = 0; +# BIT_COUNT() +set sql_warnings = 1; +create table t1 (a int, b int generated always as (bit_count(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (bit_count(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (5,default); +select * from t1; +a b +5 2 +drop table t1; +set sql_warnings = 0; +# CHARSET() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (charset(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (charset(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc latin1 +drop table t1; +set sql_warnings = 0; +# COERCIBILITY() +set sql_warnings = 1; +create table t1 (a varchar(1024), b int generated always as (coercibility(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` int(11) AS (coercibility(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 2 +drop table t1; +set sql_warnings = 0; +# COLLATION() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (collation(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (collation(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc latin1_swedish_ci +drop table t1; +set sql_warnings = 0; +# COMPRESS(), UNCOMPRESS() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (uncompress(compress(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# ENCODE(), DECODE() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (decode(encode(a,'abc'),'abc')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL MySQL +drop table t1; +set sql_warnings = 0; +# DEFAULT() +set sql_warnings = 1; +create table t1 (a varchar(1024) default 'aaa', b varchar(1024) generated always as (ifnull(a,default(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT 'aaa', + `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('any value',default); +select * from t1; +a b +any value any value +drop table t1; +set sql_warnings = 0; +# DES_ENCRYPT(), DES_DECRYPT() +create table t1 (a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (des_encrypt(des_decrypt(a,'adf'),'adf')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('MySQL',default); +select * from t1; +a b +MySQL ÿw2¥ð +èõÁ +drop table t1; +# INET_ATON(), INET_NTOA() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('127.0.0.1',default); +select * from t1; +a b +127.0.0.1 127.0.0.1 +drop table t1; +set sql_warnings = 0; +# MD5() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varbinary(32) generated always as (md5(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varbinary(32) AS (md5(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('testing',default); +select * from t1; +a b +testing ae2b1fca515949e5d54fb22b8ed95575 +drop table t1; +set sql_warnings = 0; +# PASSWORD() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (password(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (password(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('badpwd',default); +select * from t1; +a b +badpwd *AAB3E285149C0135D51A520E1940DD3263DC008C +drop table t1; +set sql_warnings = 0; +# SHA1() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha1(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha1(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc a9993e364706816aba3e25717850c26c9cd0d89d +drop table t1; +set sql_warnings = 0; +# SHA() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha(a)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc a9993e364706816aba3e25717850c26c9cd0d89d +drop table t1; +set sql_warnings = 0; +# SHA2() +set sql_warnings = 1; +create table t1 (a varchar(1024), b varchar(1024) generated always as (sha2(a,224)) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1024) DEFAULT NULL, + `b` varchar(1024) AS (sha2(a,224)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('abc',default); +select * from t1; +a b +abc 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 +drop table t1; +set sql_warnings = 0; +# UNCOMPRESSED_LENGTH() +set sql_warnings = 1; +create table t1 (a char, b varchar(1024) generated always as (uncompressed_length(compress(repeat(a,30)))) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a',default); +select * from t1; +a b +a 30 +drop table t1; +set sql_warnings = 0; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_trigger_sp_innodb.result b/mysql-test/suite/gcol/r/gcol_trigger_sp_innodb.result new file mode 100644 index 00000000000..60dce012b78 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_trigger_sp_innodb.result @@ -0,0 +1,94 @@ +SET @@session.default_storage_engine = 'InnoDB'; +create table t1 (a int, +b int generated always as (a/10) virtual, +c int generated always as (a/10) stored); +create table t2 (a timestamp); +create trigger trg1 before insert on t1 for each row +begin +if (new.b < 10) then +set new.a:= 100; +set new.b:= 9; +set new.c:= 9; +end if; +if (new.c > 50) then +set new.a:= 500; +end if; +end| +create trigger trg2 after insert on t1 for each row +begin +if (new.b >= 60) then +insert into t2 values (now()); +end if; +end| +create function f1() +returns int +begin +declare sum1 int default '0'; +declare cur1 cursor for select sum(b) from t1; +open cur1; +fetch cur1 into sum1; +close cur1; +return sum1; +end| +set sql_warnings = 1; +insert into t1 (a) values (200); +select * from t1; +a b c +200 20 20 +select * from t2; +a +insert into t1 (a) values (10); +select * from t1; +a b c +100 10 10 +200 20 20 +select * from t2; +a +insert into t1 (a) values (600); +select * from t1; +a b c +100 10 10 +200 20 20 +500 50 50 +select * from t2; +a +select f1(); +f1() +80 +set sql_warnings = 0; +drop trigger trg1; +drop trigger trg2; +drop table t2; +create procedure p1() +begin +declare i int default '0'; +create table t2 like t1; +insert into t2 (a) values (100), (200); +begin +declare cur1 cursor for select sum(c) from t2; +open cur1; +fetch cur1 into i; +close cur1; +if (i=30) then +insert into t1 values (300,default,default); +end if; +end; +end| +delete from t1; +call p1(); +select * from t2; +a b c +100 10 10 +200 20 20 +select * from t1; +a b c +300 30 30 +drop table t1,t2; +drop procedure p1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_trigger_sp_myisam.result b/mysql-test/suite/gcol/r/gcol_trigger_sp_myisam.result new file mode 100644 index 00000000000..a5e3bda2a0e --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_trigger_sp_myisam.result @@ -0,0 +1,94 @@ +SET @@session.default_storage_engine = 'MyISAM'; +create table t1 (a int, +b int generated always as (a/10) virtual, +c int generated always as (a/10) stored); +create table t2 (a timestamp); +create trigger trg1 before insert on t1 for each row +begin +if (new.b < 10) then +set new.a:= 100; +set new.b:= 9; +set new.c:= 9; +end if; +if (new.c > 50) then +set new.a:= 500; +end if; +end| +create trigger trg2 after insert on t1 for each row +begin +if (new.b >= 60) then +insert into t2 values (now()); +end if; +end| +create function f1() +returns int +begin +declare sum1 int default '0'; +declare cur1 cursor for select sum(b) from t1; +open cur1; +fetch cur1 into sum1; +close cur1; +return sum1; +end| +set sql_warnings = 1; +insert into t1 (a) values (200); +select * from t1; +a b c +200 20 20 +select * from t2; +a +insert into t1 (a) values (10); +select * from t1; +a b c +100 10 10 +200 20 20 +select * from t2; +a +insert into t1 (a) values (600); +select * from t1; +a b c +100 10 10 +200 20 20 +500 50 50 +select * from t2; +a +select f1(); +f1() +80 +set sql_warnings = 0; +drop trigger trg1; +drop trigger trg2; +drop table t2; +create procedure p1() +begin +declare i int default '0'; +create table t2 like t1; +insert into t2 (a) values (100), (200); +begin +declare cur1 cursor for select sum(c) from t2; +open cur1; +fetch cur1 into i; +close cur1; +if (i=30) then +insert into t1 values (300,default,default); +end if; +end; +end| +delete from t1; +call p1(); +select * from t2; +a b c +100 10 10 +200 20 20 +select * from t1; +a b c +300 30 30 +drop table t1,t2; +drop procedure p1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_update.result b/mysql-test/suite/gcol/r/gcol_update.result new file mode 100644 index 00000000000..380d1c1efef --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_update.result @@ -0,0 +1,30 @@ +set global innodb_purge_stop_now = 1; +create table t1(f1 int not null, f2 blob not null, f3 blob not null, +vchar char(2) as (substr(f3,2,2)) virtual, +primary key(f1, f3(5)), index(vchar))engine=innodb; +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +set global innodb_purge_stop_now = 1; +drop table t1; +create table t1(f1 int not null, f2 blob not null, f3 blob not null, +vchar char(2) as (substr(f3,2,2)) virtual, +primary key(f1, f3(5)), index(vchar, f3(2)))engine=innodb; +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +set global innodb_purge_stop_now = 1; +drop table t1; +create table t1(f1 int not null, f2 blob not null, f3 blob not null, +vchar blob as (f3) virtual, +primary key(f1, f3(5)), index(vchar(3)))engine=innodb; +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +drop table t1; diff --git a/mysql-test/suite/gcol/r/gcol_view_innodb.result b/mysql-test/suite/gcol/r/gcol_view_innodb.result new file mode 100644 index 00000000000..ec82c792493 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_view_innodb.result @@ -0,0 +1,280 @@ +SET @@session.default_storage_engine = 'InnoDB'; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (1), (2), (2), (3); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +create view v1 (d,e) as select abs(b), abs(c) from t1; +select d,e from v1; +d e +1 1 +1 1 +2 2 +2 2 +3 3 +select is_updatable from information_schema.views where table_name='v1'; +is_updatable +NO +explain select d,e from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 X +create algorithm=temptable view v2 (d,e) as select abs(b), abs(c) from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select abs(`t1`.`b`) AS `d`,abs(`t1`.`c`) AS `e` from `t1` latin1 latin1_swedish_ci +select d,e from v2; +d e +1 1 +1 1 +2 2 +2 2 +3 3 +explain select d,e from v2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 5 X +2 DERIVED t1 ALL NULL NULL NULL NULL 5 X +create view v3 (d,e) as select d*2, e*2 from v1; +select * from v3; +d e +2 2 +2 2 +4 4 +4 4 +6 6 +explain select * from v3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 X +drop view v1,v2,v3; +drop table t1; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (1), (2), (3); +create view v1 as select distinct b from t1; +select * from v1; +b +-1 +-2 +-3 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 X +2 DERIVED t1 ALL NULL NULL NULL NULL 6 X +select * from t1; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +2 -2 -2 +3 -3 -3 +3 -3 -3 +drop view v1; +create view v1 as select distinct c from t1; +select * from v1; +c +-1 +-2 +-3 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 X +2 DERIVED t1 ALL NULL NULL NULL NULL 6 X +select * from t1; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +2 -2 -2 +3 -3 -3 +3 -3 -3 +drop view v1; +drop table t1; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (4); +create view v1 as select b+1 from t1 order by 1 desc limit 2; +select * from v1; +b+1 +0 +-1 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 X +2 DERIVED t1 ALL NULL NULL NULL NULL 4 X +drop view v1; +create view v1 as select c+1 from t1 order by 1 desc limit 2; +select * from v1; +c+1 +-1 +0 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 X +2 DERIVED t1 ALL NULL NULL NULL NULL 4 X +drop view v1; +drop table t1; +create table t1 (a int, +b int, +c int generated always as (-a) virtual, +d int generated always as (-a) stored, +primary key(a)); +insert into t1 (a,b) values (10,2), (20,3), (30,4), (40,5), (50,10); +create view v1 (a,e,f,g) as select a, b+1,c+1,d+1 from t1; +update v1 set a=a+e; +select * from v1 order by a; +a e f g +13 3 -12 -12 +24 4 -23 -23 +35 5 -34 -34 +46 6 -45 -45 +61 11 -60 -60 +select * from t1 order by a; +a b c d +13 2 -13 -13 +24 3 -24 -24 +35 4 -35 -35 +46 5 -46 -46 +61 10 -61 -61 +delete from v1; +select * from v1; +a e f g +select * from t1; +a b c d +insert into v1 (a,e) values (60,15); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +drop table t1; +drop view v1; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +primary key(a)); +insert into t1 (a) values (1), (2), (3); +create view v1 (x,y,z) as select a,b,c from t1 where b < -1; +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.b= v1.y); +a x y z +1 NULL NULL NULL +2 2 -2 -2 +3 3 -3 -3 +drop view v1; +create view v1 (x,y,z) as select a,b,c from t1 where c < -1; +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.c= v1.z); +a x y z +1 NULL NULL NULL +2 2 -2 -2 +3 3 -3 -3 +drop view v1; +drop table t1; +create table t1 (a1 int, +b1 int generated always as (-a1) virtual, +c1 int generated always as (-a1) stored); +create table t2 (a2 int, +b2 int generated always as (-a2) virtual, +c2 int generated always as (-a2) stored); +insert into t1 (a1) values (1), (2); +insert into t2 (a2) values (2), (3); +create view v1 as select * from t1,t2 union all select * from t1,t2; +select * from v1; +a1 b1 c1 a2 b2 c2 +1 -1 -1 2 -2 -2 +1 -1 -1 2 -2 -2 +1 -1 -1 3 -3 -3 +1 -1 -1 3 -3 -3 +2 -2 -2 2 -2 -2 +2 -2 -2 2 -2 -2 +2 -2 -2 3 -3 -3 +2 -2 -2 3 -3 -3 +drop view v1; +drop table t1, t2; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +create table t2 like t1; +create view v1 as select a,b,c from t1; +create view v2 as select a,b,c from t2 where b in (select b from v1); +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a`,`t2`.`b` AS `b`,`t2`.`c` AS `c` from `t2` where `t2`.`b` in (select `v1`.`b` from `v1`) latin1 latin1_swedish_ci +drop view v2, v1; +drop table t1, t2; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1),(1),(2),(2),(3),(3); +create view v1 as select b from t1; +select distinct b from v1; +b +-1 +-2 +-3 +select distinct b from v1 order by b limit 2; +b +-3 +-2 +select distinct b from t1 order by b limit 2; +b +-3 +-2 +prepare stmt1 from "select distinct b from v1 order by b limit 2"; +execute stmt1; +b +-3 +-2 +execute stmt1; +b +-3 +-2 +deallocate prepare stmt1; +drop view v1; +create view v1 as select c from t1; +select distinct c from v1; +c +-1 +-2 +-3 +select distinct c from v1 order by c limit 2; +c +-3 +-2 +select distinct c from t1 order by c limit 2; +c +-3 +-2 +prepare stmt1 from "select distinct c from v1 order by c limit 2"; +execute stmt1; +c +-3 +-2 +execute stmt1; +c +-3 +-2 +deallocate prepare stmt1; +drop view v1; +drop table t1; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +create view v1 as select * from t1 where b > -2 && c >-2 with check option; +insert into v1 (a) values (1); +insert into v1 (a) values (3); +ERROR 44000: CHECK OPTION failed `test`.`v1` +insert ignore into v1 (a) values (2),(3),(0); +Warnings: +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` +select * from t1; +a b c +0 0 0 +1 -1 -1 +drop view v1; +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/gcol_view_myisam.result b/mysql-test/suite/gcol/r/gcol_view_myisam.result new file mode 100644 index 00000000000..13cb74ebcb5 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_view_myisam.result @@ -0,0 +1,280 @@ +SET @@session.default_storage_engine = 'MyISAM'; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (1), (2), (2), (3); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +create view v1 (d,e) as select abs(b), abs(c) from t1; +select d,e from v1; +d e +1 1 +1 1 +2 2 +2 2 +3 3 +select is_updatable from information_schema.views where table_name='v1'; +is_updatable +NO +explain select d,e from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 X +create algorithm=temptable view v2 (d,e) as select abs(b), abs(c) from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select abs(`t1`.`b`) AS `d`,abs(`t1`.`c`) AS `e` from `t1` latin1 latin1_swedish_ci +select d,e from v2; +d e +1 1 +1 1 +2 2 +2 2 +3 3 +explain select d,e from v2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 5 X +2 DERIVED t1 ALL NULL NULL NULL NULL 5 X +create view v3 (d,e) as select d*2, e*2 from v1; +select * from v3; +d e +2 2 +2 2 +4 4 +4 4 +6 6 +explain select * from v3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 X +drop view v1,v2,v3; +drop table t1; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (1), (2), (3); +create view v1 as select distinct b from t1; +select * from v1; +b +-1 +-2 +-3 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 X +2 DERIVED t1 ALL NULL NULL NULL NULL 6 X +select * from t1; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +2 -2 -2 +3 -3 -3 +3 -3 -3 +drop view v1; +create view v1 as select distinct c from t1; +select * from v1; +c +-1 +-2 +-3 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 X +2 DERIVED t1 ALL NULL NULL NULL NULL 6 X +select * from t1; +a b c +1 -1 -1 +1 -1 -1 +2 -2 -2 +2 -2 -2 +3 -3 -3 +3 -3 -3 +drop view v1; +drop table t1; +create table t1 (a int not null, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1), (2), (3), (4); +create view v1 as select b+1 from t1 order by 1 desc limit 2; +select * from v1; +b+1 +0 +-1 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 X +2 DERIVED t1 ALL NULL NULL NULL NULL 4 X +drop view v1; +create view v1 as select c+1 from t1 order by 1 desc limit 2; +select * from v1; +c+1 +-1 +0 +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 X +2 DERIVED t1 ALL NULL NULL NULL NULL 4 X +drop view v1; +drop table t1; +create table t1 (a int, +b int, +c int generated always as (-a) virtual, +d int generated always as (-a) stored, +primary key(a)); +insert into t1 (a,b) values (10,2), (20,3), (30,4), (40,5), (50,10); +create view v1 (a,e,f,g) as select a, b+1,c+1,d+1 from t1; +update v1 set a=a+e; +select * from v1 order by a; +a e f g +13 3 -12 -12 +24 4 -23 -23 +35 5 -34 -34 +46 6 -45 -45 +61 11 -60 -60 +select * from t1 order by a; +a b c d +13 2 -13 -13 +24 3 -24 -24 +35 4 -35 -35 +46 5 -46 -46 +61 10 -61 -61 +delete from v1; +select * from v1; +a e f g +select * from t1; +a b c d +insert into v1 (a,e) values (60,15); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +drop table t1; +drop view v1; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored, +primary key(a)); +insert into t1 (a) values (1), (2), (3); +create view v1 (x,y,z) as select a,b,c from t1 where b < -1; +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.b= v1.y); +a x y z +1 NULL NULL NULL +2 2 -2 -2 +3 3 -3 -3 +drop view v1; +create view v1 (x,y,z) as select a,b,c from t1 where c < -1; +select t1.a, v1.x, v1.y, v1.z from t1 left join v1 on (t1.c= v1.z); +a x y z +1 NULL NULL NULL +2 2 -2 -2 +3 3 -3 -3 +drop view v1; +drop table t1; +create table t1 (a1 int, +b1 int generated always as (-a1) virtual, +c1 int generated always as (-a1) stored); +create table t2 (a2 int, +b2 int generated always as (-a2) virtual, +c2 int generated always as (-a2) stored); +insert into t1 (a1) values (1), (2); +insert into t2 (a2) values (2), (3); +create view v1 as select * from t1,t2 union all select * from t1,t2; +select * from v1; +a1 b1 c1 a2 b2 c2 +1 -1 -1 2 -2 -2 +1 -1 -1 2 -2 -2 +1 -1 -1 3 -3 -3 +1 -1 -1 3 -3 -3 +2 -2 -2 2 -2 -2 +2 -2 -2 2 -2 -2 +2 -2 -2 3 -3 -3 +2 -2 -2 3 -3 -3 +drop view v1; +drop table t1, t2; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +create table t2 like t1; +create view v1 as select a,b,c from t1; +create view v2 as select a,b,c from t2 where b in (select b from v1); +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a`,`t2`.`b` AS `b`,`t2`.`c` AS `c` from `t2` where `t2`.`b` in (select `v1`.`b` from `v1`) latin1 latin1_swedish_ci +drop view v2, v1; +drop table t1, t2; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +insert into t1 (a) values (1),(1),(2),(2),(3),(3); +create view v1 as select b from t1; +select distinct b from v1; +b +-1 +-2 +-3 +select distinct b from v1 order by b limit 2; +b +-3 +-2 +select distinct b from t1 order by b limit 2; +b +-3 +-2 +prepare stmt1 from "select distinct b from v1 order by b limit 2"; +execute stmt1; +b +-3 +-2 +execute stmt1; +b +-3 +-2 +deallocate prepare stmt1; +drop view v1; +create view v1 as select c from t1; +select distinct c from v1; +c +-1 +-2 +-3 +select distinct c from v1 order by c limit 2; +c +-3 +-2 +select distinct c from t1 order by c limit 2; +c +-3 +-2 +prepare stmt1 from "select distinct c from v1 order by c limit 2"; +execute stmt1; +c +-3 +-2 +execute stmt1; +c +-3 +-2 +deallocate prepare stmt1; +drop view v1; +drop table t1; +create table t1 (a int, +b int generated always as (-a) virtual, +c int generated always as (-a) stored); +create view v1 as select * from t1 where b > -2 && c >-2 with check option; +insert into v1 (a) values (1); +insert into v1 (a) values (3); +ERROR 44000: CHECK OPTION failed `test`.`v1` +insert ignore into v1 (a) values (2),(3),(0); +Warnings: +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` +select * from t1; +a b c +0 0 0 +1 -1 -1 +drop view v1; +drop table t1; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; diff --git a/mysql-test/suite/gcol/r/rpl_gcol.result b/mysql-test/suite/gcol/r/rpl_gcol.result new file mode 100644 index 00000000000..245ce3ba2e5 --- /dev/null +++ b/mysql-test/suite/gcol/r/rpl_gcol.result @@ -0,0 +1,33 @@ +SET @@session.default_storage_engine = 'InnoDB'; +include/master-slave.inc +[connection master] +connection master; +create table t1 (a int, b int generated always as (a+1) virtual); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a+1) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +a b +1 2 +2 3 +connection slave; +select * from t1; +a b +1 2 +2 3 +connection master; +drop table t1; +connection slave; +DROP VIEW IF EXISTS v1,v2; +DROP TABLE IF EXISTS t1,t2,t3; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS trg1; +DROP TRIGGER IF EXISTS trg2; +set sql_warnings = 0; +include/rpl_end.inc diff --git a/mysql-test/suite/gcol/t/gcol_archive.test b/mysql-test/suite/gcol/t/gcol_archive.test new file mode 100644 index 00000000000..6dce34e1d6e --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_archive.test @@ -0,0 +1,44 @@ +################################################################################ +# t/gcol_archive.test # +# # +# Purpose: # +# ARCHIVE branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_archive.inc +SET @@session.default_storage_engine = 'archive'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests +--source suite/gcol/inc/gcol_unsupported_storage_engines.inc + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_blackhole.test b/mysql-test/suite/gcol/t/gcol_blackhole.test new file mode 100644 index 00000000000..bf0d3fb3022 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_blackhole.test @@ -0,0 +1,44 @@ +################################################################################ +# t/gcol_blackhole.test # +# # +# Purpose: # +# BLACKHOLE branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_blackhole.inc +SET @@session.default_storage_engine = 'blackhole'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests +--source suite/gcol/inc/gcol_unsupported_storage_engines.inc + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_innodb.test b/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_innodb.test new file mode 100644 index 00000000000..a1024b33ad6 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_innodb.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_supported_sql_funcs.test # +# # +# Purpose: # +# Test SQL functions not allowed for generated columns # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +let $skip_full_text_check = 1; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_blocked_sql_funcs_main.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_myisam.test b/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_myisam.test new file mode 100644 index 00000000000..0f967ee85d0 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_blocked_sql_funcs_myisam.test @@ -0,0 +1,44 @@ +################################################################################ +# t/gcol_supported_sql_funcs.test # +# # +# Purpose: # +# Test SQL functions not allowed for generated columns # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_blocked_sql_funcs_main.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_bug20746926.test b/mysql-test/suite/gcol/t/gcol_bug20746926.test new file mode 100644 index 00000000000..8028823f9a7 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_bug20746926.test @@ -0,0 +1,28 @@ +--echo #Bug #20746926: GENERATED COLUMNS: INVALID READ OF THD WHEN WARNINGS +--echo # +--echo # Testing cmp_item_datetime +connect(con1,localhost,root,,); +--disable_warnings +set sql_mode=''; +--enable_warnings +create table t1 ( +a date not null, +b mediumtext generated always as ((a not in (a,a))) virtual, +c timestamp generated always as ((a not in (b,b))) stored +); +insert t1(a) values(7777777777); +show warnings; +disconnect con1; +--source include/wait_until_disconnected.inc + +connect(con2,localhost,root,,); +--disable_warnings +set sql_mode=''; +--enable_warnings +insert t1(a) values(6666666666); +show warnings; + +drop table t1; +disconnect con2; +--source include/wait_until_disconnected.inc +connection default; diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test new file mode 100644 index 00000000000..8c084d0b54a --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -0,0 +1,601 @@ +################################################################################ +# t/gcol_bugfixes.test # +# # +# Purpose: # +# Bug fixes that only need one storage engine # +# # +################################################################################ + +--source include/have_innodb.inc +--echo # Bug#21230709: Alter table statement fails with division by zero + +CREATE TABLE t1 ( + col1 INTEGER NOT NULL, + col2 INTEGER NOT NULL, + col3 INTEGER NOT NULL, + gcol1 INTEGER GENERATED ALWAYS AS (col3 + col3) VIRTUAL, + col4 INTEGER DEFAULT NULL, + col5 INTEGER DEFAULT NULL, + col6 INTEGER DEFAULT NULL, + col7 INTEGER DEFAULT NULL, + col8 INTEGER DEFAULT NULL, + col9 INTEGER DEFAULT NULL, + col10 INTEGER DEFAULT NULL, + col11 INTEGER DEFAULT NULL, + col12 INTEGER DEFAULT NULL, + col13 INTEGER DEFAULT NULL, + col14 INTEGER DEFAULT NULL, + col15 INTEGER DEFAULT NULL, + col16 INTEGER DEFAULT NULL, + col17 INTEGER DEFAULT NULL, + col18 INTEGER DEFAULT NULL, + col19 INTEGER DEFAULT NULL, + col20 INTEGER DEFAULT NULL, + col21 INTEGER DEFAULT NULL, + col22 INTEGER DEFAULT NULL, + col23 INTEGER DEFAULT NULL, + col24 INTEGER DEFAULT NULL, + col25 INTEGER DEFAULT NULL, + col26 INTEGER DEFAULT NULL, + col27 INTEGER DEFAULT NULL, + col28 INTEGER DEFAULT NULL, + col29 INTEGER DEFAULT NULL, + col30 INTEGER DEFAULT NULL, + col31 INTEGER DEFAULT NULL, + col32 INTEGER DEFAULT NULL, + col33 INTEGER DEFAULT NULL, + gcol2 INTEGER GENERATED ALWAYS AS (col2 + col2) VIRTUAL, + gcol3 INTEGER GENERATED ALWAYS AS (gcol2 / gcol2) VIRTUAL, + PRIMARY KEY (col1), + KEY idx1 (gcol1) +) engine=innodb; + +INSERT INTO t1 (col1, col2, col3) + VALUES (0,1,2), (1,2,3), (2,3,4), (3,4,5), (4,5,6); + +# This is likely needed to ensure we allocate a new record buffer that +# contains zero in the mis-used field +FLUSH TABLE t1; + +ALTER TABLE t1 ADD COLUMN extra INTEGER; + +DROP TABLE t1; + +--echo # +--echo # Bug 21340801 WL8149:ASSERTION `IS_VIRTUAL_GCOL()' FAILED +--echo # + +CREATE TABLE t1 ( + c_blob BLOB, + c_blob_key BLOB GENERATED ALWAYS AS (REPEAT(c_blob,15)) STORED, + KEY (c_blob_key(200)) +); + +INSERT INTO t1 (c_blob) VALUES ('xceks'); + +DROP TABLE t1; + +--echo # +--echo # Bug#21345972 WL8149:JOIN_CACHE::FILTER_VIRTUAL_GCOL_BASE_COLS(): ASSERTION `FALSE' FAILED. +--echo # + +CREATE TABLE c ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, + + col_date_nokey DATE /*! NULL */, + col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, + + col_datetime_nokey DATETIME /*! NULL */, + col_time_nokey TIME /*! NULL */, + + col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + + col_varchar_nokey VARCHAR(1) /*! NULL */, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, + + PRIMARY KEY (pk), + UNIQUE KEY (col_int_key), + UNIQUE KEY (col_varchar_key), + UNIQUE KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + UNIQUE KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_int_nokey), + KEY(col_int_key,col_date_key), + KEY(col_int_key, col_time_key), + KEY(col_int_key, col_datetime_key), + UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), + UNIQUE KEY (col_varchar_key, col_varchar_nokey), + UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) + ) ENGINE=INNODB; + +INSERT /*! IGNORE */ INTO c ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey + ) VALUES (7, '2004-04-09', '14:03:03.042673', +'2001-11-28 00:50:27.051028', 'c'),(1, '2006-05-13', '01:46:09.016386', +'2007-10-09 19:53:04.008332', NULL); + +CREATE TABLE bb ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, + + col_date_nokey DATE /*! NULL */, + col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, + + col_datetime_nokey DATETIME /*! NULL */, + col_time_nokey TIME /*! NULL */, + + col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + + col_varchar_nokey VARCHAR(1) /*! NULL */, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, + + PRIMARY KEY (pk), + UNIQUE KEY (col_int_key), + UNIQUE KEY (col_varchar_key), + UNIQUE KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + UNIQUE KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_int_nokey), + KEY(col_int_key,col_date_key), + KEY(col_int_key, col_time_key), + KEY(col_int_key, col_datetime_key), + UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), + UNIQUE KEY (col_varchar_key, col_varchar_nokey), + UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) + ) AUTO_INCREMENT=10 ENGINE=INNODB; + +INSERT /*! IGNORE */ INTO bb ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey + ) VALUES (0, '2003-08-04', '01:48:05.048577', +'2006-11-03 00:00:00', 'p'),(2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); + +CREATE TABLE cc ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL not null, + + col_date_nokey DATE /*! NULL */, + col_date_key DATE GENERATED ALWAYS AS +(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, + + col_datetime_nokey DATETIME /*! NULL */, + col_time_nokey TIME /*! NULL */, + + col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + + col_varchar_nokey VARCHAR(1) /*! NULL */, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, + + PRIMARY KEY (pk), + UNIQUE KEY (col_int_key), + UNIQUE KEY (col_varchar_key), + UNIQUE KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + UNIQUE KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_int_nokey), + KEY(col_int_key,col_date_key), + KEY(col_int_key, col_time_key), + KEY(col_int_key, col_datetime_key), + UNIQUE +KEY(col_date_key,col_time_key,col_datetime_key), + UNIQUE KEY (col_varchar_key, col_varchar_nokey), + UNIQUE KEY (col_int_key, col_varchar_key, +col_date_key, col_time_key, col_datetime_key) + ) AUTO_INCREMENT=10 ENGINE=INNODB; + +INSERT /*! IGNORE */ INTO cc ( + col_int_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_varchar_nokey + ) VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'),(NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); + +let $query= +SELECT +gp1 . col_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +col_time_nokey ) +WHERE +gp1 . col_varchar_nokey IN +( +SELECT +DISTINCT p1 . col_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . col_int_key = p2 . pk ) +) +AND gp1 . col_varchar_nokey = 'b' +HAVING g1 > 6; + +eval EXPLAIN $query; +eval $query; +DROP TABLE bb, c, cc; + +--echo # Bug#21284646: Assertion !(table || table->read_set || bitmap_is_set()) + +CREATE TABLE c ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL not null, + col_date_nokey DATE NOT NULL, + col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, + col_datetime_nokey DATETIME NOT NULL, + col_time_nokey TIME NOT NULL, + col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, + PRIMARY KEY (pk,col_int_nokey), + UNIQUE KEY (col_int_key), + UNIQUE KEY (col_varchar_key), + UNIQUE KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + UNIQUE KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_int_nokey), + KEY(col_int_key,col_date_key), + KEY(col_int_key, col_time_key), + KEY(col_int_key, col_datetime_key), + UNIQUE KEY (col_date_key,col_time_key,col_datetime_key), + UNIQUE KEY (col_varchar_key, col_varchar_nokey), + UNIQUE KEY (col_int_key, col_varchar_key, col_date_key, col_time_key, col_datetime_key) +) ENGINE=INNODB; + +INSERT INTO c (col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) VALUES +(1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(2, '2002-10-13', '00:00:00', '1900-01-01 00:00:00', 's'), +(4, '1900-01-01', '15:57:25.019666', '2005-08-15 00:00:00', 'r'); + +ANALYZE TABLE c; +let $query= +SELECT COUNT(DISTINCT col_varchar_key) AS x +FROM c +WHERE col_varchar_key IN ('rr', 'rr') OR + col_int_nokey <> 9 AND + pk >= 8 +HAVING x > '2000-02-06' +ORDER BY col_time_nokey, pk; + +eval explain $query; +eval $query; + +DROP TABLE c; + +--echo # Bug#21341044: Conditional jump at sort_param::make_sort_key + +CREATE TABLE t1 ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, + col_blob_nokey BLOB /*! NULL */, + col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, + col_longblob_nokey LONGBLOB /*! NULL */, + col_longtext_nokey LONGTEXT /*! NULL */, + col_longblob_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 20)) VIRTUAL, + col_longtext_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 18)) VIRTUAL, + col_text_nokey TEXT /*! NULL */, + col_text_key TEXT GENERATED ALWAYS AS (REPEAT(col_text_nokey, 30)) VIRTUAL, + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_text_key(50)), + KEY (col_blob_key(200)), + KEY (col_longtext_key(200)), + KEY (col_longblob_key(200)), + KEY (col_int_key, col_text_key(100)), + KEY (col_int_key, col_longtext_key(100)), + KEY (col_int_key, col_blob_key(100)), + KEY (col_int_key, col_longblob_key(100)), + KEY (col_longtext_key(10), col_longblob_key(100)), + KEY (col_int_key, col_text_key(10), col_blob_key(100), col_longtext_key(50), col_longblob_key(50)) +) engine=innodb; + +INSERT INTO t1 (col_int_nokey,col_blob_nokey,col_longtext_nokey,col_longblob_nokey,col_text_nokey) +VALUES +(0, 'ijcszxw', 'ijcszxw', 'ijcszxw', 'ijcszxw'), +(5, 'jcszxwb', 'jcszxwb', 'jcszxwb', 'jcszxwb'), +(4, 'cszxwbjjvv', 'cszxwbjjvv', 'cszxwbjjvv', 'cszxwbjjvv'), +(3, 'szxw', 'szxw', 'szxw', 'szxw'), +(7, 'zxwb', 'zxwb', 'zxwb', 'zxwb'), +(42, 'xwbjjvvky', 'xwbjjvvky', 'xwbjjvvky', 'xwbjjvvky'), +(142, 'wbjj', 'wbjj', 'wbjj', 'wbjj'), +(5, 'bjjv', 'bjjv', 'bjjv', 'bjjv'), +(0, 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu'), +(3, 'j', 'j', 'j', 'j'); + +SELECT alias1.pk AS field1 +FROM t1 AS alias1 LEFT OUTER JOIN t1 AS alias2 + ON alias1.col_int_key = alias2.col_int_key +WHERE alias2.col_int_key BETWEEN 8 AND (8 + 1 ) OR + alias2.col_int_key BETWEEN 8 AND (8 + 5 ) AND + alias2.col_int_key != 20 OR + alias2.col_int_key IN (8, 5, 8) AND + alias2.col_int_key >= 0 AND + alias2.col_int_key <= ( 8 + 75 ) AND + alias1.pk IS NOT NULL +ORDER BY field1; + +DROP TABLE t1; +--echo # bug#21487651: gcols: memory leak after failed alter table +CREATE TABLE t(a int); +ALTER TABLE t ADD COLUMN b int GENERATED ALWAYS AS ( +date_sub(a,interval a month)) VIRTUAL; +--error 1111 +ALTER TABLE t ADD COLUMN c int GENERATED ALWAYS AS (sum(a)); +DROP TABLE t; + +--echo # +--echo # Bug#21628840: CRASH/MEMORY CORRUPTION ADDING INDEXES TO VIRTUAL COLUMN +--echo # (II) +--echo # +CREATE TABLE t1( a INT ) ENGINE = INNODB; +INSERT INTO t1( a ) VALUES ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ); + +ALTER TABLE t1 ADD COLUMN b INT GENERATED ALWAYS AS (a - 1) STORED; +ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS (b + 1) VIRTUAL; + +--echo # Used to cause valgrind warning. +ALTER TABLE t1 ADD INDEX( c ); + +ANALYZE TABLE t1; + +--echo # Make sure the index is correct. That's kinda important. +EXPLAIN +SELECT c FROM t1; +SELECT c FROM t1; + +DROP TABLE t1; + +--echo # +--echo # Bug#21797776 ASSERTION `BIT < MAP->N_BITS' FAILED. +--echo # + +CREATE TABLE C ( +col_int_1 INT, +col_int_2 INT GENERATED ALWAYS AS (col_int_1 + col_int_1) STORED, +col_int_3 INT GENERATED ALWAYS AS (col_int_2 + col_int_1) VIRTUAL +); + +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS + SELECT + col_int_2 AS field1, col_int_2 AS field2, + col_int_3 AS field3, col_int_3 AS field4 + FROM C; + +SELECT * FROM v1; + +DROP TABLE C; +DROP VIEW v1; + +--echo # +--echo # Bug#21613615 GCOLS: ASSERTION FAILED: !TABLE || (!TABLE->READ_SET || BITMAP_IS_SET +--echo # + +CREATE TABLE t (a INT); +CREATE TABLE v ( +a INT, +c INT, +b CHAR(2) GENERATED ALWAYS AS (a IN (1)) VIRTUAL, +KEY(c,b(1))); +INSERT INTO v (a,c) VALUES (1,1); + +let $query= +SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); +eval EXPLAIN $query; +eval $query; + +# A similar one: +let $query= +SELECT (SELECT MAX(c) FROM v); +eval EXPLAIN $query; +eval $query; + +DROP TABLE t, v; + +CREATE TABLE v ( +a INT, +c INT, +b CHAR(2) GENERATED ALWAYS AS (a IN (1)) VIRTUAL, KEY(c,b(1))); +INSERT INTO v (a,c) VALUES (1,1); +SELECT MAX(c), COUNT(b) FROM v; +DROP TABLE v; + +# Using PK suffix of secondary index +CREATE TABLE v ( +a INT PRIMARY KEY, +b INT, KEY(b)); +INSERT INTO v (a,b) VALUES (1,1); +SELECT MAX(a) FROM v WHERE b=1; +DROP TABLE v; + +--echo # +--echo # Bug#21824519: ASSERTION IN DROP TRIGGER WHEN TABLE HAS +--echo # VIRTUAL GENERATED COLUMN +--echo # +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL); +CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW BEGIN END; +INSERT INTO t (a) VALUES (1); +SELECT * FROM t; +# DROP TRIGGER used to hit a DBUG_ASSERT. +DROP TRIGGER tr; +SELECT * FROM t; +CREATE FUNCTION f() RETURNS INT RETURN (SELECT COUNT(*) FROM t); +# And this function call hit the same DBUG_ASSERT. +SELECT f(); +DROP FUNCTION f; +SELECT * FROM t; +DROP TABLE t; + +--echo # +--echo # Bug#21833760 CALC_DAYNR: ASSERTION `DELSUM+(INT) Y/4-TEMP >= 0' FAILED. +--echo # + +CREATE TABLE C( +c1 INT AUTO_INCREMENT, +c8 DATETIME, +c9 TIME, +c11 TIME GENERATED ALWAYS AS(ADDTIME(c8,c9)) VIRTUAL, +c13 TIME GENERATED ALWAYS AS(ADDTIME(c8,c11)) VIRTUAL, +PRIMARY KEY(c1), +UNIQUE KEY(c13) +); + +INSERT INTO C (c8,c9) VALUES('1970-01-01',0),('1970-01-01',1); + +CREATE VIEW view_C AS SELECT * FROM C; + +SELECT /*+ NO_BNL(t1) */ t1.c13 FROM C AS t2 STRAIGHT_JOIN C AS t1 FORCE INDEX(c13); +SELECT DISTINCT t1.c13 FROM C AS t1, view_C AS t2; + +DROP TABLE C; +DROP VIEW view_C; + +--echo # +--echo # Bug #21808680: JSON + GENERATED COLUMN CORRUPTS TABLE CACHE +--echo # MEMORY, CRASHES +--echo # +CREATE TABLE t (a INT, b JSON, c TEXT GENERATED ALWAYS AS (REPEAT(a=b, 2))); +INSERT INTO t (a, b) VALUES (1, '2'), (3, '3'); +# The next statement used to crash. +SELECT * FROM t; +DROP TABLE t; + +--echo # +--echo # Bug#21810529: CRASH IN ITEM_FUNC::WALK WHEN CODE JUMPS TO GARBAGE +--echo # LOCATION +--echo # +CREATE TABLE t (a TIME,b INT GENERATED ALWAYS AS (a=1) VIRTUAL); +--error ER_BAD_FIELD_ERROR +ALTER TABLE t CHANGE COLUMN q w INT; +--error ER_BAD_FIELD_ERROR +ALTER TABLE t CHANGE COLUMN q w INT; +--error ER_BAD_FIELD_ERROR +ALTER TABLE t CHANGE COLUMN q w INT; +--error ER_BAD_FIELD_ERROR +ALTER TABLE t CHANGE COLUMN q w INT; +DROP TABLE t; + +--echo # +--echo # Bug#21940542 TOO MUCH SPAM: INNODB: COMPUTE VIRTUAL COLUMN VALUES FAILED +--echo # + +CREATE TABLE t(b BLOB); +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +ALTER TABLE t ADD COLUMN c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL; +DROP TABLE t; +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t(b BLOB, c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL); + +--echo # +--echo # Bug#21929967 GCOLS: GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE +--echo # + +CREATE TABLE t1(a CHAR(1), b CHAR(1), c CHAR(2) AS (a || b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES('1','1'); +SELECT * FROM t1; +SET SQL_MODE=PIPES_AS_CONCAT; +SELECT * FROM t1; +FLUSH TABLES; +SELECT * FROM t1; +DROP TABLE t1; +# The other way around: +CREATE TABLE t1(a CHAR(1), b CHAR(1), c CHAR(2) AS (a || b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES('1','1'); +SELECT * FROM t1; +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +FLUSH TABLES; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # Bug#22018999: gcols: assertion failed: !error + +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; + +--error ER_TRUNCATED_WRONG_VALUE +CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; + +CREATE TABLE t (a INTEGER) engine=innodb; + +--error ER_TRUNCATED_WRONG_VALUE +ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1)); + +DROP TABLE t; + +set sql_mode= @save_old_sql_mode; + +--echo # Bug#21875520 Problems with virtual column indexes + +CREATE TABLE t( + a TIMESTAMP, + b BLOB, + c TIMESTAMP GENERATED ALWAYS AS (GREATEST(a, '2000-01-01 00:00:00')) VIRTUAL, + UNIQUE KEY(c) +); +INSERT INTO t(b) VALUES (''); +UPDATE t SET a='2001-01-01 00:00:00'; +SELECT c FROM t; +SELECT c, a FROM t; +UPDATE t SET b='xyz'; +DO (SELECT @c1:= c FROM t); +DO (SELECT (@c2:= c) - a FROM t); +SELECT @c2 - @c1; + +DROP TABLE t; + +--echo # +--echo # Bug#22133710 GCOLS: READ UNCOMMITTED: ASSERT !TABLE || (!TABLE->WRITE_SET || BITMAP_IS_SET(TA +--echo # + +CREATE TABLE t ( + a INT, + b INT GENERATED ALWAYS AS (1) VIRTUAL, + c INT GENERATED ALWAYS AS (1) VIRTUAL, + d INT GENERATED ALWAYS AS (1) VIRTUAL, + KEY (b,d) +) ENGINE=INNODB; +INSERT INTO t VALUES(); +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; +SELECT 1 FROM t WHERE c GROUP BY b; +COMMIT; +DROP TABLE t; diff --git a/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test b/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test new file mode 100644 index 00000000000..285974d1ccc --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_column_def_options_innodb.test # +# # +# Purpose: # +# Testing different optional parameters of generated columns. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_column_def_options.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test b/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test new file mode 100644 index 00000000000..4f91b0021bc --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_column_def_options_myisam.test # +# # +# Purpose: # +# Testing different optional parameters of generated columns. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +let $support_virtual_foreign= 0; +--source suite/gcol/inc/gcol_column_def_options.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_handler_innodb.test b/mysql-test/suite/gcol/t/gcol_handler_innodb.test new file mode 100644 index 00000000000..50f72135497 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_handler_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_handler_innodb.test # +# # +# Purpose: # +# Testing HANDLER. +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_handler.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_handler_myisam.test b/mysql-test/suite/gcol/t/gcol_handler_myisam.test new file mode 100644 index 00000000000..219235478a7 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_handler_myisam.test @@ -0,0 +1,45 @@ +################################################################################ +# t/gcol_handler_myisam.test # +# # +# Purpose: # +# Testing HANDLER. +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_handler.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test b/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test new file mode 100644 index 00000000000..23d97a797e0 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_ins_upd_innodb.test # +# # +# Purpose: # +# Testing DDL operations such as INSERT, UPDATE, REPLACE and DELETE. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_ins_upd.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test b/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test new file mode 100644 index 00000000000..168321caab9 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_ins_upd_myisam.test # +# # +# Purpose: # +# Testing DDL operations such as INSERT, UPDATE, REPLACE and DELETE. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_ins_upd.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_keys_innodb.test b/mysql-test/suite/gcol/t/gcol_keys_innodb.test new file mode 100644 index 00000000000..3fe1ee4ff61 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_keys_innodb.test @@ -0,0 +1,89 @@ +################################################################################ +# t/gcol_keys_innodb.test # +# # +# Purpose: # +# Testing keys, indexes defined upon generated columns. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $skip_spatial_index_check = 1; +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_keys.inc + +if ($support_virtual_index) { +#------------------------------------------------------------------------------# +# Execute storage engine specific tests +--echo # +--echo # BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET +--echo # +CREATE TABLE t1 ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_varchar_nokey VARCHAR(1), + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, + PRIMARY KEY (pk) +); + +INSERT INTO t1 ( col_int_nokey, col_varchar_nokey) +VALUES (4, 'b'),(9, 'o'),(4, 'k'),(5, 'a'),(5, 'f'), +(9, 't'),(3, 'c'),(8, 'c'),(0, 'r'),(98, 'k'); + +CREATE TABLE t2 ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER NOT NULL, + col_varchar_nokey VARCHAR(1) NOT NULL, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS + (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, + PRIMARY KEY (pk), + UNIQUE KEY (col_varchar_key) +); + +INSERT INTO t2 ( col_int_nokey, col_varchar_nokey) +VALUES (1, 'c'),(8, 'm'),(9, 'd'), (6, 'y'),(1, 't'), +(2, 's'),(4, 'r'); + +SELECT + CONCAT( t2.col_varchar_nokey , t2.col_varchar_nokey ) AS f2, + t1.col_varchar_key AS f5 +FROM + t2 LEFT JOIN t1 ON t2.col_int_nokey > t1.col_int_nokey +ORDER BY f2, f5; +DROP TABLE t1,t2; + +--echo # + +} +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_keys_myisam.test b/mysql-test/suite/gcol/t/gcol_keys_myisam.test new file mode 100644 index 00000000000..bbe27b90c7e --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_keys_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_keys_myisam.test # +# # +# Purpose: # +# Testing keys, indexes defined upon generated columns. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_keys.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_memory.test b/mysql-test/suite/gcol/t/gcol_memory.test new file mode 100644 index 00000000000..a7d9235da02 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_memory.test @@ -0,0 +1,43 @@ +################################################################################ +# t/gcol_memory.test # +# # +# Purpose: # +# MEMORY branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-02 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +SET @@session.default_storage_engine = 'memory'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests +--source suite/gcol/inc/gcol_unsupported_storage_engines.inc + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_merge.test b/mysql-test/suite/gcol/t/gcol_merge.test new file mode 100644 index 00000000000..fd90da42328 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_merge.test @@ -0,0 +1,52 @@ +################################################################################ +# t/gcol_merge.test # +# # +# Purpose: # +# MERGE branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-03 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (a int, b int generated always as (a % 10) virtual); +create table t2 (a int, b int generated always as (a % 10) virtual); +insert into t1 values (1,default); +insert into t2 values (2,default); +--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +create table t3 (a int, b int generated always as (a % 10) virtual) engine=MERGE UNION=(t1,t2); +drop table t1,t2; + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_non_stored_columns_innodb.test b/mysql-test/suite/gcol/t/gcol_non_stored_columns_innodb.test new file mode 100644 index 00000000000..ed0d255bfd8 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_non_stored_columns_innodb.test @@ -0,0 +1,48 @@ +################################################################################ +# t/gcol_non_stored_columns_innodb.test # +# # +# Purpose: # +# Ensure that MySQL behaviour is consistent irrelevant of # +# - the place of a non-stored column among other columns, # +# - the total number of non-stored fields. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_non_stored_columns.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_non_stored_columns_myisam.test b/mysql-test/suite/gcol/t/gcol_non_stored_columns_myisam.test new file mode 100644 index 00000000000..9784071e126 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_non_stored_columns_myisam.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_non_stored_columns_myisam.test # +# # +# Purpose: # +# Ensure that MySQL behaviour is consistent irrelevant of # +# - the place of a non-stored column among other columns, # +# - the total number of non-stored fields. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_non_stored_columns.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_partition_innodb.test b/mysql-test/suite/gcol/t/gcol_partition_innodb.test new file mode 100644 index 00000000000..06e6ccc1ba4 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_partition_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_partition_innodb.test # +# # +# Purpose: # +# Testing partitioning tables with generated columns. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_partition.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_partition_myisam.test b/mysql-test/suite/gcol/t/gcol_partition_myisam.test new file mode 100644 index 00000000000..0a0cd9f9e86 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_partition_myisam.test @@ -0,0 +1,45 @@ +################################################################################ +# t/gcol_partition_myisam.test # +# # +# Purpose: # +# Testing partitioning tables with generated columns. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_partition.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_rejected_innodb.test b/mysql-test/suite/gcol/t/gcol_rejected_innodb.test new file mode 100644 index 00000000000..1780fdf8c19 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_rejected_innodb.test @@ -0,0 +1,41 @@ +################################################################################ +# t/gcol_handler_innodb.test # +# # +# Purpose: # +# Testing rejected generated column additions. +# # +# InnoDB branch # +# # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +# @todo This test is broken for all VIRTUAL columns +#--source suite/gcol/inc/gcol_rejected.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_rollback.test b/mysql-test/suite/gcol/t/gcol_rollback.test new file mode 100644 index 00000000000..5109012b2e2 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_rollback.test @@ -0,0 +1,108 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/not_embedded.inc + +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + +CREATE TABLE t ( + a INTEGER, + b BLOB GENERATED ALWAYS AS (a) VIRTUAL, + INDEX (b(57)) +)ENGINE=INNODB; + +INSERT INTO t (a) VALUES (9); +BEGIN; +SAVEPOINT a; +UPDATE t set a = 12; +DELETE FROM t where a = 12; +ROLLBACK TO SAVEPOINT a; +COMMIT; + +CHECK TABLE t; + +SELECT * FROM t; + +BEGIN; +INSERT INTO t (a) VALUES (10); +--source include/kill_and_restart_mysqld.inc +SELECT * FROM t; +DROP TABLE t; + +CREATE TABLE t ( + a INTEGER, + b BLOB GENERATED ALWAYS AS (a) VIRTUAL, + c INTEGER +)ENGINE=INNODB; + +INSERT INTO t (a,c) VALUES (9, 10); +SELECT * FROM t; + +connect (con1,localhost,root,,); +connection con1; + +# This DEBUG_SYNC should not kick in yet, because the duplicate key will be +# detected before we get a chance to apply the online log. + +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; +--send +ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE; + +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR created'; +BEGIN; +INSERT INTO t (a,c) VALUES (10, 12); +SELECT * FROM t; +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done'; + +connection con1; +reap; +disconnect con1; +connection default; + +SELECT * FROM t; +DROP TABLE t; + +# drop virtual column and alter index +CREATE TABLE t ( + a INT, + b INT, + c INT GENERATED ALWAYS AS(a+b), + d INT GENERATED ALWAYS AS(a+b+b), + KEY(c, d) +)ENGINE=INNODB; + +INSERT INTO t (a,b) VALUES (9, 10); +SELECT * FROM t; + +connect (con1,localhost,root,,); +connection con1; + +# This DEBUG_SYNC should not kick in yet, because the duplicate key will be +# detected before we get a chance to apply the online log. + +SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; +--send +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; + +connection default; +SET DEBUG_SYNC = 'now WAIT_FOR created'; +BEGIN; +INSERT INTO t (a,b) VALUES (10, 12); +SELECT * FROM t; +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done'; + +connection con1; +reap; +disconnect con1; +connection default; + +SELECT * FROM t; + +DROP TABLE t; + +# Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/gcol/t/gcol_select_innodb.test b/mysql-test/suite/gcol/t/gcol_select_innodb.test new file mode 100644 index 00000000000..18c170413a0 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_select_innodb.test @@ -0,0 +1,53 @@ +################################################################################ +# t/gcol_select_innodb.test # +# # +# Purpose: # +# Testing different SELECTs. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-18 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; +eval SET optimizer_switch='derived_merge=off'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_select.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +eval SET optimizer_switch='derived_merge=default'; +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_select_myisam.test b/mysql-test/suite/gcol/t/gcol_select_myisam.test new file mode 100644 index 00000000000..bb2b46a4fa3 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_select_myisam.test @@ -0,0 +1,52 @@ +################################################################################ +# t/gcol_select.test # +# # +# Purpose: # +# Testing different SELECTs. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-18 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; +eval SET optimizer_switch='derived_merge=off'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +let $support_virtual_index= 0; +--source suite/gcol/inc/gcol_select.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +eval SET optimizer_switch='derived_merge=default'; +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_innodb.test b/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_innodb.test new file mode 100644 index 00000000000..2e91093681c --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_innodb.test @@ -0,0 +1,45 @@ +################################################################################ +# t/gcol_supported_sql_funcs.test # +# # +# Purpose: # +# Test SQL functions allowed for generated columns # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_supported_sql_funcs_main.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_myisam.test b/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_myisam.test new file mode 100644 index 00000000000..a9dee4c76b0 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_supported_sql_funcs_myisam.test @@ -0,0 +1,44 @@ +################################################################################ +# t/gcol_supported_sql_funcs.test # +# # +# Purpose: # +# Test SQL functions allowed for generated columns # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-08-31 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_supported_sql_funcs_main.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_trigger_sp_innodb.test b/mysql-test/suite/gcol/t/gcol_trigger_sp_innodb.test new file mode 100644 index 00000000000..4478cbe23fe --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_trigger_sp_innodb.test @@ -0,0 +1,47 @@ +################################################################################ +# t/gcol_trigger_sp_innodb.test # +# # +# Purpose: # +# Testing triggers, stored procedures and functions # +# defined on tables with generated columns. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_trigger_sp.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_trigger_sp_myisam.test b/mysql-test/suite/gcol/t/gcol_trigger_sp_myisam.test new file mode 100644 index 00000000000..1a39d921c11 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_trigger_sp_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_trigger_sp_myisam.test # +# # +# Purpose: # +# Testing triggers, stored procedures and functions # +# defined on tables with generated columns. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_trigger_sp.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_update.test b/mysql-test/suite/gcol/t/gcol_update.test new file mode 100644 index 00000000000..0a7265bebac --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_update.test @@ -0,0 +1,56 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +# The embedded server does not support restarting. +--source include/not_embedded.inc + +set global innodb_purge_stop_now = 1; + +# Index on virtual column + +create table t1(f1 int not null, f2 blob not null, f3 blob not null, + vchar char(2) as (substr(f3,2,2)) virtual, + primary key(f1, f3(5)), index(vchar))engine=innodb; + +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); + +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; + +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +--source include/restart_mysqld.inc +set global innodb_purge_stop_now = 1; +drop table t1; + +# Index on virtual column and blob + +create table t1(f1 int not null, f2 blob not null, f3 blob not null, + vchar char(2) as (substr(f3,2,2)) virtual, + primary key(f1, f3(5)), index(vchar, f3(2)))engine=innodb; + +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); + +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; + +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +--source include/restart_mysqld.inc +set global innodb_purge_stop_now = 1; +drop table t1; + +# Index on virtual column of blob type + +create table t1(f1 int not null, f2 blob not null, f3 blob not null, + vchar blob as (f3) virtual, + primary key(f1, f3(5)), index(vchar(3)))engine=innodb; + +insert into t1(f1,f2,f3) values(1, repeat('a',8000), repeat('b', 9000)); + +update t1 set f1=5 where f1=1; +delete from t1 where f1=5; + +set global innodb_purge_run_now=1; +set global innodb_fast_shutdown=0; +--source include/restart_mysqld.inc +drop table t1; diff --git a/mysql-test/suite/gcol/t/gcol_view_innodb.test b/mysql-test/suite/gcol/t/gcol_view_innodb.test new file mode 100644 index 00000000000..06ded123776 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_view_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/gcol_view_innodb.test # +# # +# Purpose: # +# Testing views defined on tables with generated columns. # +# # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +eval SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_view.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/gcol_view_myisam.test b/mysql-test/suite/gcol/t/gcol_view_myisam.test new file mode 100644 index 00000000000..3779f0bb045 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_view_myisam.test @@ -0,0 +1,45 @@ +################################################################################ +# t/gcol_view_myisam.test # +# # +# Purpose: # +# Testing views defined on tables with generated columns. # +# # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +eval SET @@session.default_storage_engine = 'MyISAM'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/gcol/inc/gcol_view.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc diff --git a/mysql-test/suite/gcol/t/rpl_gcol.test b/mysql-test/suite/gcol/t/rpl_gcol.test new file mode 100644 index 00000000000..6193d944101 --- /dev/null +++ b/mysql-test/suite/gcol/t/rpl_gcol.test @@ -0,0 +1,65 @@ +################################################################################ +# t/gcol_rpl.test # +# # +# Purpose: # +# Test replication of tables with generated columns. # +# # +#------------------------------------------------------------------------------# +# Original Author: Andrey Zhakov # +# Original Date: 2008-09-04 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +# Set the session storage engine +--source include/have_innodb.inc +SET @@session.default_storage_engine = 'InnoDB'; + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source include/master-slave.inc + +connection master; +create table t1 (a int, b int generated always as (a+1) virtual); +show create table t1; +insert into t1 values (1,default); +insert into t1 values (2,default); +select * from t1; +save_master_pos; + +connection slave; +sync_with_master; +select * from t1; + +connection master; +drop table t1; +save_master_pos; + +connection slave; +sync_with_master; + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/gcol/inc/gcol_cleanup.inc +--source include/rpl_end.inc diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result index f2d6b4105ff..934a84cc3cc 100644 --- a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result +++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result @@ -1,15 +1,15 @@ -create table t1 (c2 int as (-c1), c1 int primary key auto_increment) engine=innodb; +create table t1 (c2 int as (1+1), c1 int primary key auto_increment) engine=innodb; insert into t1(c1) values (null),(null),(null); select * from t1; c2 c1 --1 1 --2 2 --3 3 +2 1 +2 2 +2 3 alter table t1 auto_increment = 3; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` int(11) AS (-c1) VIRTUAL, + `c2` int(11) AS (1+1) VIRTUAL, `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test b/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test index 2f2ac3d08e1..d499a06c3d7 100644 --- a/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test +++ b/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test @@ -1,6 +1,6 @@ --source include/have_innodb.inc -create table t1 (c2 int as (-c1), c1 int primary key auto_increment) engine=innodb; +create table t1 (c2 int as (1+1), c1 int primary key auto_increment) engine=innodb; insert into t1(c1) values (null),(null),(null); select * from t1; alter table t1 auto_increment = 3; diff --git a/sql/field.h b/sql/field.h index 4292f3ffc8a..8644037d13a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -615,7 +615,7 @@ public: name.length= 0; }; ~Virtual_column_info() {} - enum_field_types get_real_type() + enum_field_types get_real_type() const { return field_type; } @@ -624,7 +624,7 @@ public: /* Calling this function can only be done once. */ field_type= fld_type; } - bool is_stored() + bool is_stored() const { return stored_in_db; } @@ -632,7 +632,7 @@ public: { stored_in_db= stored; } - bool is_in_partitioning_expr() + bool is_in_partitioning_expr() const { return in_partitioning_expr; } @@ -640,7 +640,7 @@ public: { in_partitioning_expr= TRUE; } - bool is_equal(Virtual_column_info* vcol) + bool is_equal(const Virtual_column_info* vcol) const { return field_type == vcol->get_real_type() && stored_in_db == vcol->is_stored() diff --git a/sql/item.cc b/sql/item.cc index 546300defcd..04c573ee8b4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -948,7 +948,8 @@ bool Item_field::register_field_in_write_map(void *arg) - All fields that have default value as a constant are initialized first. - Then user-specified values from the INSERT list - Then all fields that has a default expression, in field_index order. - - Last all virtual fields, in field_index order. + - Then all virtual fields, in field_index order. + - Then auto-increment values This means: - For default fields we can't access the same field or a field after @@ -956,6 +957,7 @@ bool Item_field::register_field_in_write_map(void *arg) - A virtual fields can't access itself or a virtual field after itself. - user-specified values will not see virtual fields or default expressions, as in INSERT t1 (a) VALUES (b); + - no virtual fields can access auto-increment values This is used by fix_vcol_expr() when a table is opened @@ -965,11 +967,18 @@ bool Item_field::register_field_in_write_map(void *arg) bool Item_field::check_field_expression_processor(void *arg) { + Field *org_field= (Field*) arg; if (field->flags & NO_DEFAULT_VALUE_FLAG) return 0; + if (field->flags & AUTO_INCREMENT_FLAG) + { + my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD, + MYF(0), + org_field->field_name, field->field_name); + return 1; + } if ((field->default_value && field->default_value->flags) || field->vcol_info) { - Field *org_field= (Field*) arg; if (field == org_field || (!org_field->vcol_info && field->vcol_info) || (((field->vcol_info && org_field->vcol_info) || diff --git a/sql/item.h b/sql/item.h index 5129d8bfe85..ae5acd365e1 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1628,7 +1628,7 @@ public: return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE); } virtual bool check_field_expression_processor(void *arg) { return 0; } - + virtual bool check_func_default_processor(void *arg) { return 0; } /* Check if an expression value has allowed arguments, like DATE/DATETIME for date functions. Also used by partitioning code to reject @@ -3347,9 +3347,11 @@ public: } bool check_partition_func_processor(void *int_arg) {return TRUE;} - bool check_vcol_func_processor(void *arg) - { - return mark_unsupported_function(func_name, arg, VCOL_IMPOSSIBLE); + + bool check_vcol_func_processor(void *arg) + { // VCOL_TIME_FUNC because the value is not constant, but does not + // require fix_fields() to be re-run for every statement. + return mark_unsupported_function(func_name, arg, VCOL_TIME_FUNC); } }; @@ -5094,6 +5096,7 @@ public: table_map used_tables() const { return (table_map)0L; } Item_field *field_for_view_update() { return 0; } bool update_vcol_processor(void *arg) { return 0; } + bool check_func_default_processor(void *arg) { return true; } bool walk(Item_processor processor, bool walk_subquery, void *args) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 710d7decc25..ccd9288cfb7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6222,6 +6222,15 @@ static int compare_uint(const uint *s, const uint *t) } +/* + Check if the column is computed and either + is stored or is used in the partitioning expression. +*/ +static bool vcol_affecting_storage(const Virtual_column_info* vcol) +{ + return vcol && (vcol->is_stored() || vcol->is_in_partitioning_expr()); +} + /** Compare original and new versions of a table and fill Alter_inplace_info describing differences between those versions. @@ -6428,14 +6437,11 @@ static bool fill_alter_inplace_info(THD *thd, ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; } - /* - Check if the column is computed and either - is stored or is used in the partitioning expression. - */ - if (field->vcol_info && - (field->stored_in_db() || field->vcol_info->is_in_partitioning_expr())) + if (vcol_affecting_storage(field->vcol_info) || + vcol_affecting_storage(new_field->vcol_info)) { if (is_equal == IS_EQUAL_NO || + !field->vcol_info || !new_field->vcol_info || !field->vcol_info->is_equal(new_field->vcol_info)) ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; else From d137b4dbbac1ce53906ca15817334e3a4daa2655 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Nov 2016 17:33:40 +0100 Subject: [PATCH 065/135] MDEV-5800 MyISAM support for indexed vcols * don't issue an error for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN * support keyread on vcols * callback into the server to compute vcol values from mi_check/mi_repair * DMLs just work. Automatically. --- include/my_bitmap.h | 1 + include/myisamchk.h | 3 + mysql-test/suite/gcol/inc/gcol_ins_upd.inc | 1 + mysql-test/suite/gcol/inc/gcol_keys.inc | 9 +- .../r/gcol_column_def_options_myisam.result | 142 +++- .../suite/gcol/r/gcol_ins_upd_myisam.result | 150 ++++ .../suite/gcol/r/gcol_keys_myisam.result | 429 ++++++++++++ .../suite/gcol/r/gcol_select_myisam.result | 640 +++++++++++++++++- .../t/gcol_column_def_options_myisam.test | 3 +- .../suite/gcol/t/gcol_ins_upd_myisam.test | 2 +- mysql-test/suite/gcol/t/gcol_keys_myisam.test | 3 +- .../suite/gcol/t/gcol_select_myisam.test | 2 +- mysql-test/suite/vcol/inc/vcol_keys.inc | 21 +- .../suite/vcol/r/vcol_keys_myisam.result | 134 +++- mysql-test/suite/vcol/t/vcol_keys_myisam.test | 54 ++ mysys/my_bitmap.c | 2 +- sql/field.h | 5 + sql/sql_table.cc | 39 +- sql/sql_update.cc | 5 +- sql/table.cc | 12 +- sql/table.h | 3 +- storage/myisam/ha_myisam.cc | 82 ++- storage/myisam/ha_myisam.h | 2 + storage/myisam/mi_check.c | 6 + storage/myisam/mi_open.c | 17 +- storage/myisam/myisamdef.h | 1 + 26 files changed, 1681 insertions(+), 87 deletions(-) diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 9c9550e3141..3e242280be4 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -58,6 +58,7 @@ extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1, const MY_BITMAP *map2); extern my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array, diff --git a/include/myisamchk.h b/include/myisamchk.h index e833a816b05..643241d84e5 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -58,6 +58,7 @@ typedef enum MI_STATS_METHOD_IGNORE_NULLS } enum_handler_stats_method; +struct st_myisam_info; typedef struct st_handler_check_param { @@ -114,6 +115,8 @@ typedef struct st_handler_check_param uint progress_counter; /* How often to call _report_progress() */ ulonglong progress, max_progress; + int (*fix_record)(struct st_myisam_info *info, uchar *record, int keynum); + mysql_mutex_t print_msg_mutex; my_bool need_print_msg_lock; myf malloc_flags; diff --git a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc index 951cf5ff0e5..4b3431eea2e 100644 --- a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc +++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc @@ -399,6 +399,7 @@ INSERT INTO t VALUES (); UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2; SELECT * FROM t; SELECT gc FROM t; +CHECK TABLE t; DROP TABLE t; } diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc index aaba019ec4c..cd5ae4ea2dd 100644 --- a/mysql-test/suite/gcol/inc/gcol_keys.inc +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -16,6 +16,7 @@ if (!$support_virtual_index) { let $skip_spatial_index_check=1; + let $skip_foreign_key_check=1; } --echo # - UNIQUE KEY @@ -118,10 +119,10 @@ drop table t1; if (!$skip_spatial_index_check) { --echo # Error "All parts of a SPATIAL index must be geometrical" - --error 1687 + --error ER_WRONG_ARGUMENTS create table t1 (a int, b int generated always as (a+1) stored, spatial index (b)); create table t1 (a int, b int generated always as (a+1) stored); - --error 1687 + --error ER_WRONG_ARGUMENTS alter table t1 add spatial index (b); drop table t1; } @@ -148,7 +149,7 @@ alter table t1 add foreign key (b) references t2(a) on update cascade; alter table t1 add foreign key (b) references t2(a) on delete set null; drop table t1; -if($support_virtual_index) +if(!$skip_foreign_key_check) { --error ER_CANT_CREATE_TABLE create table t1 (a int, b int generated always as (a+1) virtual, @@ -317,7 +318,7 @@ CREATE TABLE t1 ( UNIQUE KEY col_int_key (col_int_key) ); -ALTER TABLE t1 add unique index idx(pk), algorithm=inplace; +ALTER TABLE t1 add unique index idx(pk); DESC t1; DROP TABLE t1; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index dff8208591d..f5f8afcc353 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -49,13 +49,21 @@ alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT' at line 1 drop table t1; # [PRIMARY] KEY +create table t1 (a int, b int generated always as (a+1) virtual key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 create table t1 (a int, b int generated always as (a+1) stored key); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 +create table t1 (a int, b int generated always as (a+1) virtual primary key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 create table t1 (a int, b int generated always as (a+1) stored primary key); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 alter table t1 add column b int generated always as (a+1) stored key; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 +alter table t1 add column c int generated always as (a+2) virtual primary key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key' at line 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -265,14 +273,6 @@ a b c 1 -1 0 2 -2 -1 drop table t1,tt; -# Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON -# VIRTUAL GC FOR MYISAM -CREATE TABLE A ( -pk INTEGER, -col_int_nokey INTEGER, -col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY -(col_int_key)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column # Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: # THD->CHANGE_LIST.IS_EMPTY() # @@ -369,6 +369,36 @@ SELECT * FROM t1; c2 c1 5 2 1 5 DROP TABLE t1, t2; +# Bug#21074624:i WL8149:SIG 11 INNOBASE_GET_COMPUTED_VALUE | +# INNOBASE/HANDLER/HA_INNODB.CC:19082 +CREATE TABLE t1 ( +col1 int(11) NOT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) NOT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL, +col6 int(11) GENERATED ALWAYS AS (col3 + col3) VIRTUAL, +col7 int(11) GENERATED ALWAYS AS (col5 / col5) VIRTUAL, +col8 int(11) GENERATED ALWAYS AS (col6 / col5) VIRTUAL, +col9 text, +extra int(11) DEFAULT NULL, +KEY idx (col5) +); +INSERT INTO t1(col1,col2,col3,col4,col9,extra) +VALUES(0,6,3,4,REPEAT(4,1000),0); +ALTER TABLE t1 DROP COLUMN col1; +DROP TABLE t1; +# Bug#21390605:VALGRIND ERROR ON DELETE FROM TABLE CONTAINING +# AN INDEXED VIRTUAL COLUMN +CREATE TABLE t1 ( +a INTEGER, +b INTEGER GENERATED ALWAYS AS (a) VIRTUAL, +c INTEGER GENERATED ALWAYS AS (b) VIRTUAL, +INDEX idx (b,c) +); +INSERT INTO t1 (a) VALUES (42); +DELETE FROM t1 WHERE c = 42; +DROP TABLE t1; # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES # IN FIND_FIELD_IN_TABLE # @@ -459,6 +489,12 @@ info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t CHANGE dd d varchar(10); affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD INDEX idx(c), ADD INDEX idx1(d); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t DROP INDEX idx, DROP INDEX idx1; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 DROP TABLE t; # Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF CREATE TABLE t1( @@ -487,19 +523,34 @@ col1 col2 col3 col4 vgc1 sgc1 2 20 200 NULL 4000 0 ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD INDEX vgc1 (vgc1); ALTER TABLE t1 ADD INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +SELECT vgc1 FROM t1 order by vgc1; +vgc1 +1000 +4000 ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; SELECT * FROM t1 order by col1; col1 col2 col3 col4 vgc1 sgc1 -1 10 100 NULL 110 0 -2 20 200 NULL 220 0 +1 10 100 NULL 1000 0 +2 20 200 NULL 4000 0 SELECT sgc1 FROM t1 order by sgc1; sgc1 0 0 +ALTER TABLE t1 DROP INDEX vgc1; ALTER TABLE t1 DROP INDEX sgc1; +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 ADD UNIQUE INDEX vgc1 (vgc1); ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 / col3) VIRTUAL; +ERROR 23000: Duplicate entry '0' for key 'vgc1' ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; ERROR 23000: Duplicate entry '0' for key 'sgc1' ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; @@ -536,9 +587,72 @@ col1 col2 col3 col4 vgc1 sgc1 2 20 200 222 4000 4000 DROP TABLE t1; # +# bug#22018979: RECORD NOT FOUND ON UPDATE, +# VIRTUAL COLUMN, ASSERTION 0 +SET @sql_mode_save= @@sql_mode; +SET sql_mode= 'ANSI'; +CREATE TABLE t1 ( +a INT, +b VARCHAR(10), +c CHAR(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +PRIMARY KEY (a), +KEY c(c) +); +INSERT INTO t1(a, b) values(1, 'bbbb'), (2, 'cc'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" int(11) NOT NULL, + "b" varchar(10) DEFAULT NULL, + "c" char(3) AS (substr(b,1,3)) VIRTUAL, + PRIMARY KEY ("a"), + KEY "c" ("c") +) +SELECT * FROM t1 order by a; +a b c +1 bbbb bbb +2 cc cc +SET sql_mode= ''; +FLUSH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` varchar(10) DEFAULT NULL, + `c` char(3) AS (substr(b,1,3)) VIRTUAL, + PRIMARY KEY (`a`), + KEY `c` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1 order by a; +a b c +1 bbbb bbb +2 cc cc +DELETE FROM t1 where a= 2; +SET sql_mode= @sql_mode_save; +DROP TABLE t1; +# # Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE # ALLOWED IN GENERATED COLUMNS # +CREATE TABLE tzz(a INT DEFAULT 5, +gc1 INT AS (a+DEFAULT(a)) VIRTUAL, +gc2 INT AS (a+DEFAULT(a)) STORED, +KEY k1(gc1)); +INSERT INTO tzz(A) VALUES (1); +SELECT * FROM tzz; +a gc1 gc2 +1 6 6 +SELECT gc1 FROM tzz; +gc1 +6 +ALTER TABLE tzz MODIFY COLUMN a INT DEFAULT 6; +SELECT * FROM tzz; +a gc1 gc2 +1 7 7 +SELECT gc1 FROM tzz; +gc1 +7 +DROP TABLE tzz; # Test 1: ALTER DEFAULT # CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, @@ -546,11 +660,11 @@ b INT AS (1 + DEFAULT(a)) STORED, c INT AS (1 + DEFAULT(a)) VIRTUAL); INSERT INTO t1 VALUES (); ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result index a7db5508384..121978e2ec7 100644 --- a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result @@ -357,6 +357,26 @@ select * from t1; a b c d set sql_warnings = 0; drop table t1; +Bug#20797344: WL#8149: ALLOCATED SPACE FOR INDEXED BLOB VGC CAN BE +OVERWRITTEN FOR UPDATE +# +CREATE TABLE t (a varchar(100), b blob, +c blob GENERATED ALWAYS AS (concat(a,b)) VIRTUAL, +d blob GENERATED ALWAYS AS (b) VIRTUAL, +e int(11) GENERATED ALWAYS AS (10) VIRTUAL, +h int(11) NOT NULL, PRIMARY KEY (h), key(c(20))); +INSERT INTO t(a,b,h) VALUES('aaaaaaa','1111111', 11); +INSERT INTO t(a,b,h) VALUES('bbbbbbb','2222222', 22); +SELECT c FROM t; +c +aaaaaaa1111111 +bbbbbbb2222222 +UPDATE t SET a='ccccccc'; +SELECT c FROM t; +c +ccccccc1111111 +ccccccc2222222 +DROP TABLE t; # Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET || # BITMAP_IS_SET(TABLE->WRITE_SET # @@ -413,6 +433,21 @@ SELECT * FROM t; x y gc 2 1 3 DROP TABLE t; +CREATE TABLE t ( +x INT, y INT, gc INT GENERATED ALWAYS AS (x+1), KEY (x,gc) +); +INSERT INTO t VALUES (); +UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2; +SELECT * FROM t; +x y gc +1 2 2 +SELECT gc FROM t; +gc +2 +CHECK TABLE t; +Table Op Msg_type Msg_text +test.t check status OK +DROP TABLE t; # stored CREATE TABLE C ( col_varchar_nokey VARCHAR(1), @@ -474,6 +509,95 @@ SELECT * from C; col_varchar_nokey col_varchar_key a aa DROP TABLE C; +# virtual, indexed +CREATE TABLE C ( +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, +KEY (col_varchar_key, col_varchar_nokey) +); +INSERT INTO C (col_varchar_nokey) VALUES ('c'); +EXPLAIN UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE OUTR1 system NULL NULL NULL NULL 1 +1 SIMPLE OUTR2 system NULL NULL NULL NULL 1 +UPDATE C AS OUTR1, C AS OUTR2 +SET OUTR1.`col_varchar_nokey` = 'f', +OUTR2.`col_varchar_nokey` = "a"; +SELECT * from C; +col_varchar_nokey col_varchar_key +a aa +DROP TABLE C; +# +# Bug #21530366 CRASH/ASSERTION, CORRUPTION WITH INDEXES + +# VIRTUAL COLUMNS, BLOB +# +CREATE TABLE t ( +a INTEGER, +b BLOB GENERATED ALWAYS AS (a) VIRTUAL, +INDEX (b(57)) +); +INSERT INTO t (a) VALUES (9); +UPDATE t SET a = 10; +DELETE FROM t WHERE a = 10; +DROP TABLE t; +# Bug#21807818: Generated columns not updated with empty insert list +CREATE TABLE t ( +a BLOB GENERATED ALWAYS AS ('') VIRTUAL, +b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL, +KEY (a(183),b) +); +INSERT INTO t VALUES(), (), (); +DELETE IGNORE FROM t; +DROP TABLE t; +# +# Bug#22195458:GCOLS: ASSERTION 0 AND CORRUPTION... +# +CREATE TABLE t ( +a INT, +b YEAR GENERATED ALWAYS AS ('a') VIRTUAL, +c YEAR GENERATED ALWAYS AS ('aaaa') VIRTUAL, +b1 YEAR GENERATED ALWAYS AS ('a') STORED, +c1 YEAR GENERATED ALWAYS AS ('aaaa') STORED, +UNIQUE(b), +UNIQUE(b1) +); +INSERT INTO t VALUES(); +SELECT b from t; +b +2000 +SELECT b1 from t; +b1 +0000 +SELECT * from t; +a b c b1 c1 +NULL 2000 0000 0000 0000 +DELETE FROM t; +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +DROP TABLE t; +# Bug#22195364:GCOLS: FAILING ASSERTION: +# DFIELD_IS_NULL(DFIELD2) || DFIELD2->DATA +CREATE TABLE t ( +a INT, +c BLOB GENERATED ALWAYS AS ('') VIRTUAL, +UNIQUE KEY(c(1),a) +); +INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2; +SELECT * FROM t; +a c +1 +INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2; +SELECT * FROM t; +a c +2 +SELECT GROUP_CONCAT(c ORDER BY c) FROM t; +GROUP_CONCAT(c ORDER BY c) + +DROP TABLE t; #Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL, c2 INT GENERATED ALWAYS AS(2) STORED); @@ -515,6 +639,32 @@ i1 i2 5 10 5 10 DROP TABLE t1,t2; +# +# Bug#22070021 GCOL:ASSERTION `!TABLE || (!TABLE->WRITE_SET || +# BITMAP_IS_SET(TABLE->WRITE_SET, +# +CREATE TABLE t1( +c1 INT, +c2 INT GENERATED ALWAYS AS (c1 + c1) VIRTUAL, +KEY(c2) +); +INSERT INTO t1(c1) VALUES(0); +DELETE O1.* FROM t1 AS O1, t1 AS O2; +SELECT * FROM t1; +c1 c2 +DROP TABLE t1; +# +# Bug#21944199 SIMPLE DELETE QUERY CAUSES INNODB: FAILING ASSERTION: 0 +# & DATA CORRUPTION +# +CREATE TEMPORARY TABLE t1 ( +a INTEGER NOT NULL, +b INTEGER GENERATED ALWAYS AS (a+1) VIRTUAL +); +INSERT INTO t1 (a) VALUES (0), (0), (0); +ALTER TABLE t1 ADD INDEX idx (b); +DELETE FROM t1; +DROP TEMPORARY TABLE t1; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index f6a4ffe6c60..162035c999e 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -6,6 +6,19 @@ SET @@session.default_storage_engine = 'MyISAM'; # - FOREIGN INDEX (partially supported) # - CHECK (allowed but not used) # UNIQUE +create table t1 (a int, b int generated always as (a*2) virtual unique); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) VIRTUAL, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL VIRTUAL +drop table t1; create table t1 (a int, b int generated always as (a*2) stored unique); show create table t1; Table Create Table @@ -19,6 +32,19 @@ Field Type Null Key Default Extra a int(11) YES NULL b int(11) YES UNI NULL PERSISTENT drop table t1; +create table t1 (a int, b int generated always as (a*2) virtual, unique key (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) VIRTUAL, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES UNI NULL VIRTUAL +drop table t1; create table t1 (a int, b int generated always as (a*2) stored, unique (b)); show create table t1; Table Create Table @@ -32,6 +58,9 @@ Field Type Null Key Default Extra a int(11) YES NULL b int(11) YES UNI NULL PERSISTENT drop table t1; +create table t1 (a int, b int generated always as (a*2) virtual); +alter table t1 add unique key (b); +drop table t1; create table t1 (a int, b int generated always as (a*2) stored); alter table t1 add unique key (b); drop table t1; @@ -41,6 +70,21 @@ drop table t1; # - gcol_select.inc # # INDEX +create table t1 (a int, b int generated always as (a*2) virtual, index (b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a*2) VIRTUAL, + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES MUL NULL VIRTUAL +drop table t1; +create table t1 (a int, b int generated always as (a*2) virtual, index (a,b)); +drop table t1; create table t1 (a int, b int generated always as (a*2) stored, index (b)); show create table t1; Table Create Table @@ -67,6 +111,10 @@ Field Type Null Key Default Extra a int(11) YES MUL NULL b int(11) YES NULL PERSISTENT drop table t1; +create table t1 (a int, b int generated always as (a*2) virtual); +alter table t1 add index (b); +alter table t1 add index (a,b); +drop table t1; create table t1 (a int, b int generated always as (a*2) stored); alter table t1 add index (b); drop table t1; @@ -81,6 +129,13 @@ drop table t1; # # TODO: FULLTEXT INDEX # SPATIAL INDEX +# Error "All parts of a SPATIAL index must be geometrical" +create table t1 (a int, b int generated always as (a+1) stored, spatial index (b)); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +create table t1 (a int, b int generated always as (a+1) stored); +alter table t1 add spatial index (b); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +drop table t1; # FOREIGN KEY # Rejected FK options. create table t1 (a int, b int generated always as (a+1) stored, @@ -117,6 +172,185 @@ drop table t1; create table t1 (a int, b int generated always as (a % 10) stored, foreign key (b) references t2(a) on delete no action); drop table t1,t2; +# +# Bug#20553262: WL8149: ASSERTION `DELSUM+(INT) Y/4-TEMP >= 0' FAILED +# +CREATE TABLE c ( +pk integer AUTO_INCREMENT, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) /*! NULL */, +PRIMARY KEY (pk), +KEY (col_time_key), +KEY (col_datetime_key)); +INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values +('14:03:03.042673','2001-11-28 00:50:27.051028', 'c'), +('01:46:09.016386','2007-10-09 19:53:04.008332', NULL), +('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'), +('18:56:33.027423','2003-04-01 00:00:00', 'i'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +Note 1265 Data truncated for column 'col_time_key' at row 2 +Note 1265 Data truncated for column 'col_time_key' at row 3 +Note 1265 Data truncated for column 'col_time_key' at row 4 +EXPLAIN SELECT +outr.col_time_key AS x +FROM c as outr +WHERE +outr.col_varchar_nokey in ('c', 'x', 'i') +AND (outr.col_time_key IS NULL OR +outr.col_datetime_key = '2009-09-27'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE outr ALL col_time_key,col_datetime_key NULL NULL NULL 4 x +SELECT +outr.col_time_key AS x +FROM c AS outr +WHERE +outr.col_varchar_nokey in ('c', 'x', 'i') +AND (outr.col_time_key IS NULL OR +outr.col_datetime_key = '2009-09-27'); +x +DROP TABLE c; +# +# Bug#20913803: WL8149: SIG 11 IN DFIELD_DUP | +# INNOBASE/INCLUDE/DATA0DATA.IC:253 +# +CREATE TABLE A ( +col_varchar_nokey TEXT , +col_varchar_key TEXT GENERATED ALWAYS AS (REPEAT(col_varchar_nokey, 1000)), +KEY (col_varchar_key(50)) +); +INSERT INTO A (col_varchar_nokey) VALUES (''); +CREATE TABLE D ( +pk INTEGER AUTO_INCREMENT, +col_date_nokey BLOB, +col_date_key BLOB GENERATED ALWAYS AS (REPEAT(col_date_nokey,1000)) VIRTUAL, +col_datetime_nokey LONGBLOB, +col_time_nokey LONGTEXT, +col_datetime_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_datetime_nokey, 1000)), +col_time_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_datetime_nokey, 1000)), +col_varchar_nokey TEXT, +col_varchar_key TEXT GENERATED ALWAYS AS (REPEAT(col_varchar_nokey, 1000)), +PRIMARY KEY (pk), +KEY (col_varchar_key(50)), +KEY (col_date_key(20)), +KEY (col_time_key(20)), +KEY (col_datetime_key(20)), +KEY (col_varchar_key(10), col_date_key(10), col_time_key(5), col_datetime_key(5)) +); +INSERT INTO D ( +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES ('', '', '', ''),('', '', '', ''); +DELETE FROM OUTR1.* USING D AS OUTR1 RIGHT JOIN A AS OUTR2 ON +( OUTR1 . `col_varchar_nokey` = OUTR2 . `col_varchar_nokey` ); +DROP TABLE IF EXISTS A,D; +# +# Bug#21024896: SIG 11 INNOBASE_ADD_ONE_VIRTUAL | +# INNOBASE/HANDLER/HANDLER0ALTER.CC +# +CREATE TABLE t1 ( +col1 int(11) DEFAULT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) NOT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS (col2 / col2) VIRTUAL, +col7 int(11) GENERATED ALWAYS AS (col5 + col5) VIRTUAL, +col8 int(11) GENERATED ALWAYS AS (col5 * col5) VIRTUAL, +col9 text, +col6 int(11) DEFAULT NULL, +PRIMARY KEY (`col3`), +UNIQUE KEY uidx (`col2`), +KEY idx (`col5`) +); +INSERT INTO t1(col1,col2,col3,col4,col9,col6) +VALUES(1,1,0,1,REPEAT(col1,1000),0), (3,2,1,1,REPEAT(col1,1000),NULL); +ALTER TABLE t1 ADD COLUMN extra INT; +DROP TABLE t1; +# +# Bug#21316860: WL8149:INNODB: FAILING ASSERTION: +# TEMPL->CLUST_REC_FIELD_NO != ULINT_UNDEFINED +# +CREATE TABLE t1 ( +pk int(11) NOT NULL, +col_int_nokey int(11), +col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, +col_date_nokey date, +col_date_key date GENERATED ALWAYS AS (col_date_nokey) VIRTUAL, +PRIMARY KEY (pk), +UNIQUE KEY col_int_key (col_int_key) +); +ALTER TABLE t1 DROP COLUMN pk; +DROP TABLE t1; +# Remove the impact on PK choose by index on virtual generated column +CREATE TABLE t1 ( +pk int(11) NOT NULL, +col_int_nokey int(11) DEFAULT NULL, +col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, +UNIQUE KEY col_int_key (col_int_key) +); +ALTER TABLE t1 add unique index idx(pk); +DESC t1; +Field Type Null Key Default Extra +pk int(11) NO PRI NULL +col_int_nokey int(11) YES NULL +col_int_key int(11) YES UNI NULL VIRTUAL +DROP TABLE t1; +# +# Bug#21346132: WL8149:INNODB: FAILING ASSERTION: +# PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0 +# +CREATE TABLE t1 ( +col_int_nokey int(11) NOT NULL, +col_int_key int(11) GENERATED ALWAYS AS (col_int_nokey), +col_varchar_nokey varchar(1) NOT NULL, +col_varchar_key varchar(2) GENERATED ALWAYS AS (col_varchar_nokey), +UNIQUE KEY col_int_key (col_int_key), +UNIQUE KEY col_varchar_key (col_varchar_key), +UNIQUE KEY col_int_key_2 (col_int_key,col_varchar_key), +UNIQUE KEY col_varchar_key_2 (col_varchar_key,col_varchar_nokey), +KEY col_int_key_3 (col_int_key,col_int_nokey) +); +ALTER TABLE t1 DROP COLUMN col_varchar_key; +DROP TABLE t1; +# +# Bug#21320151 WL8149: WRONG RESULT WITH INDEX SCAN +# +CREATE TABLE t1 ( +id INTEGER NOT NULL, +b INTEGER GENERATED ALWAYS AS (id+1) VIRTUAL, +UNIQUE KEY (b) +); +INSERT INTO t1 (id) VALUES (2),(3),(4),(5),(6),(7),(8),(9),(10); +EXPLAIN SELECT b FROM t1 FORCE INDEX(b); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 5 NULL 9 Using index +SELECT b FROM t1 FORCE INDEX(b); +b +3 +4 +5 +6 +7 +8 +9 +10 +11 +EXPLAIN SELECT b FROM t1 FORCE INDEX(b) WHERE b BETWEEN 1 AND 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 5 NULL 3 Using where; Using index +SELECT b FROM t1 FORCE INDEX(b) WHERE b BETWEEN 1 AND 5; +b +3 +4 +5 +DROP TABLE t1; # Testing data manipulation operations involving FOREIGN KEY # on generated columns can be found in: @@ -297,6 +531,201 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE table2 system PRIMARY NULL NULL NULL 1 DROP TABLE t1; # +# Bug#21391781 ASSERT WHEN RUNNING ALTER TABLE ON A TABLE WITH INDEX +# ON VIRTUAL COLUMN +# +CREATE TABLE t1 ( +col1 INTEGER NOT NULL, +col2 INTEGER NOT NULL, +gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, +col3 INTEGER NOT NULL, +col4 INTEGER NOT NULL, +col5 INTEGER DEFAULT NULL, +col6 INTEGER DEFAULT NULL, +col7 INTEGER DEFAULT NULL, +col8 INTEGER DEFAULT NULL, +col9 INTEGER DEFAULT NULL, +col10 INTEGER DEFAULT NULL, +col11 INTEGER DEFAULT NULL, +col12 INTEGER DEFAULT NULL, +col13 INTEGER DEFAULT NULL, +col14 INTEGER DEFAULT NULL, +col15 INTEGER DEFAULT NULL, +col16 INTEGER DEFAULT NULL, +col17 INTEGER DEFAULT NULL, +col18 INTEGER DEFAULT NULL, +col19 INTEGER DEFAULT NULL, +col20 INTEGER DEFAULT NULL, +col21 INTEGER DEFAULT NULL, +col22 INTEGER DEFAULT NULL, +col23 INTEGER DEFAULT NULL, +col24 INTEGER DEFAULT NULL, +col25 INTEGER DEFAULT NULL, +col26 INTEGER DEFAULT NULL, +col27 INTEGER DEFAULT NULL, +col28 INTEGER DEFAULT NULL, +col29 INTEGER DEFAULT NULL, +col30 INTEGER DEFAULT NULL, +col31 INTEGER DEFAULT NULL, +col32 INTEGER DEFAULT NULL, +col33 INTEGER DEFAULT NULL, +col34 INTEGER DEFAULT NULL, +col35 INTEGER DEFAULT NULL, +col36 INTEGER DEFAULT NULL, +col37 INTEGER DEFAULT NULL, +col38 INTEGER DEFAULT NULL, +col39 INTEGER DEFAULT NULL, +col40 INTEGER DEFAULT NULL, +col41 INTEGER DEFAULT NULL, +col42 INTEGER DEFAULT NULL, +col43 INTEGER DEFAULT NULL, +col44 INTEGER DEFAULT NULL, +col45 INTEGER DEFAULT NULL, +col46 INTEGER DEFAULT NULL, +col47 INTEGER DEFAULT NULL, +col48 INTEGER DEFAULT NULL, +col49 INTEGER DEFAULT NULL, +col50 INTEGER DEFAULT NULL, +col51 INTEGER DEFAULT NULL, +col52 INTEGER DEFAULT NULL, +col53 INTEGER DEFAULT NULL, +col54 INTEGER DEFAULT NULL, +col55 INTEGER DEFAULT NULL, +col56 INTEGER DEFAULT NULL, +col57 INTEGER DEFAULT NULL, +col58 INTEGER DEFAULT NULL, +col59 INTEGER DEFAULT NULL, +col60 INTEGER DEFAULT NULL, +col61 INTEGER DEFAULT NULL, +col62 INTEGER DEFAULT NULL, +col63 INTEGER DEFAULT NULL, +col64 INTEGER DEFAULT NULL, +col65 INTEGER DEFAULT NULL, +gcol2 INTEGER GENERATED ALWAYS AS (col3 / col4) VIRTUAL, +KEY idx1 (gcol1) +); +INSERT INTO t1 (col1, col2, col3, col4) +VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (5,5,5,5); +ALTER TABLE t1 ADD COLUMN extra INTEGER; +SELECT gcol1 FROM t1 FORCE INDEX(idx1); +gcol1 +2 +4 +6 +8 +10 +DROP TABLE t1; +CREATE TABLE t1 ( +col1 INTEGER NOT NULL, +col2 INTEGER NOT NULL, +gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, +col3 INTEGER NOT NULL, +col4 INTEGER NOT NULL, +col5 INTEGER DEFAULT NULL, +col6 INTEGER DEFAULT NULL, +col7 INTEGER DEFAULT NULL, +col8 INTEGER DEFAULT NULL, +col9 INTEGER DEFAULT NULL, +col10 INTEGER DEFAULT NULL, +col11 INTEGER DEFAULT NULL, +col12 INTEGER DEFAULT NULL, +col13 INTEGER DEFAULT NULL, +col14 INTEGER DEFAULT NULL, +col15 INTEGER DEFAULT NULL, +col16 INTEGER DEFAULT NULL, +col17 INTEGER DEFAULT NULL, +col18 INTEGER DEFAULT NULL, +col19 INTEGER DEFAULT NULL, +col20 INTEGER DEFAULT NULL, +col21 INTEGER DEFAULT NULL, +col22 INTEGER DEFAULT NULL, +col23 INTEGER DEFAULT NULL, +col24 INTEGER DEFAULT NULL, +col25 INTEGER DEFAULT NULL, +col26 INTEGER DEFAULT NULL, +col27 INTEGER DEFAULT NULL, +col28 INTEGER DEFAULT NULL, +col29 INTEGER DEFAULT NULL, +col30 INTEGER DEFAULT NULL, +col31 INTEGER DEFAULT NULL, +col32 INTEGER DEFAULT NULL, +col33 INTEGER DEFAULT NULL, +col34 INTEGER DEFAULT NULL, +col35 INTEGER DEFAULT NULL, +col36 INTEGER DEFAULT NULL, +col37 INTEGER DEFAULT NULL, +col38 INTEGER DEFAULT NULL, +col39 INTEGER DEFAULT NULL, +col40 INTEGER DEFAULT NULL, +col41 INTEGER DEFAULT NULL, +col42 INTEGER DEFAULT NULL, +col43 INTEGER DEFAULT NULL, +col44 INTEGER DEFAULT NULL, +col45 INTEGER DEFAULT NULL, +col46 INTEGER DEFAULT NULL, +col47 INTEGER DEFAULT NULL, +col48 INTEGER DEFAULT NULL, +col49 INTEGER DEFAULT NULL, +col50 INTEGER DEFAULT NULL, +col51 INTEGER DEFAULT NULL, +col52 INTEGER DEFAULT NULL, +col53 INTEGER DEFAULT NULL, +col54 INTEGER DEFAULT NULL, +col55 INTEGER DEFAULT NULL, +col56 INTEGER DEFAULT NULL, +col57 INTEGER DEFAULT NULL, +col58 INTEGER DEFAULT NULL, +col59 INTEGER DEFAULT NULL, +col60 INTEGER DEFAULT NULL, +col61 INTEGER DEFAULT NULL, +col62 INTEGER DEFAULT NULL, +col63 INTEGER DEFAULT NULL, +col64 INTEGER DEFAULT NULL, +col65 INTEGER DEFAULT NULL, +gcol2 INTEGER GENERATED ALWAYS AS (col3 / col4) VIRTUAL, +KEY idx1 (gcol2) +); +INSERT INTO t1 (col1, col2, col3, col4) +VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (5,5,5,5); +ALTER TABLE t1 ADD COLUMN extra INTEGER; +SELECT gcol2 FROM t1 FORCE INDEX(idx1); +gcol2 +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug#21628161 CRASH/MEMORY CORRUPTION ADDING INDEXES TO VIRTUAL COLUMN +# +CREATE TABLE t (a INT, +b BOOLEAN GENERATED ALWAYS AS (a+10000) VIRTUAL, +c BLOB GENERATED ALWAYS AS (b=2) VIRTUAL); +INSERT INTO t(a) VALUES (1); +SELECT * FROM t WHERE c = '0'; +a b c +1 127 0 +ALTER TABLE t ADD UNIQUE INDEX (c(1)); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +SELECT * FROM t WHERE c = '0'; +a b c +1 127 0 +DROP TABLE t; +# +# Bug#21688115 VIRTUAL COLUMN COMPUTATION SAVE_IN_FIELD() +# DID NOT RETURN TRUE WITH DIVIDE 0 +# +CREATE TABLE t (a INT, b INT, h VARCHAR(10)); +INSERT INTO t VALUES (12, 3, "ss"); +INSERT INTO t VALUES (13, 4, "ss"); +INSERT INTO t VALUES (14, 0, "ss"); +ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL; +CREATE INDEX idx ON t(c); +CALL mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual column values failed"); +DROP TABLE t; +# # Bug#21770798 OPTIMIZER DOES NOT USE INDEX FOR GENERATED EXPRESSIONS # WITH LOGICAL OPERATORS # diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result index 5a2af800a91..d5e4bdabb38 100644 --- a/mysql-test/suite/gcol/r/gcol_select_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -431,6 +431,595 @@ AND table3.col_varchar_key != table1.col_varchar_key ORDER BY table1.col_varchar_key , field1 , field2; field1 field2 DROP TABLE A,CC; +# +# Bug#20573302: WL8149: SEGV IN HA_INNOBASE:: +# BUILD_TEMPLATE AT INNOBASE/HANDLER/HA_INNODB.CC:665 +# +CREATE TABLE c ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, +col_date_nokey DATE NOT NULL, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key), +KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_varchar_key, col_date_key, +col_time_key, col_datetime_key)); +INSERT /*! IGNORE */ INTO c ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES +(1, '2009-12-01', '00:21:38.058143', '2007-05-28 00:00:00', 'c'), +(8, '2004-12-17', '04:08:02.046897', '2009-07-25 09:21:20.064099', 'm'), +(9, '2000-03-14', '16:25:11.040240', '2002-01-16 00:00:00', 'd'), +(24, '2000-10-08', '10:14:58.018534', '2006-10-12 04:32:53.031976', 'd'), +(6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), +(1, '2008-01-23', '11:14:24.032949', '2004-10-02 20:31:15.022553', 't'), +(6, '2007-06-18', NULL, '2002-08-20 22:48:00.035785', 'd'), +(2, '2002-10-13', '00:00:00', '1900-01-01 00:00:00', 's'), +(4, '1900-01-01', '15:57:25.019666', '2005-08-15 00:00:00', 'r'), +(8, NULL, '07:05:51.006712', '1900-01-01 00:00:00', 'm'), +(4, '2006-03-09', '19:22:21.057406', '2008-05-16 08:09:06.002924', 'b'), +(4, '2001-06-05', '03:53:16.001370', '2001-01-20 12:47:23.022022', 'x'), +(7, '2006-05-28', '09:16:38.034570', '2008-07-02 00:00:00', 'g'), +(4, '2001-04-19', '15:37:26.028315', '1900-01-01 00:00:00', 'p'), +(1, '1900-01-01', '00:00:00', '2002-12-08 11:34:58.001571', 'q'), +(9, '2004-08-20', '05:03:03.047452', '1900-01-01 00:00:00', 'w'), +(4, '2004-10-10', '02:59:24.063764', '1900-01-01 00:00:00', 'd'), +(8, '2000-04-02', '00:01:58.064243', '2002-08-25 20:35:06.064634', 'e'), +(4, '2006-11-02', '00:00:00', '2001-10-22 11:13:24.048128', 'b'), +(8, '2009-01-28', '02:20:16.024931', '2003-03-12 02:00:34.029335', 'y'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +Note 1265 Data truncated for column 'col_time_key' at row 2 +Note 1265 Data truncated for column 'col_time_key' at row 3 +Note 1265 Data truncated for column 'col_time_key' at row 4 +Note 1265 Data truncated for column 'col_time_key' at row 5 +Note 1265 Data truncated for column 'col_time_key' at row 6 +Warning 1048 Column 'col_time_nokey' cannot be null +Note 1265 Data truncated for column 'col_time_key' at row 7 +Note 1265 Data truncated for column 'col_time_key' at row 8 +Note 1265 Data truncated for column 'col_time_key' at row 9 +Warning 1048 Column 'col_date_nokey' cannot be null +Warning 1292 Incorrect datetime value: '0000-00-00' +Note 1265 Data truncated for column 'col_time_key' at row 10 +Note 1265 Data truncated for column 'col_time_key' at row 11 +Note 1265 Data truncated for column 'col_time_key' at row 12 +Note 1265 Data truncated for column 'col_time_key' at row 13 +Note 1265 Data truncated for column 'col_time_key' at row 14 +Note 1265 Data truncated for column 'col_time_key' at row 15 +Note 1265 Data truncated for column 'col_time_key' at row 16 +Note 1265 Data truncated for column 'col_time_key' at row 17 +Note 1265 Data truncated for column 'col_time_key' at row 18 +Note 1265 Data truncated for column 'col_time_key' at row 19 +Note 1265 Data truncated for column 'col_time_key' at row 20 +CREATE TABLE cc ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey) VIRTUAL, +col_date_nokey DATE NOT NULL, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key), +KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_varchar_key, col_date_key, +col_time_key, col_datetime_key)); +INSERT /*! IGNORE */ INTO cc ( +col_int_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey +) VALUES +(0, '2003-02-06', '22:02:09.059926', '2003-08-07 14:43:09.011144', 'x'), +(0, '2005-04-16', '19:33:15.014160', '2005-12-11 00:00:00', 'n'), +(1, '2005-07-23', '22:03:16.058787', '2005-12-26 20:48:07.043628', 'w'), +(7, '2001-11-15', '06:31:23.027263', '2008-06-12 06:41:21.012493', 's'), +(0, '2006-03-24', '02:19:08.013275', '2007-10-11 18:46:28.030000', 'a'), +(4, '2008-07-10', NULL, '2006-04-04 22:22:40.057947', 'd'), +(1, '2009-12-07', NULL, '2002-08-10 20:52:58.035137', 'w'), +(1, '2008-05-01', '10:28:01.038587', '2008-10-03 11:17:23.005299', 'j'), +(1, '2008-06-22', '00:00:00', '2009-01-06 20:11:01.034339', 'm'), +(4, '2001-11-11', '15:02:50.048785', '2009-09-19 00:00:00', 'k'), +(7, '2000-12-21', '05:29:13.012729', '2007-09-02 12:14:27.029187', 't'), +(4, '2007-09-03', '23:45:33.048507', '2003-09-26 00:00:00', 'k'), +(2, '2003-02-18', '19:10:53.057455', '2001-11-18 18:10:16.063189', 'e'), +(0, '2008-12-01', '01:45:27.037313', '2005-02-15 04:08:17.015554', 'i'), +(1, '2008-10-18', '03:56:03.060218', '2009-06-13 23:04:40.013006', 't'), +(91, '2004-08-28', '12:43:17.023797', '1900-01-01 00:00:00', 'm'), +(6, '2006-10-05', '13:33:46.053634', '2005-03-20 02:48:24.045653', 'z'), +(3, '2003-05-16', NULL, '2002-03-16 11:47:27.045297', 'c'), +(6, '2008-10-10', NULL, '2000-05-22 00:00:00', 'i'), +(8, '2002-01-19', '05:18:40.006865', '2009-02-12 00:00:00', 'v'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +Note 1265 Data truncated for column 'col_time_key' at row 2 +Note 1265 Data truncated for column 'col_time_key' at row 3 +Note 1265 Data truncated for column 'col_time_key' at row 4 +Note 1265 Data truncated for column 'col_time_key' at row 5 +Warning 1048 Column 'col_time_nokey' cannot be null +Note 1265 Data truncated for column 'col_time_key' at row 6 +Warning 1048 Column 'col_time_nokey' cannot be null +Note 1265 Data truncated for column 'col_time_key' at row 7 +Note 1265 Data truncated for column 'col_time_key' at row 8 +Note 1265 Data truncated for column 'col_time_key' at row 9 +Note 1265 Data truncated for column 'col_time_key' at row 10 +Note 1265 Data truncated for column 'col_time_key' at row 11 +Note 1265 Data truncated for column 'col_time_key' at row 12 +Note 1265 Data truncated for column 'col_time_key' at row 13 +Note 1265 Data truncated for column 'col_time_key' at row 14 +Note 1265 Data truncated for column 'col_time_key' at row 15 +Note 1265 Data truncated for column 'col_time_key' at row 16 +Note 1265 Data truncated for column 'col_time_key' at row 17 +Warning 1048 Column 'col_time_nokey' cannot be null +Note 1265 Data truncated for column 'col_time_key' at row 18 +Warning 1048 Column 'col_time_nokey' cannot be null +Note 1265 Data truncated for column 'col_time_key' at row 19 +Note 1265 Data truncated for column 'col_time_key' at row 20 +EXPLAIN +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN +(c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON +(subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON +(subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE subquery2_t2 index NULL col_int_key_2 10 NULL 20 # +1 SIMPLE subquery2_t3 ALL NULL NULL NULL NULL 20 # +1 SIMPLE subquery2_t1 index NULL PRIMARY 4 NULL 20 # +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN +(c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON +(subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON +(subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; +subquery2_field1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +6 +6 +6 +6 +7 +7 +8 +8 +8 +8 +9 +9 +24 +SELECT subquery2_t2.col_int_key AS subquery2_field1 +FROM (c AS subquery2_t1 RIGHT JOIN +(c AS subquery2_t2 LEFT JOIN cc AS subquery2_t3 ON +(subquery2_t3.col_int_nokey = subquery2_t2.col_int_key )) ON +(subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key)) +ORDER BY subquery2_field1; +subquery2_field1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +6 +6 +6 +6 +7 +7 +8 +8 +8 +8 +9 +9 +24 +DROP TABLE c,cc; +# +# Bug#2081065: WL8149:RESULT DIFF SEEN FOR SIMPLE +# RANGE QUERIES WITH ORDER BY +# +CREATE TABLE cc ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL, +PRIMARY KEY (pk), +KEY (col_int_key) +); +INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5); +EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE cc ALL col_int_key NULL NULL NULL 6 # +SELECT pk FROM cc WHERE col_int_key > 3; +pk +3 +5 +6 +EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE cc ALL col_int_key NULL NULL NULL 6 # +SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +pk +3 +5 +6 +DROP TABLE cc; +# +# Bug#20849676 :WL8149:ASSERTION `!TABLE || (!TABLE->READ_SET +# || BITMAP_IS_SET(TABLE->READ_SET +# +CREATE TABLE c ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_varchar_key), +KEY (col_int_key, col_varchar_key) +) ; +INSERT INTO c (col_int_nokey, col_varchar_nokey) VALUES +(1, 'c'),(8, 'm'),(9, 'd'),(24, 'd'),(6, 'y'),(1, 't'),(6, 'd'), +(2, 'r'),(8, 'm'),(4, 'b'),(4, 'x'),(7, 'g'),(4, 'p'),(1, 'q'), +(9, 'w'),(4, 'd'),(8, 'e'),(4, 'b'),(8, 'y'); +CREATE TABLE a ( +pk INTEGER AUTO_INCREMENT, +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, +col_datetime_key DATETIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS +(ADDTIME(col_datetime_nokey, col_time_nokey)), +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +PRIMARY KEY (pk), +KEY (col_varchar_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_varchar_key, col_time_key, col_datetime_key) +); +INSERT INTO a ( +col_time_nokey, +col_datetime_nokey, +col_varchar_nokey) VALUES +('04:08:02.046897', '2001-11-04 19:07:55.051133', 'k'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +ANALYZE TABLE a, c; +Table Op Msg_type Msg_text +test.a analyze status OK +test.c analyze status OK +EXPLAIN +SELECT +table1.pk AS field1 , +table1.col_datetime_key AS field2 +FROM +( a AS table1 LEFT JOIN ( ( c AS table2 STRAIGHT_JOIN ( SELECT +SUBQUERY1_t1.* FROM ( c AS SUBQUERY1_t1 INNER JOIN ( c AS SUBQUERY1_t2 +STRAIGHT_JOIN c AS SUBQUERY1_t3 ON (SUBQUERY1_t3.col_varchar_key = +SUBQUERY1_t2.col_varchar_key ) ) +ON (SUBQUERY1_t3.pk = SUBQUERY1_t2.col_int_key +OR SUBQUERY1_t1.col_int_key <> 1 ) ) +WHERE SUBQUERY1_t2.pk >= 9 ) AS table3 +ON (table3.col_int_key = table2.col_int_key ) ) ) +ON (table3.col_int_nokey = table2.pk ) ) +GROUP BY field1, field2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY table1 system NULL NULL NULL NULL 1 # +1 PRIMARY table2 ALL PRIMARY,col_int_key,col_int_key_2 NULL NULL NULL 19 # +1 PRIMARY ref key0 key0 9 test.table2.pk,test.table2.col_int_key 10 # +2 DERIVED SUBQUERY1_t2 ALL PRIMARY,col_int_key,col_varchar_key,col_int_key_2 NULL NULL NULL 19 # +2 DERIVED SUBQUERY1_t3 ref PRIMARY,col_varchar_key col_varchar_key 5 test.SUBQUERY1_t2.col_varchar_key 1 # +2 DERIVED SUBQUERY1_t1 ALL col_int_key,col_int_key_2 NULL NULL NULL 19 # +SELECT +table1.pk AS field1 , +table1.col_datetime_key AS field2 +FROM +( a AS table1 LEFT JOIN ( ( c AS table2 STRAIGHT_JOIN ( SELECT +SUBQUERY1_t1.* FROM ( c AS SUBQUERY1_t1 INNER JOIN ( c AS SUBQUERY1_t2 +STRAIGHT_JOIN c AS SUBQUERY1_t3 ON (SUBQUERY1_t3.col_varchar_key = +SUBQUERY1_t2.col_varchar_key ) ) +ON (SUBQUERY1_t3.pk = SUBQUERY1_t2.col_int_key +OR SUBQUERY1_t1.col_int_key <> 1 ) ) +WHERE SUBQUERY1_t2.pk >= 9 ) AS table3 +ON (table3.col_int_key = table2.col_int_key ) ) ) +ON (table3.col_int_nokey = table2.pk ) ) +GROUP BY field1, field2; +field1 field2 +1 2001-11-04 23:15:57 +DROP TABLE IF EXISTS c,a; +CREATE TABLE c ( +col_int_nokey INTEGER NOT NULL, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL, +col_varchar_nokey VARCHAR(1) NOT NULL, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +KEY (col_int_key), +KEY (col_int_key, col_varchar_key) +) ; +INSERT INTO c ( +col_int_nokey, +col_varchar_nokey +) VALUES (1, 'c'),(8, 'm'),(9, 'd'),(24, 'd'),(6, 'y'),(1, 't'), +(6, 'd'),(2, 's'),(4, 'r'),(8, 'm'),(4, 'b'),(4, 'x'),(7, 'g'),(4, 'p'), +(1, 'q'),(9, 'w'),(4, 'd'),(8, 'e'),(4, 'b'),(8, 'y'); +CREATE TABLE cc ( +col_int_nokey INTEGER, +col_int_key INTEGER GENERATED ALWAYS AS +(col_int_nokey + col_int_nokey) VIRTUAL, +col_varchar_nokey VARCHAR(1), +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS +(CONCAT(col_varchar_nokey, col_varchar_nokey)), +KEY (col_int_key), +KEY (col_varchar_key), +KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY (col_varchar_key, col_varchar_nokey) +); +INSERT INTO cc ( +col_int_nokey, +col_varchar_nokey +) VALUES (8, 'p'),(9, 'g'),(9, 'i'),(4, 'p'),(7, 'h'),(1, 'e'),(8, 'e'),(6, 'u'), +(6, 'j'),(6, 'e'),(1, 'z'),(227, 'w'),(NULL, 't'),(9, 'i'),(1, 'i'),(8, 'i'), +(5, 'b'),(8,'m'),(7, 'j'),(2, 'v'); +ANALYZE TABLE c, cc; +Table Op Msg_type Msg_text +test.c analyze status OK +test.cc analyze status OK +EXPLAIN SELECT +alias2 . col_varchar_key AS field1 +FROM ( cc AS alias1 , cc AS alias2 ) +WHERE +( alias2 . col_int_key , alias1 . col_int_nokey ) +NOT IN +( +SELECT +DISTINCT SQ1_alias2 . col_int_nokey AS SQ1_field1 , +SQ1_alias1 . col_int_key AS SQ1_field2 +FROM ( cc AS SQ1_alias1 , c AS SQ1_alias2 ) +GROUP BY SQ1_field1 , SQ1_field2 +) +GROUP BY field1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 index NULL col_int_key_3 10 NULL 20 # +1 PRIMARY alias2 index NULL col_int_key_2 10 NULL 20 # +2 MATERIALIZED SQ1_alias1 index col_int_key,col_int_key_2,col_int_key_3 col_int_key 5 NULL 20 # +2 MATERIALIZED SQ1_alias2 ALL NULL NULL NULL NULL 20 # +SELECT +alias2 . col_varchar_key AS field1 +FROM ( cc AS alias1 , cc AS alias2 ) +WHERE +( alias2 . col_int_key , alias1 . col_int_nokey ) +NOT IN +( +SELECT +DISTINCT SQ1_alias2 . col_int_nokey AS SQ1_field1 , +SQ1_alias1 . col_int_key AS SQ1_field2 +FROM ( cc AS SQ1_alias1 , c AS SQ1_alias2 ) +GROUP BY SQ1_field1 , SQ1_field2 +) +GROUP BY field1; +field1 +bb +ee +gg +hh +ii +jj +mm +pp +uu +ww +DROP TABLE IF EXISTS c,cc; +SET @save_old_sql_mode= @@sql_mode; +SET sql_mode=""; +CREATE TABLE d ( +col_int int(11) DEFAULT NULL, +col_varchar_10_utf8 varchar(10) CHARACTER SET utf8 DEFAULT NULL, +pk int(11) NOT NULL AUTO_INCREMENT, +col_int_key int(11) GENERATED ALWAYS AS (col_int+col_int) VIRTUAL, +col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT(SUBSTRING(col_varchar_10_utf8, -1), 5)) VIRTUAL, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key), +KEY col_varchar_10_utf8_key (col_varchar_10_utf8_key), +KEY cover_key1 (col_int_key, col_varchar_10_utf8_key) +); +INSERT INTO d (col_int, col_varchar_10_utf8) VALUES ('qhlhtrovam',1),('how',2),('htrovamzqr',3),('rovamzqrdc',4),('well',5),('g',6),('rdcenchyhu',7),('want',8); +SELECT table1.pk AS field1 FROM d AS table1 LEFT JOIN d AS table2 ON table1.col_varchar_10_utf8_key = table2.col_varchar_10_utf8_key WHERE table1.col_int_key IS NULL GROUP BY table1.pk ; +field1 +DROP TABLE d; +# +# Bug#21153237: WL8149: QUERIES USING FILESORT +# ON VIRTUAL GC HAVING INDEX GIVES WRONG RESULTS +# +CREATE TABLE j ( +col_int int(11), +pk int(11) NOT NULL, +col_varchar_10_utf8 varchar(10) CHARACTER SET utf8 DEFAULT NULL, +col_varchar_255_utf8_key varchar(255) CHARACTER SET utf8 GENERATED ALWAYS AS +(col_varchar_10_utf8) VIRTUAL, +PRIMARY KEY (pk), +KEY cover_key1 (col_int, col_varchar_255_utf8_key)); +INSERT INTO j(col_int, pk, col_varchar_10_utf8) VALUES(9, 1, '951910400'), +(-1934295040, 2, '1235025920'),(-584581120, 3, '-1176633344'),(3, 4, '1074462720'); +EXPLAIN SELECT col_varchar_255_utf8_key FROM j ORDER BY 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE j index NULL cover_key1 773 NULL 4 # +SELECT col_varchar_255_utf8_key FROM j ORDER BY col_varchar_255_utf8_key; +col_varchar_255_utf8_key +-117663334 +1074462720 +1235025920 +951910400 +DROP TABLE j; +set sql_mode= @save_old_sql_mode; CREATE TABLE cc ( pk int(11) NOT NULL AUTO_INCREMENT, col_int_nokey int(11) NOT NULL, @@ -497,6 +1086,35 @@ a b 1 2 2 3 DROP TABLE t; +# +# Testing a few index-based accesses on the virtual column +# +CREATE TABLE t1 ( +id int(11) NOT NULL, +b int(11) GENERATED ALWAYS AS (id+1) VIRTUAL, +UNIQUE KEY (b) ); +INSERT INTO t1 (id) VALUES(NULL); +ERROR 23000: Column 'id' cannot be null +INSERT INTO t1 (id) VALUES(2),(3); +EXPLAIN SELECT * FROM t1 FORCE INDEX(b) WHERE b=3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const b b 5 const 1 +EXPLAIN SELECT * FROM t1 AS t2 STRAIGHT_JOIN t1 FORCE INDEX(b) WHERE t1.b=t2.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL b NULL NULL NULL 2 Using where +1 SIMPLE t1 ref b b 5 test.t2.b 2 +EXPLAIN SELECT b FROM t1 FORCE INDEX(b); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 5 NULL 2 Using index +INSERT INTO t1 (id) VALUES(4),(5),(6),(7),(8),(9),(10); +EXPLAIN SELECT b FROM t1 FORCE INDEX(b) WHERE b BETWEEN 1 AND 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 5 NULL 3 Using where; Using index +EXPLAIN SELECT * FROM t2 AS t1 WHERE b NOT IN (SELECT b FROM t1 FORCE INDEX(b)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY t1 index_subquery b b 5 func 2 Using index; Full scan on NULL key +DROP TABLE t1; DROP TABLE t2, t3; # # Bug#21317507:GC: STORED COLUMN REJECTED, BUT VIRTUAL IS ACCEPTED @@ -615,10 +1233,11 @@ pk i1 i2 v1 v2 843 43 43 44 1 942 42 42 43 1 943 43 43 44 1 +ALTER TABLE t1 ADD INDEX idx2(v1); EXPLAIN SELECT * FROM t1 WHERE v1 > 41 AND v1 <= 43; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +1 SIMPLE t1 range idx2 idx2 5 NULL # Using index condition SELECT * FROM t1 WHERE v1 > 41 AND v1 <= 43; pk i1 i2 v1 v2 @@ -670,6 +1289,9 @@ i1 INTEGER, i2_key INTEGER GENERATED ALWAYS AS (i1 + i1) VIRTUAL, PRIMARY KEY (pk) ); +# Add a covering index. The reason for this index being covering is that +# secondary indexes in InnoDB include the primary key. +ALTER TABLE t3 ADD INDEX v_idx (i2_key); INSERT INTO t3 (pk, i1) VALUES (1, 1), (2, 48), (3, 228), (4, 3), (5, 5), (6, 39), (7, 6), (8, 8), (9, 3); @@ -698,7 +1320,7 @@ AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL distinct_key NULL NULL NULL 3 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 @@ -740,6 +1362,7 @@ t 9 # # Test 2: Two alternative covering indexes for the range scan # +ALTER TABLE t3 ADD INDEX v_idx2 (i2_key, i1); EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 WHERE ( t3.pk IN @@ -753,7 +1376,7 @@ AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL distinct_key NULL NULL NULL 3 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t3 eq_ref PRIMARY,v_idx,v_idx2 PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 @@ -796,6 +1419,8 @@ t 9 # Test 3: One covering index including the base column for the virtual # column # +# Drop the index with only the virtual column +ALTER TABLE t3 DROP INDEX v_idx; EXPLAIN SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 WHERE ( t3.pk IN @@ -809,7 +1434,7 @@ AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL distinct_key NULL NULL NULL 3 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t3 eq_ref PRIMARY,v_idx2 PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 @@ -851,6 +1476,9 @@ t 9 # # Test 4: One non-covering index # +# Drop the index on two columns, add index on just one virtual column +ALTER TABLE t3 DROP INDEX v_idx2; +ALTER TABLE t3 ADD INDEX v_idx (i2_key); # Add more data to the table so that it will run the dynamic range scan # as both table scan and range scan (the purpose of this is to make the # table scan more expensive). @@ -873,7 +1501,7 @@ AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL distinct_key NULL NULL NULL 3 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1 @@ -929,7 +1557,7 @@ AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where +1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join) SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2 diff --git a/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test b/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test index 4f91b0021bc..6f04ecf3865 100644 --- a/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test +++ b/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test @@ -35,8 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $support_virtual_index= 0; -let $support_virtual_foreign= 0; +let $support_virtual_index= 1; --source suite/gcol/inc/gcol_column_def_options.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test b/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test index 168321caab9..d54a6ae6f02 100644 --- a/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test +++ b/mysql-test/suite/gcol/t/gcol_ins_upd_myisam.test @@ -35,7 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $support_virtual_index= 0; +let $support_virtual_index= 1; --source suite/gcol/inc/gcol_ins_upd.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/gcol/t/gcol_keys_myisam.test b/mysql-test/suite/gcol/t/gcol_keys_myisam.test index bbe27b90c7e..9cd89107126 100644 --- a/mysql-test/suite/gcol/t/gcol_keys_myisam.test +++ b/mysql-test/suite/gcol/t/gcol_keys_myisam.test @@ -35,7 +35,8 @@ eval SET @@session.default_storage_engine = 'MyISAM'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $support_virtual_index= 0; +let $support_virtual_index= 1; +let $skip_foreign_key_check=1; --source suite/gcol/inc/gcol_keys.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/gcol/t/gcol_select_myisam.test b/mysql-test/suite/gcol/t/gcol_select_myisam.test index bb2b46a4fa3..e078efbad0c 100644 --- a/mysql-test/suite/gcol/t/gcol_select_myisam.test +++ b/mysql-test/suite/gcol/t/gcol_select_myisam.test @@ -40,7 +40,7 @@ eval SET optimizer_switch='derived_merge=off'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $support_virtual_index= 0; +let $support_virtual_index= 1; --source suite/gcol/inc/gcol_select.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/vcol/inc/vcol_keys.inc b/mysql-test/suite/vcol/inc/vcol_keys.inc index 6d859a4b0c3..95fd8a6488d 100644 --- a/mysql-test/suite/vcol/inc/vcol_keys.inc +++ b/mysql-test/suite/vcol/inc/vcol_keys.inc @@ -23,22 +23,21 @@ --echo # - CHECK (allowed but not used) --echo # UNIQUE ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN create table t1 (a int, b int as (a*2) unique); +drop table t1; create table t1 (a int, b int as (a*2) persistent unique); show create table t1; describe t1; drop table t1; ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN create table t1 (a int, b int as (a*2), unique key (b)); +drop table t1; create table t1 (a int, b int as (a*2) persistent, unique (b)); show create table t1; describe t1; drop table t1; create table t1 (a int, b int as (a*2)); ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN alter table t1 add unique key (b); drop table t1; create table t1 (a int, b int as (a*2) persistent); @@ -52,10 +51,10 @@ drop table t1; --echo # --echo # INDEX ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN create table t1 (a int, b int as (a*2), index (b)); ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +drop table t1; create table t1 (a int, b int as (a*2), index (a,b)); +drop table t1; create table t1 (a int, b int as (a*2) persistent, index (b)); show create table t1; @@ -68,9 +67,7 @@ describe t1; drop table t1; create table t1 (a int, b int as (a*2)); ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN alter table t1 add index (b); ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN alter table t1 add index (a,b); drop table t1; @@ -125,14 +122,16 @@ alter table t1 add foreign key (b) references t2(a) on update cascade; alter table t1 add foreign key (b) references t2(a) on delete set null; drop table t1; ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN -create table t1 (a int, b int as (a+1), - foreign key (b) references t2(a)); +if ($with_foreign_keys) { +--error ER_CANT_CREATE_TABLE +create table t1 (a int, b int as (a+1), foreign key (b) references t2(a)); create table t1 (a int, b int as (a+1)); ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +--replace_regex /`#sql-.*`/`#sql-temporary`/ +--error ER_CANT_CREATE_TABLE alter table t1 add foreign key (b) references t2(a); drop table t1; +} --echo # Allowed FK options. create table t2 (a int primary key, b char(5)); diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index dccdf7f73e5..a62fc2ffda0 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -1,3 +1,119 @@ +create table t1 (a int, b int as (a+1), c int, index(b)); +insert t1 (a,c) values (0x7890abcd, 0x76543210); +insert t1 (a,c) select seq, sin(seq)*10000 from seq_1_to_1000; +explain select * from t1 where b=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref b b 5 const 1 +select * from t1 where b=10; +a b c +9 10 4121 + +MyISAM file: datadir/test/t1 +Record format: Fixed length +Character set: latin1_swedish_ci (8) +Data records: 1001 Deleted blocks: 0 +Recordlength: 9 + +table description: +Key Start Len Index Type +1 10 4 multip. long NULL +update t1 set a=20 where b=10; +select * from t1 where b=10; +a b c +select * from t1 where b=21; +a b c +20 21 4121 +20 21 9129 +delete from t1 where b=21; +select * from t1 where b=21; +a b c +alter table t1 add column d char(20) as (concat(a,c)); +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +create index i on t1 (d); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +check table t1 quick; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +check table t1 medium; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +check table t1 extended; +Table Op Msg_type Msg_text +test.t1 check status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 b 1 b A 999 NULL NULL YES BTREE +t1 1 i 1 d A 999 NULL NULL YES BTREE +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +delete from t1 where b=12; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 b 1 b A 998 NULL NULL YES BTREE +t1 1 i 1 d A 998 NULL NULL YES BTREE +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 b 1 b A 998 NULL NULL YES BTREE +t1 1 i 1 d A 998 NULL NULL YES BTREE +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +repair table t1 quick; +Table Op Msg_type Msg_text +test.t1 repair status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +repair table t1 extended; +Table Op Msg_type Msg_text +test.t1 repair status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 998 +test.t1 repair status OK +select * from t1 where b=11; +a b c d +10 11 -5440 10-5440 +update t1 set a=30 where b=11; +select * from t1 where b=11; +a b c d +select * from t1 where b=31; +a b c d +30 31 -5440 30-5440 +30 31 -9880 30-9880 +drop table t1; SET @@session.storage_engine = 'MyISAM'; # - UNIQUE KEY # - INDEX @@ -7,7 +123,7 @@ SET @@session.storage_engine = 'MyISAM'; # - CHECK (allowed but not used) # UNIQUE create table t1 (a int, b int as (a*2) unique); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent unique); show create table t1; Table Create Table @@ -22,7 +138,7 @@ a int(11) YES NULL b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent, unique (b)); show create table t1; Table Create Table @@ -38,7 +154,6 @@ b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1; create table t1 (a int, b int as (a*2) persistent); alter table t1 add unique key (b); @@ -50,9 +165,9 @@ drop table t1; # # INDEX create table t1 (a int, b int as (a*2), index (b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2), index (a,b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent, index (b)); show create table t1; Table Create Table @@ -81,9 +196,7 @@ b int(11) YES NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column alter table t1 add index (a,b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1; create table t1 (a int, b int as (a*2) persistent); alter table t1 add index (b); @@ -125,13 +238,6 @@ ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a comput alter table t1 add foreign key (b) references t2(a) on delete set null; ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column drop table t1; -create table t1 (a int, b int as (a+1), -foreign key (b) references t2(a)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column -create table t1 (a int, b int as (a+1)); -alter table t1 add foreign key (b) references t2(a); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column -drop table t1; # Allowed FK options. create table t2 (a int primary key, b char(5)); create table t1 (a int, b int as (a % 10) persistent, diff --git a/mysql-test/suite/vcol/t/vcol_keys_myisam.test b/mysql-test/suite/vcol/t/vcol_keys_myisam.test index 26f4a2c5ae1..68fd7e1731b 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_keys_myisam.test @@ -1,3 +1,57 @@ + +--source include/have_sequence.inc +--let $datadir= `select @@datadir` + +create table t1 (a int, b int as (a+1), c int, index(b)); +insert t1 (a,c) values (0x7890abcd, 0x76543210); +insert t1 (a,c) select seq, sin(seq)*10000 from seq_1_to_1000; +explain select * from t1 where b=10; +select * from t1 where b=10; +--replace_result $datadir datadir +--exec $MYISAMCHK -d $datadir/test/t1 +update t1 set a=20 where b=10; +select * from t1 where b=10; +select * from t1 where b=21; +delete from t1 where b=21; +select * from t1 where b=21; +alter table t1 add column d char(20) as (concat(a,c)); +select * from t1 where b=11; +create index i on t1 (d); +check table t1; +select * from t1 where b=11; +check table t1 quick; +select * from t1 where b=11; +check table t1 medium; +select * from t1 where b=11; +check table t1 extended; +show keys from t1; +select * from t1 where b=11; +delete from t1 where b=12; +analyze table t1; +show keys from t1; +select * from t1 where b=11; +optimize table t1; +show keys from t1; +select * from t1 where b=11; +repair table t1; +select * from t1 where b=11; +repair table t1 quick; +select * from t1 where b=11; +repair table t1 extended; +select * from t1 where b=11; +repair table t1 use_frm; +select * from t1 where b=11; +update t1 set a=30 where b=11; +select * from t1 where b=11; +select * from t1 where b=31; + +--error 1 +--exec $MYISAMCHK $datadir/test/t1 +--error 1 +--exec $MYISAMCHK -r $datadir/test/t1 + +drop table t1; + ################################################################################ # t/vcol_keys_myisam.test # # # diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index 0eaf1a88aa1..a0c1a23d63c 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -168,7 +168,7 @@ static inline uint get_first_set(my_bitmap_map value, uint word_pos) my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe __attribute__((unused))) + my_bool thread_safe) { DBUG_ENTER("my_bitmap_init"); if (!buf) diff --git a/sql/field.h b/sql/field.h index 8644037d13a..2cdbd50e278 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1175,6 +1175,11 @@ public: ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg; } inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; } + inline uchar *record_ptr() // record[0] or wherever the field was moved to + { + my_ptrdiff_t offset= table->s->field[field_index]->ptr - table->s->default_values; + return ptr - offset; + } virtual void move_field_offset(my_ptrdiff_t ptr_diff) { ptr=ADD_TO_PTR(ptr,ptr_diff, uchar*); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ccd9288cfb7..7b18322662a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3916,12 +3916,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } #endif - if (!sql_field->stored_in_db()) - { - /* Key fields must always be physically stored. */ - my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0)); - DBUG_RETURN(TRUE); - } if (key->type == Key::PRIMARY && sql_field->vcol_info) { my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0)); @@ -6226,9 +6220,11 @@ static int compare_uint(const uint *s, const uint *t) Check if the column is computed and either is stored or is used in the partitioning expression. */ -static bool vcol_affecting_storage(const Virtual_column_info* vcol) +static bool vcol_affecting_storage(const Virtual_column_info* vcol, + bool indexed) { - return vcol && (vcol->is_stored() || vcol->is_in_partitioning_expr()); + return vcol && + (vcol->is_stored() || vcol->is_in_partitioning_expr() || indexed); } /** @@ -6437,15 +6433,28 @@ static bool fill_alter_inplace_info(THD *thd, ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; } - if (vcol_affecting_storage(field->vcol_info) || - vcol_affecting_storage(new_field->vcol_info)) + if (vcol_affecting_storage(field->vcol_info, + field->flags & PART_KEY_FLAG) || + vcol_affecting_storage(new_field->vcol_info, false)) { if (is_equal == IS_EQUAL_NO || !field->vcol_info || !new_field->vcol_info || !field->vcol_info->is_equal(new_field->vcol_info)) ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; else - maybe_alter_vcol= true; + { + if (!(ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_VCOL) && + (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_DEFAULT)) + { /* + a DEFAULT value of a some column was changed. + see if this vcol uses DEFAULT() function + */ + if (field->vcol_info->expr_item->walk( + &Item::check_func_default_processor, 0, 0)) + ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; + } + } + maybe_alter_vcol= true; } /* Check if field was renamed */ @@ -6514,10 +6523,10 @@ static bool fill_alter_inplace_info(THD *thd, if (maybe_alter_vcol) { /* - No virtual column was altered, but perhaps one of the other columns was, - and that column was part of the vcol expression? - We don't detect this correctly (FIXME), so let's just say that a vcol - *might* be affected if any other column was altered. + What if one of the normal columns was altered and it was part of the some + virtual column expression? Currently we don't detect this correctly + (FIXME), so let's just say that a vcol *might* be affected if any other + column was altered. */ if (ha_alter_info->handler_flags & ( Alter_inplace_info::ALTER_COLUMN_TYPE diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1ae90a31ebf..da0e6cd2116 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -254,7 +254,7 @@ int mysql_update(THD *thd, ha_rows *found_return, ha_rows *updated_return) { bool using_limit= limit != HA_POS_ERROR; - bool safe_update= MY_TEST(thd->variables.option_bits & OPTION_SAFE_UPDATES); + bool safe_update= thd->variables.option_bits & OPTION_SAFE_UPDATES; bool used_key_is_modified= FALSE, transactional_table, will_batch; bool can_compare_record; int res; @@ -2383,6 +2383,9 @@ int multi_update::do_updates() field_num++; } while ((tbl= check_opt_it++)); + if (table->vfield && table->update_virtual_fields(VCOL_UPDATE_INDEXED)) + goto err2; + table->status|= STATUS_UPDATED; store_record(table,record[1]); diff --git a/sql/table.cc b/sql/table.cc index 7c47aff078e..2c972446da3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6211,7 +6211,11 @@ void TABLE::mark_columns_needed_for_delete() for (reg_field= field ; *reg_field ; reg_field++) { if ((*reg_field)->flags & PART_KEY_FLAG) + { bitmap_set_bit(read_set, (*reg_field)->field_index); + if ((*reg_field)->vcol_info) + mark_virtual_col(*reg_field); + } } need_signal= true; } @@ -6544,7 +6548,8 @@ bool TABLE::mark_virtual_columns_for_write(bool insert_fl) tmp_vfield= *vfield_ptr; if (bitmap_is_set(write_set, tmp_vfield->field_index)) bitmap_updated= mark_virtual_col(tmp_vfield); - else if (tmp_vfield->vcol_info->stored_in_db) + else if (tmp_vfield->vcol_info->stored_in_db || + (tmp_vfield->flags & PART_KEY_FLAG)) { if (insert_fl) { @@ -7311,11 +7316,16 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) } case VCOL_UPDATE_FOR_READ: update= !vcol_info->stored_in_db + && !(key_read && vf->part_of_key.is_set(file->active_index)) && bitmap_is_set(vcol_set, vf->field_index); break; case VCOL_UPDATE_FOR_WRITE: update= triggers || bitmap_is_set(vcol_set, vf->field_index); break; + case VCOL_UPDATE_INDEXED: + update= !vcol_info->stored_in_db && (vf->flags & PART_KEY_FLAG) + && bitmap_is_set(vcol_set, vf->field_index); + break; } if (update) diff --git a/sql/table.h b/sql/table.h index 34da450fe44..27439670a22 100644 --- a/sql/table.h +++ b/sql/table.h @@ -327,7 +327,8 @@ enum enum_vcol_update_mode { VCOL_UPDATE_FOR_READ= 0, VCOL_UPDATE_FOR_READ_WRITE, - VCOL_UPDATE_FOR_WRITE + VCOL_UPDATE_FOR_WRITE, + VCOL_UPDATE_INDEXED }; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index dbb72eac4c5..61f7fd37486 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -574,7 +574,6 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, DBUG_RETURN(0); } - extern "C" { int killed_ptr(HA_CHECK *param) @@ -661,6 +660,25 @@ my_bool mi_killed_in_mariadb(MI_INFO *info) return (((TABLE*) (info->external_ref))->in_use->killed != 0); } +static int compute_vcols(MI_INFO *info, uchar *record, int keynum) +{ + TABLE *table= (TABLE*)(info->external_ref); + table->move_fields(table->field, record, table->field[0]->record_ptr()); + if (keynum == -1) // update all vcols + return table->update_virtual_fields(VCOL_UPDATE_INDEXED); + + // update only one key + KEY *key= table->key_info + keynum; + KEY_PART_INFO *kp= key->key_part, *end= kp + key->ext_key_parts; + for (; kp < end; kp++) + { + Field *f= table->field[kp->fieldnr - 1]; + if (f->vcol_info) + table->update_virtual_field(f); + } + return 0; +} + } ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) @@ -668,6 +686,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_VIRTUAL_COLUMNS | HA_CAN_EXPORT | + HA_REQUIRES_KEY_COLUMNS_FOR_DELETE | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | @@ -868,6 +887,27 @@ int ha_myisam::write_row(uchar *buf) return mi_write(file,buf); } +void ha_myisam::setup_vcols_for_repair(HA_CHECK *param) +{ + if (file->s->base.reclength < file->s->vreclength) + { + param->fix_record= compute_vcols; + table->use_all_columns(); + table->vcol_set= &table->s->all_set; + } + else + DBUG_ASSERT(file->s->base.reclength == file->s->vreclength); +} + +void ha_myisam::restore_vcos_after_repair() +{ + if (file->s->base.reclength < file->s->vreclength) + { + table->move_fields(table->field, table->record[0], table->field[0]->record_ptr()); + table->default_column_bitmaps(); + } +} + int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) { if (!file) return HA_ADMIN_INTERNAL_ERROR; @@ -901,6 +941,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) (uint) (share->global_changed ? 1 : 0))))) return HA_ADMIN_ALREADY_DONE; + setup_vcols_for_repair(¶m); + error = chk_status(¶m, file); // Not fatal error = chk_size(¶m, file); if (!error) @@ -953,6 +995,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; } + restore_vcos_after_repair(); + thd_proc_info(thd, old_proc_info); return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; } @@ -986,6 +1030,8 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) if (!(share->state.changed & STATE_NOT_ANALYZED)) return HA_ADMIN_ALREADY_DONE; + setup_vcols_for_repair(¶m); + error = chk_key(¶m, file); if (!error) { @@ -995,6 +1041,9 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) } else if (!mi_is_crashed(file) && !thd->killed) mi_mark_crashed(file); + + restore_vcos_after_repair(); + return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; } @@ -1017,6 +1066,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.backup_time= check_opt->start_time; start_records=file->state->records; + + setup_vcols_for_repair(¶m); + while ((error=repair(thd,param,0)) && param.retry_repair) { param.retry_repair=0; @@ -1040,6 +1092,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) } break; } + + restore_vcos_after_repair(); + if (!error && start_records != file->state->records && !(check_opt->flags & T_VERY_SILENT)) { @@ -1066,6 +1121,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX); param.tmpfile_createflag= O_RDWR | O_TRUNC; param.sort_buffer_length= THDVAR(thd, sort_buffer_size); + + setup_vcols_for_repair(¶m); + if ((error= repair(thd,param,1)) && param.retry_repair) { sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying", @@ -1073,6 +1131,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) param.testflag&= ~T_REP_BY_SORT; error= repair(thd,param,1); } + + restore_vcos_after_repair(); + return error; } @@ -1482,6 +1543,9 @@ int ha_myisam::enable_indexes(uint mode) param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.stats_method= (enum_handler_stats_method)THDVAR(thd, stats_method); param.tmpdir=&mysql_tmpdir_list; + + setup_vcols_for_repair(¶m); + if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) { sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying", @@ -1507,6 +1571,8 @@ int ha_myisam::enable_indexes(uint mode) } info(HA_STATUS_CONST); thd_proc_info(thd, save_proc_info); + + restore_vcos_after_repair(); } else { @@ -2012,14 +2078,14 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, TABLE_SHARE *share= table_arg->s; uint options= share->db_options_in_use; DBUG_ENTER("ha_myisam::create"); - for (i= 0; i < share->keys; i++) - { - if (table_arg->key_info[i].flags & HA_USES_PARSER) - { + + for (i= 0; i < share->virtual_fields && !create_flags; i++) + if (table_arg->vfield[i]->flags & PART_KEY_FLAG) create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER; - break; - } - } + for (i= 0; i < share->keys && !create_flags; i++) + if (table_arg->key_info[i].flags & HA_USES_PARSER) + create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER; + if ((error= table2myisam(table_arg, &keydef, &recinfo, &record_count))) DBUG_RETURN(error); /* purecov: inspected */ bzero((char*) &create_info, sizeof(create_info)); diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 63fb0ea5a2a..bb1a36e089b 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -48,6 +48,8 @@ class ha_myisam: public handler char *data_file_name, *index_file_name; bool can_enable_indexes; int repair(THD *thd, HA_CHECK ¶m, bool optimize); + void setup_vcols_for_repair(HA_CHECK *param); + void restore_vcos_after_repair(); public: ha_myisam(handlerton *hton, TABLE_SHARE *table_arg); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index c8e6bc3cd76..8de200f5e72 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1190,6 +1190,8 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) DBUG_ASSERT(0); /* Impossible */ break; } /* switch */ + if (param->fix_record) + param->fix_record(info, record, -1); if (! got_error) { intern_record_checksum+=(ha_checksum) start_recpos; @@ -3646,6 +3648,10 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) finish: if (sort_param->calc_checksum) param->glob_crc+= info->checksum; + if (param->fix_record) + param->fix_record(info, sort_param->record, + param->testflag & T_REP_BY_SORT ? (int)sort_param->key + : -1); DBUG_RETURN(0); } diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 6bf16f6a426..776594a6409 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -328,6 +328,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) strmov(share->index_file_name, index_name); strmov(share->data_file_name, data_name); + share->vreclength= share->base.reclength; share->blocksize=MY_MIN(IO_SIZE,myisam_block_size); { HA_KEYSEG *pos=share->keyparts; @@ -335,6 +336,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) for (i=0 ; i < keys ; i++) { MI_KEYDEF *keyinfo= share->keyinfo + i; + uint sp_segs; keyinfo->share= share; disk_pos=mi_keydef_read(disk_pos, keyinfo); disk_pos_assert(disk_pos + keyinfo->keysegs * HA_KEYSEG_SIZE, end_pos); @@ -342,7 +344,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) have_rtree=1; set_if_smaller(share->blocksize, keyinfo->block_length); keyinfo->seg= pos; - for (j=0 ; j < keyinfo->keysegs; j++,pos++) + if (keyinfo->flag & HA_SPATIAL) + sp_segs= 2*SPDIMS; + else + sp_segs= 0; + for (j=0 ; j < keyinfo->keysegs; j++, pos++) { disk_pos=mi_keyseg_read(disk_pos, pos); if (pos->flag & HA_BLOB_PART && @@ -366,17 +372,16 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } else if (pos->type == HA_KEYTYPE_BINARY) pos->charset= &my_charset_bin; - if (!(keyinfo->flag & HA_SPATIAL) && - pos->start > share->base.reclength) + if (j < keyinfo->keysegs - sp_segs) { - my_errno= HA_ERR_CRASHED; - goto err; + uint real_length= pos->flag & HA_BLOB_PART ? pos->bit_start + : pos->length; + set_if_bigger(share->vreclength, pos->start + real_length); } } if (keyinfo->flag & HA_SPATIAL) { #ifdef HAVE_SPATIAL - uint sp_segs= SPDIMS*2; keyinfo->seg= pos - sp_segs; DBUG_ASSERT(keyinfo->keysegs == sp_segs + 1); keyinfo->keysegs= sp_segs; diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 336f1170d29..f467d44bcb9 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -199,6 +199,7 @@ typedef struct st_mi_isam_share ulong max_pack_length; ulong state_diff_length; uint rec_reflength; /* rec_reflength in use now */ + ulong vreclength; /* full reclength, including vcols */ uint unique_name_length; uint32 ftkeys; /* Number of full-text keys + 1 */ File kfile; /* Shared keyfile */ From b38ff28ade620b816c62f3df5edd739c779ad023 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 14:04:37 +0100 Subject: [PATCH 066/135] bugfix: mark_columns_needed_for_update cannot use TABLE:merge_keys for that, because Field::part_of_key was designed to mark fields for KEY_READ, so a field is not a "part of key", if only prefix of the field is. --- mysql-test/include/commit.inc | 4 +-- mysql-test/r/commit_1innodb.result | 4 +-- mysql-test/suite/vcol/r/update.result | 27 ++++++++++++++++++++ mysql-test/suite/vcol/t/update.test | 36 +++++++++++++++++++++++++++ sql/table.cc | 36 +++++++++++++++++++-------- 5 files changed, 92 insertions(+), 15 deletions(-) diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index e72ebba8527..830ffb52c02 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -430,9 +430,9 @@ call p_verify_status_increment(2, 2, 2, 2); --echo # 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE --echo # update t1 set a=2; -call p_verify_status_increment(2, 2, 1, 0); +call p_verify_status_increment(2, 0, 1, 0); commit; -call p_verify_status_increment(2, 2, 1, 0); +call p_verify_status_increment(2, 0, 1, 0); --echo # 5. Read-write statement: UPDATE, update 0 rows, 0 rows match WHERE --echo # diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index 1e173221b15..514f0a67c7f 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -419,11 +419,11 @@ SUCCESS # 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE # update t1 set a=2; -call p_verify_status_increment(2, 2, 1, 0); +call p_verify_status_increment(2, 0, 1, 0); SUCCESS commit; -call p_verify_status_increment(2, 2, 1, 0); +call p_verify_status_increment(2, 0, 1, 0); SUCCESS # 5. Read-write statement: UPDATE, update 0 rows, 0 rows match WHERE diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result index d56f85c1f1c..d2b67cefbd0 100644 --- a/mysql-test/suite/vcol/r/update.result +++ b/mysql-test/suite/vcol/r/update.result @@ -8,3 +8,30 @@ select * from t1; a b c 2 3 4 drop table t1; +create table t1 (a int, c int as(a), p varchar(20) as(y), y char(20), index (p,c)); +insert into t1 (a,y) values(1, "yyy"); +update t1 set a = 100 where a = 1; +drop table t1; +create table t1 ( +a varchar(10000), +b varchar(3000), +c varchar(14000) generated always as (concat(a,b)) virtual, +d varchar(5000) generated always as (b) virtual, +e int(11) generated always as (10) virtual, +h int(11) not null primary key, +index(c(100), d(20))); +insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); +update t1 set a = repeat(cast(1 as char), 2000); +drop table t1; +create table t1 ( +a varchar(10000), +b varchar(3000), +c varchar(14000) generated always as (concat(a,b)) virtual, +i varchar(5000) generated always as (b) virtual, +d varchar(5000) generated always as (i) virtual, +e int(11) generated always as (10) virtual, +h int(11) not null primary key, +index(c(100), d(20))); +insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); +update t1 set a = repeat(cast(1 as char), 2000); +drop table t1; diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test index 35dbab83bfc..c0dbcaf6afd 100644 --- a/mysql-test/suite/vcol/t/update.test +++ b/mysql-test/suite/vcol/t/update.test @@ -10,3 +10,39 @@ select * from t1; update t1 set a=2; select * from t1; drop table t1; +# +# one keypart is virtual, the other keypart is updated +# this tests TABLE::mark_columns_needed_for_update() +# +create table t1 (a int, c int as(a), p varchar(20) as(y), y char(20), index (p,c)); +insert into t1 (a,y) values(1, "yyy"); +update t1 set a = 100 where a = 1; +drop table t1; + +# +# note: prefix keys below +# +create table t1 ( + a varchar(10000), + b varchar(3000), + c varchar(14000) generated always as (concat(a,b)) virtual, + d varchar(5000) generated always as (b) virtual, + e int(11) generated always as (10) virtual, + h int(11) not null primary key, + index(c(100), d(20))); +insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); +update t1 set a = repeat(cast(1 as char), 2000); +drop table t1; + +create table t1 ( + a varchar(10000), + b varchar(3000), + c varchar(14000) generated always as (concat(a,b)) virtual, + i varchar(5000) generated always as (b) virtual, + d varchar(5000) generated always as (i) virtual, + e int(11) generated always as (10) virtual, + h int(11) not null primary key, + index(c(100), d(20))); +insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); +update t1 set a = repeat(cast(1 as char), 2000); +drop table t1; diff --git a/sql/table.cc b/sql/table.cc index 2c972446da3..7e139652b6f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6272,15 +6272,34 @@ void TABLE::mark_columns_needed_for_update() if (triggers) triggers->mark_fields_used(TRG_EVENT_UPDATE); + if (default_field) + mark_default_fields_for_write(FALSE); + if (vfield) + need_signal|= mark_virtual_columns_for_write(FALSE); if (file->ha_table_flags() & HA_REQUIRES_KEY_COLUMNS_FOR_DELETE) { - /* Mark all used key columns for read */ - Field **reg_field; - for (reg_field= field ; *reg_field ; reg_field++) + KEY *end= key_info + s->keys; + for (KEY *k= key_info; k < end; k++) { - /* Merge keys is all keys that had a column refered to in the query */ - if (merge_keys.is_overlapping((*reg_field)->part_of_key)) - bitmap_set_bit(read_set, (*reg_field)->field_index); + KEY_PART_INFO *kpend= k->key_part + k->ext_key_parts; + bool any_written= false, all_read= true; + for (KEY_PART_INFO *kp= k->key_part; kp < kpend; kp++) + { + int idx= kp->fieldnr - 1; + any_written|= bitmap_is_set(write_set, idx); + all_read&= bitmap_is_set(read_set, idx); + } + if (any_written && !all_read) + { + for (KEY_PART_INFO *kp= k->key_part; kp < kpend; kp++) + { + int idx= kp->fieldnr - 1; + if (bitmap_fast_test_and_set(read_set, idx)) + continue; + if (field[idx]->vcol_info) + mark_virtual_col(field[idx]); + } + } } need_signal= true; } @@ -6299,11 +6318,6 @@ void TABLE::mark_columns_needed_for_update() need_signal= true; } } - if (default_field) - mark_default_fields_for_write(FALSE); - /* Mark all virtual columns needed for update */ - if (vfield) - need_signal|= mark_virtual_columns_for_write(FALSE); if (check_constraints) { mark_check_constraint_columns_for_read(); From 54ab7db733d91b27ca2aec316cea4a3c2afa86a5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 14:04:49 +0100 Subject: [PATCH 067/135] cleanup: remove now-unused TABLE::merge_keys --- sql/item.h | 1 - sql/sql_base.cc | 5 ----- sql/sql_base.h | 2 -- sql/sql_lex.cc | 1 - sql/sql_select.cc | 1 - sql/table.cc | 1 - sql/table.h | 2 +- 7 files changed, 1 insertion(+), 12 deletions(-) diff --git a/sql/item.h b/sql/item.h index ae5acd365e1..1aa613a25b8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2529,7 +2529,6 @@ public: { TABLE *tab= field->table; tab->covering_keys.intersect(field->part_of_key); - tab->merge_keys.merge(field->part_of_key); if (tab->read_set) bitmap_fast_test_and_set(tab->read_set, field->field_index); /* diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9bd0c062cdc..a3790043f9f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5027,7 +5027,6 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table) */ table->covering_keys.intersect(field->part_of_key); - table->merge_keys.merge(field->part_of_key); if (field->vcol_info) table->mark_virtual_col(field); @@ -6376,7 +6375,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, /* Mark field_1 used for table cache. */ bitmap_set_bit(table_1->read_set, field_1->field_index); table_1->covering_keys.intersect(field_1->part_of_key); - table_1->merge_keys.merge(field_1->part_of_key); } if (field_2) { @@ -6384,7 +6382,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, /* Mark field_2 used for table cache. */ bitmap_set_bit(table_2->read_set, field_2->field_index); table_2->covering_keys.intersect(field_2->part_of_key); - table_2->merge_keys.merge(field_2->part_of_key); } if (using_fields != NULL) @@ -7479,7 +7476,6 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, if (table) { table->covering_keys.intersect(field->part_of_key); - table->merge_keys.merge(field->part_of_key); } if (tables->is_natural_join) { @@ -7499,7 +7495,6 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, thd->lex->current_select->select_list_tables|= field_table->map; field_table->covering_keys.intersect(field->part_of_key); - field_table->merge_keys.merge(field->part_of_key); field_table->used_fields++; } } diff --git a/sql/sql_base.h b/sql/sql_base.h index 2c0e6850d04..8f363a73863 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -329,14 +329,12 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) table->force_index= table_list->force_index; table->force_index_order= table->force_index_group= 0; table->covering_keys= table->s->keys_for_keyread; - table->merge_keys.clear_all(); TABLE_LIST *orig= table_list->select_lex ? table_list->select_lex->master_unit()->derived : 0; if (!orig || !orig->is_merged_derived()) { /* Tables merged from derived were set up already.*/ table->covering_keys= table->s->keys_for_keyread; - table->merge_keys.clear_all(); } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 19e7668790e..bea3b14e607 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4122,7 +4122,6 @@ void SELECT_LEX::update_used_tables() TABLE *tab= tl->table; tab->covering_keys= tab->s->keys_for_keyread; tab->covering_keys.intersect(tab->keys_in_use_for_query); - tab->merge_keys.clear_all(); bitmap_clear_all(tab->read_set); if (tab->vcol_set) bitmap_clear_all(tab->vcol_set); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ed121191209..5eda6e9bbbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -16338,7 +16338,6 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List &fields, table->in_use= thd; table->quick_keys.init(); table->covering_keys.init(); - table->merge_keys.init(); table->intersect_keys.init(); table->keys_in_use_for_query.init(); table->no_rows_with_nulls= param->force_not_null_cols; diff --git a/sql/table.cc b/sql/table.cc index 7e139652b6f..7d14f961721 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2878,7 +2878,6 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, goto err; outparam->quick_keys.init(); outparam->covering_keys.init(); - outparam->merge_keys.init(); outparam->intersect_keys.init(); outparam->keys_in_use_for_query.init(); diff --git a/sql/table.h b/sql/table.h index 27439670a22..344655ebbbc 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1042,7 +1042,7 @@ public: needed by the query without reading the row. */ key_map covering_keys; - key_map quick_keys, merge_keys,intersect_keys; + key_map quick_keys, intersect_keys; /* A set of keys that can be used in the query that references this table. From b8f51c04d31e15570c53dc2e61258304ee49047a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 19:26:55 +0100 Subject: [PATCH 068/135] bugfix: update-behind-insert sql_insert.cc calls handler->ha_update_row() for REPLACE and INSERT... ON DUPLICATE KEY UPDATE --- mysql-test/suite/vcol/r/update.result | 8 ++++++++ mysql-test/suite/vcol/t/update.test | 9 +++++++++ sql/sql_insert.cc | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result index d2b67cefbd0..dd864e4a7e2 100644 --- a/mysql-test/suite/vcol/r/update.result +++ b/mysql-test/suite/vcol/r/update.result @@ -35,3 +35,11 @@ index(c(100), d(20))); insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); update t1 set a = repeat(cast(1 as char), 2000); drop table t1; +create table t1(a blob not null, b int, c varbinary (10) generated always as (a) virtual, unique (c(9))); +insert t1 (a,b) values ('a', 1); +replace t1 set a = 'a',b =1; +insert t1 (a,b) values ('a', 1) on duplicate key update a='b', b=2; +select * from t1; +a b c +b 2 b +drop table t1; diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test index c0dbcaf6afd..f840c277cd1 100644 --- a/mysql-test/suite/vcol/t/update.test +++ b/mysql-test/suite/vcol/t/update.test @@ -46,3 +46,12 @@ create table t1 ( insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1); update t1 set a = repeat(cast(1 as char), 2000); drop table t1; +# +# UPDATE disguised as INSERT +# +create table t1(a blob not null, b int, c varbinary (10) generated always as (a) virtual, unique (c(9))); +insert t1 (a,b) values ('a', 1); +replace t1 set a = 'a',b =1; +insert t1 (a,b) values ('a', 1) on duplicate key update a='b', b=2; +select * from t1; +drop table t1; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index aa5b5ac756b..955a66958fe 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1696,6 +1696,12 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) HA_READ_KEY_EXACT)))) goto err; } + if (table->vfield) + { + table->move_fields(table->field, table->record[1], table->record[0]); + table->update_virtual_fields(VCOL_UPDATE_INDEXED); + table->move_fields(table->field, table->record[0], table->record[1]); + } if (info->handle_duplicates == DUP_UPDATE) { int res= 0; From 0e401bf7bfe4a14609e25c4335b9d4e0619e35ec Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 22 Oct 2016 17:33:42 +0200 Subject: [PATCH 069/135] bugfix: move vcol calculations down into the handler This fixes a bug where handler::read_range_first (for example) needed to compare vcol values that were not calculated yet. As a bonus it fixes few cases where vcols were calculated twice --- mysql-test/suite/vcol/r/mrr.result | 25 +++++++++++++++++++++++ mysql-test/suite/vcol/t/mrr.test | 13 ++++++++++++ sql/filesort.cc | 6 +----- sql/handler.cc | 32 ++++++++++++++++++++++++++++++ sql/sql_delete.cc | 2 +- sql/sql_handler.cc | 3 --- sql/sql_join_cache.cc | 7 ------- sql/sql_select.cc | 7 ------- sql/sql_table.cc | 2 -- 9 files changed, 72 insertions(+), 25 deletions(-) create mode 100644 mysql-test/suite/vcol/r/mrr.result create mode 100644 mysql-test/suite/vcol/t/mrr.test diff --git a/mysql-test/suite/vcol/r/mrr.result b/mysql-test/suite/vcol/r/mrr.result new file mode 100644 index 00000000000..39337f32963 --- /dev/null +++ b/mysql-test/suite/vcol/r/mrr.result @@ -0,0 +1,25 @@ +CREATE TABLE t1 ( +pk INT AUTO_INCREMENT PRIMARY KEY, +col_int_nokey INT NULL, +col_int_key INT AS (col_int_nokey) VIRTUAL, +KEY (col_int_key) +); +INSERT INTO t1 (col_int_nokey) +VALUES (0), (5), (4), (3), (7), (42), (5), (0), (3); +SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1; +pk col_int_nokey col_int_key +3 4 4 +4 3 3 +9 3 3 +set optimizer_switch='index_condition_pushdown=off'; +SELECT * FROM t1 WHERE col_int_key IN (3, 4) ORDER BY 1; +pk col_int_nokey col_int_key +3 4 4 +4 3 3 +9 3 3 +SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1; +pk col_int_nokey col_int_key +3 4 4 +4 3 3 +9 3 3 +DROP TABLE t1; diff --git a/mysql-test/suite/vcol/t/mrr.test b/mysql-test/suite/vcol/t/mrr.test new file mode 100644 index 00000000000..d7772ba5a78 --- /dev/null +++ b/mysql-test/suite/vcol/t/mrr.test @@ -0,0 +1,13 @@ +CREATE TABLE t1 ( + pk INT AUTO_INCREMENT PRIMARY KEY, + col_int_nokey INT NULL, + col_int_key INT AS (col_int_nokey) VIRTUAL, + KEY (col_int_key) +); +INSERT INTO t1 (col_int_nokey) +VALUES (0), (5), (4), (3), (7), (42), (5), (0), (3); +SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1; +set optimizer_switch='index_condition_pushdown=off'; +SELECT * FROM t1 WHERE col_int_key IN (3, 4) ORDER BY 1; +SELECT * FROM t1 WHERE col_int_key IN (3, 4) AND col_int_key <= 83 ORDER BY 1; +DROP TABLE t1; diff --git a/sql/filesort.cc b/sql/filesort.cc index e2f18f99135..a82f4871045 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -31,7 +31,7 @@ #include #include "sql_sort.h" #include "probes_mysql.h" -#include "sql_base.h" // update_virtual_fields +#include "sql_base.h" #include "sql_test.h" // TEST_filesort #include "opt_range.h" // SQL_SELECT #include "bounded_queue.h" @@ -784,8 +784,6 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, { if ((error= select->quick->get_next())) break; - if (!error && sort_form->vfield) - sort_form->update_virtual_fields(VCOL_UPDATE_FOR_READ); file->position(sort_form->record[0]); DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE);); } @@ -793,8 +791,6 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, { { error= file->ha_rnd_next(sort_form->record[0]); - if (!error && sort_form->vfield) - sort_form->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (!flag) { my_store_ptr(ref_pos,ref_length,record); // Position to row diff --git a/sql/handler.cc b/sql/handler.cc index ede0bfad5ce..4155057ebe8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2579,6 +2579,8 @@ int handler::ha_rnd_next(uchar *buf) if (!result) { update_rows_read(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); increment_statistics(&SSV::ha_read_rnd_next_count); } else if (result == HA_ERR_RECORD_DELETED) @@ -2603,7 +2605,11 @@ int handler::ha_rnd_pos(uchar *buf, uchar *pos) { result= rnd_pos(buf, pos); }) increment_statistics(&SSV::ha_read_rnd_count); if (!result) + { update_rows_read(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; DBUG_RETURN(result); } @@ -2622,7 +2628,11 @@ int handler::ha_index_read_map(uchar *buf, const uchar *key, { result= index_read_map(buf, key, keypart_map, find_flag); }) increment_statistics(&SSV::ha_read_key_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; DBUG_RETURN(result); } @@ -2649,6 +2659,8 @@ int handler::ha_index_read_idx_map(uchar *buf, uint index, const uchar *key, { update_rows_read(); index_rows_read[index]++; + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } table->status=result ? STATUS_NOT_FOUND: 0; return result; @@ -2666,7 +2678,11 @@ int handler::ha_index_next(uchar * buf) { result= index_next(buf); }) increment_statistics(&SSV::ha_read_next_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; DBUG_RETURN(result); } @@ -2683,7 +2699,11 @@ int handler::ha_index_prev(uchar * buf) { result= index_prev(buf); }) increment_statistics(&SSV::ha_read_prev_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; DBUG_RETURN(result); } @@ -2699,7 +2719,11 @@ int handler::ha_index_first(uchar * buf) { result= index_first(buf); }) increment_statistics(&SSV::ha_read_first_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; return result; } @@ -2715,7 +2739,11 @@ int handler::ha_index_last(uchar * buf) { result= index_last(buf); }) increment_statistics(&SSV::ha_read_last_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; return result; } @@ -2731,7 +2759,11 @@ int handler::ha_index_next_same(uchar *buf, const uchar *key, uint keylen) { result= index_next_same(buf, key, keylen); }) increment_statistics(&SSV::ha_read_next_count); if (!result) + { update_index_statistics(); + if (table->vfield && buf == table->record[0]) + table->update_virtual_fields(VCOL_UPDATE_FOR_READ); + } table->status=result ? STATUS_NOT_FOUND: 0; return result; } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index d0da7f9dc2d..46491a832b3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -561,7 +561,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { explain->tracker.on_record_read(); if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); + table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); thd->inc_examined_row_count(1); // thd->is_error() is tested to disallow delete row on error if (!select || select->skip_record(thd) > 0) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index bab33919e03..735adeadb11 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -929,9 +929,6 @@ retry: } goto ok; } - /* Generate values for virtual fields */ - if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (cond && !cond->val_int()) { if (thd->is_error()) diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 7c134aba551..b9d7f660a5a 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -3371,7 +3371,6 @@ int JOIN_TAB_SCAN::next() int skip_rc; READ_RECORD *info= &join_tab->read_record; SQL_SELECT *select= join_tab->cache_select; - TABLE *table= join_tab->table; THD *thd= join->thd; if (is_first_record) @@ -3382,8 +3381,6 @@ int JOIN_TAB_SCAN::next() if (!err) { join_tab->tracker->r_rows++; - if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } while (!err && select && (skip_rc= select->skip_record(thd)) <= 0) @@ -3398,8 +3395,6 @@ int JOIN_TAB_SCAN::next() if (!err) { join_tab->tracker->r_rows++; - if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } } @@ -3923,8 +3918,6 @@ int JOIN_TAB_SCAN_MRR::next() DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) && (uchar *) (*ptr) <= cache->end_pos); */ - if (join_tab->table->vfield) - join_tab->table->update_virtual_fields(VCOL_UPDATE_FOR_READ); } return rc; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5eda6e9bbbb..efeee4085ff 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -18442,9 +18442,6 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, join_tab->tracker->r_rows++; - if (join_tab->table->vfield) - join_tab->table->update_virtual_fields(VCOL_UPDATE_FOR_READ); - if (select_cond) { select_cond_result= MY_TEST(select_cond->val_int()); @@ -18895,8 +18892,6 @@ join_read_system(JOIN_TAB *tab) empty_record(table); // Make empty record return -1; } - if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ); store_record(table,record[1]); } else if (!table->status) // Only happens with left join @@ -18942,8 +18937,6 @@ join_read_const(JOIN_TAB *tab) return report_error(table, error); return -1; } - if (table->vfield) - table->update_virtual_fields(VCOL_UPDATE_FOR_READ); store_record(table,record[1]); } else if (!(table->status & ~STATUS_NULL_ROW)) // Only happens with left join diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7b18322662a..16c8214438b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9803,8 +9803,6 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, error= 1; break; } - if (from->vfield) - from->update_virtual_fields(VCOL_UPDATE_FOR_READ); if (++thd->progress.counter >= time_to_report_progress) { time_to_report_progress+= MY_HOW_OFTEN_TO_WRITE/10; From aebb1038aab6cadc3408fc194d1d9331d2b673ff Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Nov 2016 12:54:59 +0100 Subject: [PATCH 070/135] bugfix: multi-UPDATE, vcols, const tables multi-update was setting up read_set/vcol_set in multi_update::initialize_tables() that is invoked after the optimizer (JOIN::optimize_inner()). But some rows - if they're from const tables - will be read already in the optimizer, and these rows will not have all necessary column/vcol values. * multi_update::initialize_tables() uses results from the optimizer and cannot be moved to be called earlier. * multi_update::prepare() is called before the optimizer, but it cannot set up read_set/vcol_set, because the optimizer might reset them (see SELECT_LEX::update_used_tables()). As a fix I've added a new method, select_result::prepare_to_read_rows(), it's called from inside the optimizer just before make_join_statistics(). --- .../federated/federated_maybe_16324629.result | 1 - mysql-test/suite/vcol/r/update.result | 11 ++++++++++ mysql-test/suite/vcol/t/update.test | 10 ++++++++++ sql/sql_class.h | 20 ++++++++----------- sql/sql_delete.cc | 11 ++++++++-- sql/sql_lex.cc | 9 +++++++++ sql/sql_select.cc | 1 + sql/sql_update.cc | 17 ++++++++++++++-- 8 files changed, 63 insertions(+), 17 deletions(-) diff --git a/mysql-test/suite/federated/federated_maybe_16324629.result b/mysql-test/suite/federated/federated_maybe_16324629.result index 0417b5c0659..e16e4dd101d 100644 --- a/mysql-test/suite/federated/federated_maybe_16324629.result +++ b/mysql-test/suite/federated/federated_maybe_16324629.result @@ -13,7 +13,6 @@ insert into t1 values (3, 3), (7, 7); delete t1 from t1 where a = 3; select * from t1; a b -3 3 7 7 drop table t1; connection slave; diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result index dd864e4a7e2..e88502492cb 100644 --- a/mysql-test/suite/vcol/r/update.result +++ b/mysql-test/suite/vcol/r/update.result @@ -43,3 +43,14 @@ select * from t1; a b c b 2 b drop table t1; +create table t (a int primary key, b int, c int as (b), index (c)); +insert t (a,b) values (9,0); +create table t2 select * from t; +update t, t2 set t.b=10 where t.a=t2.a; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c +9 10 10 +drop table t, t2; diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test index f840c277cd1..8be5872a26b 100644 --- a/mysql-test/suite/vcol/t/update.test +++ b/mysql-test/suite/vcol/t/update.test @@ -55,3 +55,13 @@ replace t1 set a = 'a',b =1; insert t1 (a,b) values ('a', 1) on duplicate key update a='b', b=2; select * from t1; drop table t1; + +# +# multi-UPDATE and const tables +# +create table t (a int primary key, b int, c int as (b), index (c)); +insert t (a,b) values (9,0); +create table t2 select * from t; +update t, t2 set t.b=10 where t.a=t2.a; +check table t; select * from t; +drop table t, t2; diff --git a/sql/sql_class.h b/sql/sql_class.h index 0434f5485cf..507fadedac1 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -4455,6 +4455,9 @@ public: #endif virtual void update_used_tables() {} + /* this method is called just before the first row of the table can be read */ + virtual void prepare_to_read_rows() {} + void reset_offset_limit() { unit->offset_limit_cnt= 0; @@ -5301,11 +5304,9 @@ public: int do_deletes(); int do_table_deletes(TABLE *table, SORT_INFO *sort_info, bool ignore); bool send_eof(); - inline ha_rows num_deleted() - { - return deleted; - } + inline ha_rows num_deleted() const { return deleted; } virtual void abort_result_set(); + void prepare_to_read_rows(); }; @@ -5349,16 +5350,11 @@ public: bool initialize_tables (JOIN *join); int do_updates(); bool send_eof(); - inline ha_rows num_found() - { - return found; - } - inline ha_rows num_updated() - { - return updated; - } + inline ha_rows num_found() const { return found; } + inline ha_rows num_updated() const { return updated; } virtual void abort_result_set(); void update_used_tables(); + void prepare_to_read_rows(); }; class my_var : public Sql_alloc { diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 46491a832b3..e9a3be30060 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -924,6 +924,15 @@ multi_delete::prepare(List &values, SELECT_LEX_UNIT *u) DBUG_RETURN(0); } +void multi_delete::prepare_to_read_rows() +{ + /* see multi_update::prepare_to_read_rows() */ + for (TABLE_LIST *walk= delete_tables; walk; walk= walk->next_local) + { + TABLE_LIST *tbl= walk->correspondent_table->find_table_for_update(); + tbl->table->mark_columns_needed_for_delete(); + } +} bool multi_delete::initialize_tables(JOIN *join) @@ -953,7 +962,6 @@ multi_delete::initialize_tables(JOIN *join) } } - walk= delete_tables; for (JOIN_TAB *tab= first_linear_tab(join, WITHOUT_BUSH_ROOTS, @@ -977,7 +985,6 @@ multi_delete::initialize_tables(JOIN *join) normal_tables= 1; tbl->prepare_triggers_for_delete_stmt_or_event(); tbl->prepare_for_position(); - tbl->mark_columns_needed_for_delete(); } else if ((tab->type != JT_SYSTEM && tab->type != JT_CONST) && walk == delete_tables) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index bea3b14e607..634b6d1a3b8 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4122,6 +4122,15 @@ void SELECT_LEX::update_used_tables() TABLE *tab= tl->table; tab->covering_keys= tab->s->keys_for_keyread; tab->covering_keys.intersect(tab->keys_in_use_for_query); + /* + View/derived was merged. Need to recalculate read_set/vcol_set + bitmaps here. For example: + CREATE VIEW v1 AS SELECT f1,f2,f3 FROM t1; + SELECT f1 FROM v1; + Initially, the view definition will put all f1,f2,f3 in the + read_set for t1. But after the view is merged, only f1 should + be in the read_set. + */ bitmap_clear_all(tab->read_set); if (tab->vcol_set) bitmap_clear_all(tab->vcol_set); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index efeee4085ff..89a9eeb1e32 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1466,6 +1466,7 @@ JOIN::optimize_inner() /* Calculate how to do the join */ THD_STAGE_INFO(thd, stage_statistics); + result->prepare_to_read_rows(); if (make_join_statistics(this, select_lex->leaf_tables, &keyuse) || thd->is_fatal_error) { diff --git a/sql/sql_update.cc b/sql/sql_update.cc index da0e6cd2116..05f7080609a 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1800,6 +1800,21 @@ void multi_update::update_used_tables() } } +void multi_update::prepare_to_read_rows() +{ + /* + update column maps now. it cannot be done in ::prepare() before the + optimizer, because the optimize might reset them (in + SELECT_LEX::update_used_tables()), it cannot be done in + ::initialize_tables() after the optimizer, because the optimizer + might read rows from const tables + */ + + for (TABLE_LIST *tl= update_tables; tl; tl= tl->next_local) + tl->table->mark_columns_needed_for_update(); +} + + /* Check if table is safe to update on fly @@ -1916,12 +1931,10 @@ multi_update::initialize_tables(JOIN *join) { if (safe_update_on_fly(thd, join->join_tab, table_ref, all_tables)) { - table->mark_columns_needed_for_update(); table_to_update= table; // Update table on the fly continue; } } - table->mark_columns_needed_for_update(); table->prepare_for_position(); /* From f73bdb685d77b944f4565e0a97778faa30999145 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Nov 2016 16:42:09 +0100 Subject: [PATCH 071/135] bugfix: UPDATE and virtual BLOBs When updating a table with virtual BLOB columns, the following might happen: - an old record is read from the table, it has no virtual blob values - update_virtual_fields() is run, vcol blob gets its value into the record. But only a pointer to the value is in the table->record[0], the value is in Field_blob::value String (but it doesn't have to be! it can be in the record, if the column is just a copy of another columns: ... b VARCHAR, c BLOB AS (b) ...) - store_record(table,record[1]), old record now is in record[1] - fill_record() prepares new values in record[0], vcol blob is updated, new value replaces the old one in the Field_blob::value - now both record[1] and record[0] have a pointer that points to the *new* vcol blob value. Or record[1] has a pointer to nowhere if Field_blob::value had to realloc. To resolve this we unlink vcol blobs from the pointer to the data (in the record[1]). Because the value is not *always* in the Field_blob::value String, we need to remember what blobs were unlinked. The orphan memory must be freed manually. To complicate the matter, ha_update_row() is also used in multi-update, in REPLACE, in INSERT ... ON DUPLICATE KEY UPDATE, also on REPLACE ... SELECT, REPLACE DELAYED, and LOAD DATA REPLACE, etc --- mysql-test/suite/vcol/r/update.result | 100 ++++++++++++++++++++++++++ mysql-test/suite/vcol/t/update.test | 45 ++++++++++++ sql/field.h | 3 + sql/sql_class.h | 99 ++++++++++++++++++++++++- sql/sql_insert.cc | 36 ++++++++-- sql/sql_insert.h | 1 - sql/sql_load.cc | 6 ++ sql/sql_update.cc | 18 +++++ 8 files changed, 301 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result index e88502492cb..333ebf842a3 100644 --- a/mysql-test/suite/vcol/r/update.result +++ b/mysql-test/suite/vcol/r/update.result @@ -54,3 +54,103 @@ select * from t; a b c 9 10 10 drop table t, t2; +create table t1 (a int, b int, c int, d int, e int); +insert t1 values (1,2,3,4,5), (1,2,3,4,5); +create table t (a int primary key, +b int, c blob as (b), index (c(57)), +d blob, e blob as (d), index (e(57))) +replace select * from t1; +Warnings: +Warning 1906 The value specified for computed column 'c' in table 't' ignored +Warning 1906 The value specified for computed column 'e' in table 't' ignored +Warning 1906 The value specified for computed column 'c' in table 't' ignored +Warning 1906 The value specified for computed column 'e' in table 't' ignored +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +1 2 2 4 4 +update t set a=10, b=1, d=1; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 1 1 1 1 +replace t (a,b,d) values (10,2,2); +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 2 2 2 2 +insert t(a,b,d) values (10) on duplicate key update b=3; +ERROR 21S01: Column count doesn't match value count at row 1 +insert t(a,b,d) values (10,2,2) on duplicate key update b=3, d=3; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 3 3 3 3 +replace t (a,b,d) select 10,4,4; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 4 4 4 4 +insert t(a,b,d) select 10,4,4 on duplicate key update b=5, d=5; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 5 5 5 5 +replace delayed t (a,b,d) values (10,6,6); +flush tables; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 6 6 6 6 +insert delayed t(a,b,d) values (10,6,6) on duplicate key update b=7, d=7; +flush tables; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 7 7 7 7 +load data infile 'MYSQLTEST_VARDIR/tmp/vblobs.txt' replace into table t; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +10 8 8 8 8 +update t set a=11, b=9, d=9 where a>5; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +11 9 9 9 9 +create table t2 select * from t; +update t, t2 set t.b=10, t.d=10 where t.a=t2.a; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +11 10 10 10 10 +update t, t tt set t.b=11, tt.d=11 where t.a=tt.a; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +select * from t; +a b c d e +11 11 11 11 11 +drop table t, t1, t2; diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test index 8be5872a26b..8326afe214f 100644 --- a/mysql-test/suite/vcol/t/update.test +++ b/mysql-test/suite/vcol/t/update.test @@ -65,3 +65,48 @@ create table t2 select * from t; update t, t2 set t.b=10 where t.a=t2.a; check table t; select * from t; drop table t, t2; + +# +# blobs +# This tests BLOB_VALUE_ORPHANAGE +# +create table t1 (a int, b int, c int, d int, e int); +insert t1 values (1,2,3,4,5), (1,2,3,4,5); +create table t (a int primary key, + b int, c blob as (b), index (c(57)), + d blob, e blob as (d), index (e(57))) + replace select * from t1; +check table t; select * from t; +update t set a=10, b=1, d=1; +check table t; select * from t; +replace t (a,b,d) values (10,2,2); +check table t; select * from t; +--error ER_WRONG_VALUE_COUNT_ON_ROW +insert t(a,b,d) values (10) on duplicate key update b=3; +insert t(a,b,d) values (10,2,2) on duplicate key update b=3, d=3; +check table t; select * from t; +replace t (a,b,d) select 10,4,4; +check table t; select * from t; +insert t(a,b,d) select 10,4,4 on duplicate key update b=5, d=5; +check table t; select * from t; +replace delayed t (a,b,d) values (10,6,6); +flush tables; +check table t; select * from t; +insert delayed t(a,b,d) values (10,6,6) on duplicate key update b=7, d=7; +flush tables; +check table t; select * from t; +--write_file $MYSQLTEST_VARDIR/tmp/vblobs.txt +10 8 foo 8 foo +EOF +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval load data infile '$MYSQLTEST_VARDIR/tmp/vblobs.txt' replace into table t +--remove_file $MYSQLTEST_VARDIR/tmp/vblobs.txt +check table t; select * from t; +update t set a=11, b=9, d=9 where a>5; +check table t; select * from t; +create table t2 select * from t; +update t, t2 set t.b=10, t.d=10 where t.a=t2.a; +check table t; select * from t; +update t, t tt set t.b=11, tt.d=11 where t.a=tt.a; +check table t; select * from t; +drop table t, t1, t2; diff --git a/sql/field.h b/sql/field.h index 2cdbd50e278..c44463248a3 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3324,6 +3324,9 @@ public: uint max_packed_col_length(uint max_length); void free() { value.free(); } inline void clear_temporary() { bzero((uchar*) &value, sizeof(value)); } + inline bool owns_ptr(uchar* p) const { return p == (uchar*)value.ptr(); } + inline void own_value_ptr() + { value.reset((char*)get_ptr(), get_length(), get_length(), value.charset()); } uint size_of() const { return sizeof(*this); } bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 507fadedac1..84bcc8f4213 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -201,6 +201,99 @@ typedef struct st_user_var_events bool unsigned_flag; } BINLOG_USER_VAR_EVENT; + +/* + When updating a table with virtual BLOB columns, the following might happen: + - an old record is read from the table, it has no vcol blob. + - update_virtual_fields() is run, vcol blob gets its value into the + record. But only a pointer to the value is in the table->record[0], + the value is in Field_blob::value String (or, it can be elsewhere!) + - store_record(table,record[1]), old record now is in record[1] + - fill_record() prepares new values in record[0], vcol blob is updated, + new value replaces the old one in the Field_blob::value + - now both record[1] and record[0] have a pointer that points to the + *new* vcol blob value. Or record[1] has a pointer to nowhere if + Field_blob::value had to realloc. + + To resolve this we unlink vcol blobs from the pointer to the + data (in the record[1]). The orphan memory must be freed manually + (but, again, only if it was owned by Field_blob::value String). + + With REPLACE and INSERT ... ON DUP KEY UPATE it's even more complex. + There is no store_record(table,record[1]), instead the row is read + directly into record[1]. +*/ +struct BLOB_VALUE_ORPHANAGE { + MY_BITMAP map; + TABLE *table; + BLOB_VALUE_ORPHANAGE() { map.bitmap= NULL; } + ~BLOB_VALUE_ORPHANAGE() { free(); } + bool init(TABLE *table_arg) + { + table= table_arg; + if (table->s->virtual_fields && table->s->blob_fields) + return bitmap_init(&map, NULL, table->s->virtual_fields, FALSE); + map.bitmap= NULL; + return 0; + } + void free() { bitmap_free(&map); } + + /** Remove blob's ownership from blob value memory + + @note the memory becomes orphaned, it needs to be freed using + free_orphans() or re-attached back to blobs using adopt_orphans() + */ + void make_orphans() + { + DBUG_ASSERT(!table || !table->s->virtual_fields || !table->s->blob_fields || map.bitmap); + if (!map.bitmap) + return; + for (Field **ptr=table->vfield; *ptr; ptr++) + { + Field_blob *vb= (Field_blob*)(*ptr); + if (!(vb->flags & BLOB_FLAG) || !vb->owns_ptr(vb->get_ptr())) + continue; + bitmap_set_bit(&map, ptr - table->vfield); + vb->clear_temporary(); + } + } + + /** Frees orphaned blob values + + @note It is assumed that value pointers are in table->record[1], while + Field_blob::ptr's point to table->record[0] as usual + */ + void free_orphans() + { + DBUG_ASSERT(!table || !table->s->virtual_fields || !table->s->blob_fields || map.bitmap); + if (!map.bitmap) + return; + for (Field **ptr=table->vfield; *ptr; ptr++) + { + Field_blob *vb= (Field_blob*)(*ptr); + if (vb->flags & BLOB_FLAG && bitmap_fast_test_and_clear(&map, ptr - table->vfield)) + my_free(vb->get_ptr(table->s->rec_buff_length)); + } + DBUG_ASSERT(bitmap_is_clear_all(&map)); + } + + /** Restores blob's ownership over previously orphaned values */ + void adopt_orphans() + { + DBUG_ASSERT(!table || !table->s->virtual_fields || !table->s->blob_fields || map.bitmap); + if (!map.bitmap) + return; + for (Field **ptr=table->vfield; *ptr; ptr++) + { + Field_blob *vb= (Field_blob*)(*ptr); + if (vb->flags & BLOB_FLAG && bitmap_fast_test_and_clear(&map, ptr - table->vfield)) + vb->own_value_ptr(); + } + DBUG_ASSERT(bitmap_is_clear_all(&map)); + } +}; + + /* The COPY_INFO structure is used by INSERT/REPLACE code. The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY @@ -213,7 +306,7 @@ typedef struct st_user_var_events of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row was actually changed or not. */ -typedef struct st_copy_info { +struct COPY_INFO { ha_rows records; /**< Number of processed records */ ha_rows deleted; /**< Number of deleted records */ ha_rows updated; /**< Number of updated records */ @@ -229,7 +322,8 @@ typedef struct st_copy_info { /* for VIEW ... WITH CHECK OPTION */ TABLE_LIST *view; TABLE_LIST *table_list; /* Normal table */ -} COPY_INFO; + BLOB_VALUE_ORPHANAGE vblobs0, vblobs1; // vcol blobs of record[0] and record[1] +}; class Key_part_spec :public Sql_alloc { @@ -5317,6 +5411,7 @@ class multi_update :public select_result_interceptor TABLE_LIST *update_tables, *table_being_updated; TABLE **tmp_tables, *main_table, *table_to_update; TMP_TABLE_PARAM *tmp_table_param; + BLOB_VALUE_ORPHANAGE *vblobs; ha_rows updated, found; List *fields, *values; List **fields_for_table, **values_for_table; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 955a66958fe..b2a5617d743 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -812,6 +812,11 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, info.update_values= &update_values; info.view= (table_list->view ? table_list : 0); info.table_list= table_list; + if (duplic != DUP_ERROR) + { + info.vblobs0.init(table); + info.vblobs1.init(table); + } /* Count warnings for all inserts. @@ -1184,7 +1189,6 @@ values_loop_end: thd->lex->current_select->save_leaf_tables(thd); thd->lex->current_select->first_cond_optimization= 0; } - DBUG_RETURN(FALSE); abort: @@ -1698,9 +1702,12 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) } if (table->vfield) { + info->vblobs0.make_orphans(); table->move_fields(table->field, table->record[1], table->record[0]); table->update_virtual_fields(VCOL_UPDATE_INDEXED); + info->vblobs1.make_orphans(); table->move_fields(table->field, table->record[0], table->record[1]); + info->vblobs0.adopt_orphans(); } if (info->handle_duplicates == DUP_UPDATE) { @@ -1861,6 +1868,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) trg_error= 1; goto ok_or_after_trg_err; } + info->vblobs1.free_orphans(); /* Let us attempt do write_row() once more */ } } @@ -1911,6 +1919,7 @@ ok_or_after_trg_err: my_safe_afree(key,table->s->max_unique_length); if (!table->file->has_transactions()) thd->transaction.stmt.modified_non_trans_table= TRUE; + info->vblobs1.free_orphans(); DBUG_RETURN(trg_error); err: @@ -1922,6 +1931,7 @@ before_trg_err: if (key) my_safe_afree(key, table->s->max_unique_length); table->column_bitmaps_set(save_read_set, save_write_set); + info->vblobs1.free_orphans(); DBUG_RETURN(1); } @@ -3130,10 +3140,14 @@ static void free_delayed_insert_blobs(register TABLE *table) { for (Field **ptr=table->field ; *ptr ; ptr++) { - if ((*ptr)->flags & BLOB_FLAG) + Field_blob *f= (Field_blob*)(*ptr); + if (f->flags & BLOB_FLAG) { - my_free(((Field_blob *) (*ptr))->get_ptr()); - ((Field_blob *) (*ptr))->reset(); + if (f->vcol_info) + f->free(); + else + my_free(f->get_ptr()); + f->reset(); } } } @@ -3155,6 +3169,9 @@ bool Delayed_insert::handle_inserts(void) table->next_number_field=table->found_next_number_field; table->use_all_columns(); + info.vblobs0.init(table); + info.vblobs1.init(table); + THD_STAGE_INFO(&thd, stage_upgrading_lock); if (thr_upgrade_write_delay_lock(*thd.lock->locks, delayed_lock, thd.variables.lock_wait_timeout)) @@ -3261,6 +3278,8 @@ bool Delayed_insert::handle_inserts(void) if (info.handle_duplicates == DUP_UPDATE) table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE); thd.clear_error(); // reset error for binlog + if (table->vfield) + table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); if (write_record(&thd, table, &info)) { info.error_count++; // Ignore errors @@ -3367,6 +3386,8 @@ bool Delayed_insert::handle_inserts(void) DBUG_PRINT("error", ("HA_EXTRA_NO_CACHE failed after loop")); goto err; } + info.vblobs0.free(); + info.vblobs1.free(); query_cache_invalidate3(&thd, table, 1); mysql_mutex_lock(&mutex); DBUG_RETURN(0); @@ -3375,6 +3396,8 @@ bool Delayed_insert::handle_inserts(void) #ifndef DBUG_OFF max_rows= 0; // For DBUG output #endif + info.vblobs0.free(); + info.vblobs1.free(); /* Remove all not used rows */ mysql_mutex_lock(&mutex); while ((row=rows.get())) @@ -3622,6 +3645,11 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,s->default_values); // Get empty record table->reset_default_fields(); table->next_number_field=table->found_next_number_field; + if (info.handle_duplicates != DUP_ERROR) + { + info.vblobs0.init(table); + info.vblobs1.init(table); + } #ifdef HAVE_REPLICATION if (thd->rgi_slave && diff --git a/sql/sql_insert.h b/sql/sql_insert.h index cbfc1ea9dcd..5ec1846425d 100644 --- a/sql/sql_insert.h +++ b/sql/sql_insert.h @@ -21,7 +21,6 @@ /* Instead of including sql_lex.h we add this typedef here */ typedef List List_item; -typedef struct st_copy_info COPY_INFO; bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, List &fields, List_item *values, diff --git a/sql/sql_load.cc b/sql/sql_load.cc index e306097afbe..7ade7a64470 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -539,6 +539,12 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, !(thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))) ? (*escaped)[0] : INT_MAX; + if (handle_duplicates != DUP_ERROR) + { + info.vblobs0.init(table); + info.vblobs1.init(table); + } + READ_INFO read_info(thd, file, tot_length, ex->cs ? ex->cs : thd->variables.collation_database, *field_term,*ex->line_start, *ex->line_term, *enclosed, diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 05f7080609a..1f1af7f2660 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -273,6 +273,7 @@ int mysql_update(THD *thd, SORT_INFO *file_sort= 0; READ_RECORD info; SELECT_LEX *select_lex= &thd->lex->select_lex; + BLOB_VALUE_ORPHANAGE vblobs; ulonglong id; List all_fields; killed_state killed_status= NOT_KILLED; @@ -724,6 +725,8 @@ int mysql_update(THD *thd, table->reset_default_fields(); + vblobs.init(table); + /* We can use compare_record() to optimize away updates if the table handler is returning all columns OR if @@ -745,6 +748,9 @@ int mysql_update(THD *thd, explain->tracker.on_record_after_where(); store_record(table,record[1]); + + vblobs.make_orphans(); + if (fill_record_n_invoke_before_triggers(thd, table, fields, values, 0, TRG_EVENT_UPDATE)) break; /* purecov: inspected */ @@ -904,7 +910,9 @@ int mysql_update(THD *thd, error= 1; break; } + vblobs.free_orphans(); } + vblobs.free_orphans(); ANALYZE_STOP_TRACKING(&explain->command_tracker); table->auto_increment_field_not_null= FALSE; dup_key_found= 0; @@ -1752,6 +1760,8 @@ int multi_update::prepare(List ¬_used_values, table_count); values_for_table= (List_item **) thd->alloc(sizeof(List_item *) * table_count); + vblobs= (BLOB_VALUE_ORPHANAGE *)thd->calloc(sizeof(*vblobs) * table_count); + if (thd->is_fatal_error) DBUG_RETURN(1); for (i=0 ; i < table_count ; i++) @@ -1784,6 +1794,7 @@ int multi_update::prepare(List ¬_used_values, TABLE *table= ((Item_field*)(fields_for_table[i]->head()))->field->table; switch_to_nullable_trigger_fields(*fields_for_table[i], table); switch_to_nullable_trigger_fields(*values_for_table[i], table); + vblobs[i].init(table); } } copy_field= new Copy_field[max_fields]; @@ -2065,6 +2076,8 @@ multi_update::~multi_update() free_tmp_table(thd, tmp_tables[cnt]); tmp_table_param[cnt].cleanup(); } + vblobs[cnt].free_orphans(); + vblobs[cnt].free(); } } if (copy_field) @@ -2110,7 +2123,9 @@ int multi_update::send_data(List ¬_used_values) can_compare_record= records_are_comparable(table); table->status|= STATUS_UPDATED; + vblobs[offset].free_orphans(); store_record(table,record[1]); + vblobs[offset].make_orphans(); if (fill_record_n_invoke_before_triggers(thd, table, *fields_for_table[offset], *values_for_table[offset], 0, @@ -2327,6 +2342,7 @@ int multi_update::do_updates() goto err; } table->file->extra(HA_EXTRA_NO_CACHE); + empty_record(table); check_opt_it.rewind(); while(TABLE *tbl= check_opt_it++) @@ -2400,7 +2416,9 @@ int multi_update::do_updates() goto err2; table->status|= STATUS_UPDATED; + vblobs[offset].free_orphans(); store_record(table,record[1]); + vblobs[offset].make_orphans(); /* Copy data from temporary table to current table */ for (copy_field_ptr=copy_field; From 56c1f8da4bff7c627eb0807c7cb34bebd0d7b291 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 20:33:45 +0100 Subject: [PATCH 072/135] bugfix: table->get_fields_in_item_tree=true partitioning was setting subj as a partitioning-specific hack (GET_FIXED_FIELDS_FLAG field flag to detect partitioning fields) inside init_lex_with_single_table(). But vcols also use init_lex_with_single_table(), they run fix_fields() in open_table_from_share() before partitioning and this messes up partitioning GET_FIXED_FIELDS_FLAG logic. --- sql/sql_lex.cc | 1 - sql/sql_partition.cc | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 634b6d1a3b8..357032ed449 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -196,7 +196,6 @@ init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex) lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VCOL_EXPR; select_lex->cur_pos_in_select_list= UNDEF_POS; table->map= 1; //To ensure correct calculation of const item - table->get_fields_in_item_tree= TRUE; table_list->table= table; table_list->cacheable_table= false; return FALSE; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 09dbf9d76af..972ab3aa1f1 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -936,6 +936,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, if (init_lex_with_single_table(thd, table, &lex)) goto end; + table->get_fields_in_item_tree= true; func_expr->walk(&Item::change_context_processor, 0, &lex.select_lex.context); thd->where= "partition function"; From 94462aa9e6dbe71ac49192553e9fcd130d470c3a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 19 Nov 2016 16:23:33 +0100 Subject: [PATCH 073/135] bugfix: remove broken insert t values () optimization * wrong results for 5.7 and 10.1- vcols, and for indexed vcols * only helps in rare cases and only minimally --- sql/sql_base.cc | 9 ++------- sql/sql_insert.cc | 2 -- sql/sql_lex.cc | 1 - sql/sql_lex.h | 7 ------- sql/sql_load.cc | 2 -- sql/table.cc | 1 - sql/table.h | 1 - 7 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a3790043f9f..f1dd1781eba 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7762,7 +7762,6 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, List_iterator_fast f(fields),v(values); Item *value, *fld; Item_field *field; - TABLE *vcol_table= 0; bool save_abort_on_warning= thd->abort_on_warning; bool save_no_errors= thd->no_errors; DBUG_ENTER("fill_record"); @@ -7788,8 +7787,6 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, table_arg->auto_increment_field_not_null= FALSE; f.rewind(); } - else - vcol_table= thd->lex->unit.insert_table_with_stored_vcol; while ((fld= f++)) { @@ -7822,8 +7819,6 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, goto err; } rfield->set_explicit_default(value); - DBUG_ASSERT(vcol_table == 0 || vcol_table == table); - vcol_table= table; } if (!update && table_arg->default_field && @@ -7831,8 +7826,8 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, goto err; /* Update virtual fields */ thd->abort_on_warning= FALSE; - if (vcol_table && vcol_table->vfield && - vcol_table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) + if (table_arg->vfield && + table_arg->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= save_abort_on_warning; thd->no_errors= save_no_errors; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b2a5617d743..003fe4f5366 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1522,8 +1522,6 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, if (!table) table= table_list->table; - if (table->s->has_virtual_stored_fields) - thd->lex->unit.insert_table_with_stored_vcol= table; if (!select_insert) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 357032ed449..45a6bf59b99 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2074,7 +2074,6 @@ void st_select_lex_unit::init_query() item_list.empty(); describe= 0; found_rows_for_union= 0; - insert_table_with_stored_vcol= 0; derived= 0; is_view= false; with_clause= 0; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 4a554ae7fe2..63e0f7487ec 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -682,13 +682,6 @@ public: bool describe; /* union exec() called for EXPLAIN */ Procedure *last_procedure; /* Pointer to procedure, if such exists */ - /* - Insert table with stored virtual columns. - This is used only in those rare cases - when the list of inserted values is empty. - */ - TABLE *insert_table_with_stored_vcol; - bool columns_are_renamed; void init_query(); diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 7ade7a64470..509df96e89d 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -410,8 +410,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->prepare_triggers_for_insert_stmt_or_event(); table->mark_columns_needed_for_insert(); - if (table->s->has_virtual_stored_fields) - thd->lex->unit.insert_table_with_stored_vcol= table; uint tot_length=0; bool use_blobs= 0, use_vars= 0; diff --git a/sql/table.cc b/sql/table.cc index 7d14f961721..eb4efd5c38a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2231,7 +2231,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, DBUG_ASSERT(!reg_field->vcol_info); reg_field->vcol_info= vcol_info; share->virtual_fields++; - share->has_virtual_stored_fields=true; // For insert/load data break; case 2: // Default expression vcol_info->stored_in_db= 1; diff --git a/sql/table.h b/sql/table.h index 344655ebbbc..e49f47d5d08 100644 --- a/sql/table.h +++ b/sql/table.h @@ -685,7 +685,6 @@ struct TABLE_SHARE bool table_creation_was_logged; bool non_determinstic_insert; bool vcols_need_refixing; - bool has_virtual_stored_fields; bool check_set_initialized; bool has_update_default_function; ulong table_map_id; /* for row-based replication */ From a3614d33e8a0061b914ee6c660715dc52759ebdb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 10 Nov 2016 14:56:51 +0100 Subject: [PATCH 074/135] cleanup: FOREIGN_KEY_INFO instead of returning strings for CASCADE/RESTRICT from every storage engine, use enum values --- sql/sql_class.h | 2 -- sql/sql_lex.h | 4 +-- sql/sql_show.cc | 9 ++++--- sql/sql_yacc.yy | 20 +++++++-------- sql/table.cc | 14 ++++++++++ sql/table.h | 9 +++++-- storage/innobase/handler/ha_innodb.cc | 31 ++++++----------------- storage/innobase/handler/handler0alter.cc | 20 +++++++-------- storage/mroonga/ha_mroonga.cpp | 6 ++--- 9 files changed, 58 insertions(+), 57 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 84bcc8f4213..b5faec185a5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -446,8 +446,6 @@ class Foreign_key: public Key { public: enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL, FK_MATCH_PARTIAL, FK_MATCH_SIMPLE}; - enum fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_CASCADE, - FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_DEFAULT}; LEX_STRING ref_db; LEX_STRING ref_table; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 63e0f7487ec..8f5deb8e7bd 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2675,8 +2675,8 @@ public: uint profile_options; uint grant, grant_tot_col, which_columns; enum Foreign_key::fk_match_opt fk_match_option; - enum Foreign_key::fk_option fk_update_opt; - enum Foreign_key::fk_option fk_delete_opt; + enum_fk_option fk_update_opt; + enum_fk_option fk_delete_opt; uint slave_thd_opt, start_transaction_opt; int nest_level; /* diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 31ab0073866..273615e1489 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7365,6 +7365,7 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables, LEX_STRING *db_name, LEX_STRING *table_name) { CHARSET_INFO *cs= system_charset_info; + LEX_CSTRING *s; DBUG_ENTER("get_referential_constraints_record"); if (res) @@ -7409,10 +7410,10 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables, else table->field[5]->set_null(); table->field[6]->store(STRING_WITH_LEN("NONE"), cs); - table->field[7]->store(f_key_info->update_method->str, - f_key_info->update_method->length, cs); - table->field[8]->store(f_key_info->delete_method->str, - f_key_info->delete_method->length, cs); + s= fk_option_name(f_key_info->update_method); + table->field[7]->store(s->str, s->length, cs); + s= fk_option_name(f_key_info->delete_method); + table->field[8]->store(s->str, s->length, cs); if (schema_table_store_record(thd, table)) DBUG_RETURN(1); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 782aaef108c..6c6895434e4 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1001,7 +1001,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, const char *txt, enum enum_diag_condition_item_name diag_condition_item_name; enum Diagnostics_information::Which_area diag_area; enum Field::geometry_type geom_type; - enum Foreign_key::fk_option m_fk_option; + enum enum_fk_option m_fk_option; enum Item_udftype udf_type; enum Key::Keytype key_type; enum Statement_information_item::Name stmt_info_item_name; @@ -6876,19 +6876,19 @@ opt_on_update_delete: /* empty */ { LEX *lex= Lex; - lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; - lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF; + lex->fk_update_opt= FK_OPTION_UNDEF; + lex->fk_delete_opt= FK_OPTION_UNDEF; } | ON UPDATE_SYM delete_option { LEX *lex= Lex; lex->fk_update_opt= $3; - lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF; + lex->fk_delete_opt= FK_OPTION_UNDEF; } | ON DELETE_SYM delete_option { LEX *lex= Lex; - lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; + lex->fk_update_opt= FK_OPTION_UNDEF; lex->fk_delete_opt= $3; } | ON UPDATE_SYM delete_option @@ -6908,11 +6908,11 @@ opt_on_update_delete: ; delete_option: - RESTRICT { $$= Foreign_key::FK_OPTION_RESTRICT; } - | CASCADE { $$= Foreign_key::FK_OPTION_CASCADE; } - | SET NULL_SYM { $$= Foreign_key::FK_OPTION_SET_NULL; } - | NO_SYM ACTION { $$= Foreign_key::FK_OPTION_NO_ACTION; } - | SET DEFAULT { $$= Foreign_key::FK_OPTION_DEFAULT; } + RESTRICT { $$= FK_OPTION_RESTRICT; } + | CASCADE { $$= FK_OPTION_CASCADE; } + | SET NULL_SYM { $$= FK_OPTION_SET_NULL; } + | NO_SYM ACTION { $$= FK_OPTION_NO_ACTION; } + | SET DEFAULT { $$= FK_OPTION_SET_DEFAULT; } ; constraint_key_type: diff --git a/sql/table.cc b/sql/table.cc index eb4efd5c38a..6e54b6800e7 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8146,3 +8146,17 @@ Item* TABLE_LIST::build_pushable_cond_for_table(THD *thd, Item *cond) return cond->build_clone(thd, thd->mem_root); return 0; } + +LEX_CSTRING *fk_option_name(enum_fk_option opt) +{ + static LEX_CSTRING names[]= + { + { STRING_WITH_LEN("???") }, + { STRING_WITH_LEN("RESTRICT") }, + { STRING_WITH_LEN("CASCADE") }, + { STRING_WITH_LEN("SET NULL") }, + { STRING_WITH_LEN("NO ACTION") }, + { STRING_WITH_LEN("SET DEFAULT") } + }; + return names + opt; +} diff --git a/sql/table.h b/sql/table.h index e49f47d5d08..9ed65a3e434 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1478,6 +1478,9 @@ enum enum_schema_table_state PROCESSED_BY_JOIN_EXEC }; +enum enum_fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_CASCADE, + FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_SET_DEFAULT}; + typedef struct st_foreign_key_info { LEX_STRING *foreign_id; @@ -1485,13 +1488,15 @@ typedef struct st_foreign_key_info LEX_STRING *foreign_table; LEX_STRING *referenced_db; LEX_STRING *referenced_table; - LEX_STRING *update_method; - LEX_STRING *delete_method; + enum_fk_option update_method; + enum_fk_option delete_method; LEX_STRING *referenced_key_name; List foreign_fields; List referenced_fields; } FOREIGN_KEY_INFO; +LEX_CSTRING *fk_option_name(enum_fk_option opt); + #define MY_I_S_MAYBE_NULL 1 #define MY_I_S_UNSIGNED 2 diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 400c408c065..dab081c1028 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -16959,41 +16959,26 @@ get_foreign_key_info( } while (++i < foreign->n_fields); if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE) { - len = 7; - ptr = "CASCADE"; + f_key_info.delete_method = FK_OPTION_CASCADE; } else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) { - len = 8; - ptr = "SET NULL"; + f_key_info.delete_method = FK_OPTION_SET_NULL; } else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) { - len = 9; - ptr = "NO ACTION"; + f_key_info.delete_method = FK_OPTION_NO_ACTION; } else { - len = 8; - ptr = "RESTRICT"; + f_key_info.delete_method = FK_OPTION_RESTRICT; } - f_key_info.delete_method = thd_make_lex_string( - thd, f_key_info.delete_method, ptr, - static_cast(len), 1); if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE) { - len = 7; - ptr = "CASCADE"; + f_key_info.update_method = FK_OPTION_CASCADE; } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL) { - len = 8; - ptr = "SET NULL"; + f_key_info.update_method = FK_OPTION_SET_NULL; } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) { - len = 9; - ptr = "NO ACTION"; + f_key_info.update_method = FK_OPTION_NO_ACTION; } else { - len = 8; - ptr = "RESTRICT"; + f_key_info.update_method = FK_OPTION_RESTRICT; } - f_key_info.update_method = thd_make_lex_string( - thd, f_key_info.update_method, ptr, - static_cast(len), 1); - if (foreign->referenced_index && foreign->referenced_index->name != NULL) { referenced_key_name = thd_make_lex_string( diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 9bbe3a010a4..cfc01d3d18e 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1225,29 +1225,29 @@ innobase_set_foreign_key_option( switch (fk_key->delete_opt) { // JAN: TODO: ? MySQL 5.7 used enum fk_option directly from sql_lex.h - case Foreign_key::FK_OPTION_NO_ACTION: - case Foreign_key::FK_OPTION_RESTRICT: - case Foreign_key::FK_OPTION_DEFAULT: + case FK_OPTION_NO_ACTION: + case FK_OPTION_RESTRICT: + case FK_OPTION_SET_DEFAULT: foreign->type = DICT_FOREIGN_ON_DELETE_NO_ACTION; break; - case Foreign_key::FK_OPTION_CASCADE: + case FK_OPTION_CASCADE: foreign->type = DICT_FOREIGN_ON_DELETE_CASCADE; break; - case Foreign_key::FK_OPTION_SET_NULL: + case FK_OPTION_SET_NULL: foreign->type = DICT_FOREIGN_ON_DELETE_SET_NULL; break; } switch (fk_key->update_opt) { - case Foreign_key::FK_OPTION_NO_ACTION: - case Foreign_key::FK_OPTION_RESTRICT: - case Foreign_key::FK_OPTION_DEFAULT: + case FK_OPTION_NO_ACTION: + case FK_OPTION_RESTRICT: + case FK_OPTION_SET_DEFAULT: foreign->type |= DICT_FOREIGN_ON_UPDATE_NO_ACTION; break; - case Foreign_key::FK_OPTION_CASCADE: + case FK_OPTION_CASCADE: foreign->type |= DICT_FOREIGN_ON_UPDATE_CASCADE; break; - case Foreign_key::FK_OPTION_SET_NULL: + case FK_OPTION_SET_NULL: foreign->type |= DICT_FOREIGN_ON_UPDATE_SET_NULL; break; } diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index cd1f34dbaaf..cb902f976fa 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -16124,10 +16124,8 @@ int ha_mroonga::storage_get_foreign_key_list(THD *thd, ref_table_buff, ref_table_name_length, TRUE); - f_key_info.update_method = thd_make_lex_string(thd, NULL, "RESTRICT", - 8, TRUE); - f_key_info.delete_method = thd_make_lex_string(thd, NULL, "RESTRICT", - 8, TRUE); + f_key_info.update_method = FK_OPTION_RESTRICT; + f_key_info.delete_method = FK_OPTION_RESTRICT; f_key_info.referenced_key_name = thd_make_lex_string(thd, NULL, "PRIMARY", 7, TRUE); LEX_STRING *field_name = thd_make_lex_string(thd, NULL, column_name, From f136291098007d9b4b1a14419292892a2ea1178b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 10 Nov 2016 16:10:41 +0100 Subject: [PATCH 075/135] cleanup: sp_head::add_used_tables_to_table_list() Use TABLE::init_one_table(), don't duplicate it. Put additional initializations into TABLE::init_one_table_for_prelocking() --- sql/sp_head.cc | 33 ++++++--------------------------- sql/table.h | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 37e449cd666..c9c83d6ef22 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -4256,7 +4256,7 @@ sp_head::add_used_tables_to_table_list(THD *thd, if (stab->temp) continue; - if (!(tab_buff= (char *)thd->calloc(ALIGN_SIZE(sizeof(TABLE_LIST)) * + if (!(tab_buff= (char *)thd->alloc(ALIGN_SIZE(sizeof(TABLE_LIST)) * stab->lock_count)) || !(key_buff= (char*)thd->memdup(stab->qname.str, stab->qname.length))) @@ -4265,32 +4265,11 @@ sp_head::add_used_tables_to_table_list(THD *thd, for (uint j= 0; j < stab->lock_count; j++) { table= (TABLE_LIST *)tab_buff; - - table->db= key_buff; - table->db_length= stab->db_length; - table->table_name= table->db + table->db_length + 1; - table->table_name_length= stab->table_name_length; - table->alias= table->table_name + table->table_name_length + 1; - table->lock_type= stab->lock_type; - table->cacheable_table= 1; - table->prelocking_placeholder= 1; - table->belong_to_view= belong_to_view; - table->trg_event_map= stab->trg_event_map; - /* - Since we don't allow DDL on base tables in prelocked mode it - is safe to infer the type of metadata lock from the type of - table lock. - */ - table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name, - table->lock_type >= TL_WRITE_ALLOW_WRITE ? - MDL_SHARED_WRITE : MDL_SHARED_READ, - MDL_TRANSACTION); - - /* Everyting else should be zeroed */ - - **query_tables_last_ptr= table; - table->prev_global= *query_tables_last_ptr; - *query_tables_last_ptr= &table->next_global; + table->init_one_table_for_prelocking(key_buff, stab->db_length, + key_buff + stab->db_length + 1, stab->table_name_length, + key_buff + stab->db_length + stab->table_name_length + 2, + stab->lock_type, belong_to_view, stab->trg_event_map, + query_tables_last_ptr); tab_buff+= ALIGN_SIZE(sizeof(TABLE_LIST)); result= TRUE; diff --git a/sql/table.h b/sql/table.h index 9ed65a3e434..ae2a94d00ca 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1757,6 +1757,28 @@ struct TABLE_LIST MDL_TRANSACTION); } + inline void init_one_table_for_prelocking(const char *db_name_arg, + size_t db_length_arg, + const char *table_name_arg, + size_t table_name_length_arg, + const char *alias_arg, + enum thr_lock_type lock_type_arg, + TABLE_LIST *belong_to_view_arg, + uint8 trg_event_map_arg, + TABLE_LIST ***last_ptr) + { + init_one_table(db_name_arg, db_length_arg, table_name_arg, + table_name_length_arg, alias_arg, lock_type_arg); + cacheable_table= 1; + prelocking_placeholder= 1; + belong_to_view= belong_to_view_arg; + trg_event_map= trg_event_map_arg; + + **last_ptr= this; + prev_global= *last_ptr; + *last_ptr= &next_global; + } + /* List of tables local to a subquery (used by SQL_I_List). Considers views as leaves (unlike 'next_leaf' below). Created at parse time From 2614a0ab0ffd802b3b9e62795979e83b6a10fcb3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 20 Nov 2016 11:23:48 +0100 Subject: [PATCH 076/135] extend prelocking to FK-accessed tables --- mysql-test/suite/innodb/r/foreign-keys.result | 37 +++++++++++ mysql-test/suite/innodb/t/foreign-keys.test | 46 +++++++++++++ sql/sp_head.cc | 2 +- sql/sql_base.cc | 65 +++++++++++++++++++ sql/sql_class.cc | 3 +- sql/table.h | 6 +- 6 files changed, 155 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result index 53ddf618244..0cb53f52a6c 100644 --- a/mysql-test/suite/innodb/r/foreign-keys.result +++ b/mysql-test/suite/innodb/r/foreign-keys.result @@ -14,3 +14,40 @@ ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` (`people_id`); drop table title, department, people; +create table t1 (a int primary key, b int) engine=innodb; +create table t2 (c int primary key, d int, +foreign key (d) references t1 (a) on update cascade) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +insert t2 values (4,1),(5,2),(6,3); +flush table t2 with read lock; +connect con1,localhost,root; +delete from t1 where a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE) +update t1 set a=10 where a=1; +connection default; +unlock tables; +connection con1; +connection default; +lock table t2 write; +connection con1; +delete from t1 where a=2; +connection default; +unlock tables; +connection con1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE) +connection default; +unlock tables; +disconnect con1; +create user foo; +grant select,update on test.t1 to foo; +connect foo,localhost,foo; +update t1 set a=30 where a=3; +disconnect foo; +connection default; +select * from t2; +c d +5 2 +4 10 +6 30 +drop table t2, t1; +drop user foo; diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index 2d586e2d6be..e77e1e761c7 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -24,3 +24,49 @@ ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` (`people_id`); drop table title, department, people; + +# +# FK and prelocking: +# child table accesses (reads and writes) wait for locks. +# +create table t1 (a int primary key, b int) engine=innodb; +create table t2 (c int primary key, d int, + foreign key (d) references t1 (a) on update cascade) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +insert t2 values (4,1),(5,2),(6,3); +flush table t2 with read lock; # this takes MDL_SHARED_NO_WRITE +connect (con1,localhost,root); +--error ER_ROW_IS_REFERENCED_2 +delete from t1 where a=2; +send update t1 set a=10 where a=1; +connection default; +let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock'; +source include/wait_condition.inc; +unlock tables; +connection con1; +reap; +connection default; +lock table t2 write; # this takes MDL_SHARED_NO_READ_WRITE +connection con1; +send delete from t1 where a=2; +connection default; +let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock'; +source include/wait_condition.inc; +unlock tables; +connection con1; +--error ER_ROW_IS_REFERENCED_2 +reap; +connection default; +unlock tables; +disconnect con1; + +# but privileges should not be checked +create user foo; +grant select,update on test.t1 to foo; +connect(foo,localhost,foo); +update t1 set a=30 where a=3; +disconnect foo; +connection default; +select * from t2; +drop table t2, t1; +drop user foo; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c9c83d6ef22..0b9b503aef3 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -4268,7 +4268,7 @@ sp_head::add_used_tables_to_table_list(THD *thd, table->init_one_table_for_prelocking(key_buff, stab->db_length, key_buff + stab->db_length + 1, stab->table_name_length, key_buff + stab->db_length + stab->table_name_length + 2, - stab->lock_type, belong_to_view, stab->trg_event_map, + stab->lock_type, true, belong_to_view, stab->trg_event_map, query_tables_last_ptr); tab_buff+= ALIGN_SIZE(sizeof(TABLE_LIST)); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f1dd1781eba..024e9fa1cc7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4137,6 +4137,25 @@ handle_routine(THD *thd, Query_tables_list *prelocking_ctx, } +/* + @note this can be changed to use a hash, instead of scanning the linked + list, if the performance of this function will ever become an issue +*/ +static bool table_already_fk_prelocked(TABLE_LIST *tl, LEX_STRING *db, + LEX_STRING *table, thr_lock_type lock_type) +{ + for (; tl; tl= tl->next_global ) + { + if (tl->lock_type >= lock_type && + tl->prelocking_placeholder == TABLE_LIST::FK && + strcmp(tl->db, db->str) == 0 && + strcmp(tl->table_name, table->str) == 0) + return true; + } + return false; +} + + /** Defines how prelocking algorithm for DML statements should handle table list elements: @@ -4176,6 +4195,52 @@ handle_table(THD *thd, Query_tables_list *prelocking_ctx, add_tables_and_routines_for_triggers(thd, prelocking_ctx, table_list)) return TRUE; } + + if (table_list->table->file->referenced_by_foreign_key()) + { + List fk_list; + List_iterator fk_list_it(fk_list); + FOREIGN_KEY_INFO *fk; + Query_arena *arena, backup; + + arena= thd->activate_stmt_arena_if_needed(&backup); + + table_list->table->file->get_parent_foreign_key_list(thd, &fk_list); + if (thd->is_error()) + { + if (arena) + thd->restore_active_arena(arena, &backup); + return TRUE; + } + + *need_prelocking= TRUE; + + while ((fk= fk_list_it++)) + { + // FK_OPTION_RESTRICT and FK_OPTION_NO_ACTION only need read access + static bool can_write[]= { true, false, true, true, false, true }; + uint8 op= table_list->trg_event_map; + thr_lock_type lock_type; + + if ((op & (1 << TRG_EVENT_DELETE) && can_write[fk->delete_method]) + || (op & (1 << TRG_EVENT_UPDATE) && can_write[fk->update_method])) + lock_type= TL_WRITE_ALLOW_WRITE; + else + lock_type= TL_READ; + + if (table_already_fk_prelocked(table_list, fk->foreign_db, + fk->foreign_table, lock_type)) + continue; + + TABLE_LIST *tl= (TABLE_LIST *) thd->alloc(sizeof(TABLE_LIST)); + tl->init_one_table_for_prelocking(fk->foreign_db->str, fk->foreign_db->length, + fk->foreign_table->str, fk->foreign_table->length, + NULL, lock_type, false, table_list->belong_to_view, + op, &prelocking_ctx->query_tables_last); + } + if (arena) + thd->restore_active_arena(arena, &backup); + } } return FALSE; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 88534e78c10..ac337afb65d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5653,7 +5653,8 @@ int THD::decide_logging_format(TABLE_LIST *tables) replicated_tables_count++; - if (table->lock_type <= TL_READ_NO_INSERT) + if (table->lock_type <= TL_READ_NO_INSERT && + table->prelocking_placeholder != TABLE_LIST::FK) has_read_tables= true; else if (table->table->found_next_number_field && (table->lock_type >= TL_WRITE_ALLOW_WRITE)) diff --git a/sql/table.h b/sql/table.h index ae2a94d00ca..4ecc8f89b9e 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1763,6 +1763,7 @@ struct TABLE_LIST size_t table_name_length_arg, const char *alias_arg, enum thr_lock_type lock_type_arg, + bool routine, TABLE_LIST *belong_to_view_arg, uint8 trg_event_map_arg, TABLE_LIST ***last_ptr) @@ -1770,7 +1771,8 @@ struct TABLE_LIST init_one_table(db_name_arg, db_length_arg, table_name_arg, table_name_length_arg, alias_arg, lock_type_arg); cacheable_table= 1; - prelocking_placeholder= 1; + prelocking_placeholder= routine ? ROUTINE : FK; + open_type= routine ? OT_TEMPORARY_OR_BASE : OT_BASE_ONLY; belong_to_view= belong_to_view_arg; trg_event_map= trg_event_map_arg; @@ -2059,7 +2061,7 @@ struct TABLE_LIST This TABLE_LIST object is just placeholder for prelocking, it will be used for implicit LOCK TABLES only and won't be used in real statement. */ - bool prelocking_placeholder; + enum { USER, ROUTINE, FK } prelocking_placeholder; /** Indicates that if TABLE_LIST object corresponds to the table/view which requires special handling. From 0d6a773ae1be485464b8b50508da75838d40a908 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 13:37:53 +0100 Subject: [PATCH 077/135] cleanup: unused handler::check_if_supported_virtual_columns() --- sql/handler.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index 8cc1f3973d9..112b9212e93 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3863,18 +3863,6 @@ public: } LEX_STRING *engine_name() { return hton_name(ht); } - - /* - @brief - Check whether the engine supports virtual columns - - @retval - FALSE if the engine does not support virtual columns - @retval - TRUE if the engine supports virtual columns - */ - - virtual bool check_if_supported_virtual_columns(void) { return FALSE;} TABLE* get_table() { return table; } TABLE_SHARE* get_table_share() { return table_share; } From a6f05b9292516020f9bb31c46bec0ca1e11702be Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 13:38:46 +0100 Subject: [PATCH 078/135] cleanup: redundant casts in THD::dec_thread_count and THD::inc_thread_count --- sql/sql_class.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index b5faec185a5..9beee19eae0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2083,14 +2083,14 @@ private: void dec_thread_count(void) { DBUG_ASSERT(thread_count > 0); - thread_safe_decrement32(const_cast(&thread_count)); + thread_safe_decrement32(&thread_count); signal_thd_deleted(); } void inc_thread_count(void) { - thread_safe_increment32(const_cast(&thread_count)); + thread_safe_increment32(&thread_count); } public: From b66976abb4ce16db99361262e97ac0db60385e35 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 14:10:53 +0100 Subject: [PATCH 079/135] cleanup: InnoDB, various minor issues * fix "unused pending_checkpoint_mutex_key" compiler warning * clarify/simplify get_field_offset() * typos, comments * unused (forgotten) declaration of create_options_are_invalid() * fix my_error(ER_WRONG_KEY_COLUMN) calls * crash in row_upd_sec_index_entry() * double if (ret != 0) * don't duplucate PSI_INSTRUMENT_ME lines * useless break; after return(); * remove unused xtradb-only "cursor_read_view" stuff * code formatting * simplify dropped column detection * redundant assignment --- .../suite/sys_vars/r/sysvars_innodb.result | 2 +- storage/innobase/handler/ha_innodb.cc | 154 +++--------------- storage/innobase/handler/ha_innodb.h | 16 -- storage/innobase/handler/handler0alter.cc | 40 ++--- storage/innobase/handler/i_s.cc | 6 +- storage/innobase/row/row0merge.cc | 5 - storage/innobase/row/row0upd.cc | 3 +- storage/innobase/srv/srv0srv.cc | 4 +- 8 files changed, 45 insertions(+), 185 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index c298c98ac99..51878fb1748 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -488,7 +488,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE crc32 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM -VARIABLE_COMMENT The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by InnoDB versions older than 5.6.3 +VARIABLE_COMMENT The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by MariaDB versions older than 10.0.4 NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index dab081c1028..598047e31d6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -476,6 +476,7 @@ static mysql_pfs_key_t pending_checkpoint_mutex_key; static PSI_mutex_info all_pthread_mutexes[] = { PSI_KEY(commit_cond_mutex), + PSI_KEY(pending_checkpoint_mutex), PSI_KEY(innobase_share_mutex) }; @@ -871,13 +872,17 @@ innobase_map_isolation_level( /** Gets field offset for a field in a table. @param[in] table MySQL table object -@param[in] field MySQL field object +@param[in] field MySQL field object (from table->field array) @return offset */ static inline uint get_field_offset( const TABLE* table, - const Field* field); + const Field* field) +{ + return field->offset(table->record[0]); +} + /*************************************************************//** Check for a valid value of innobase_compression_algorithm. @@ -3980,12 +3985,6 @@ innobase_init( innobase_hton->commit_by_xid = innobase_commit_by_xid; innobase_hton->rollback_by_xid = innobase_rollback_by_xid; innobase_hton->commit_checkpoint_request=innobase_checkpoint_request; - -#ifdef INNOBASE_CURSOR_VIEW - innobase_hton->create_cursor_read_view = innobase_create_cursor_view; - innobase_hton->set_cursor_read_view = innobase_set_cursor_view; - innobase_hton->close_cursor_read_view = innobase_close_cursor_view; -#endif innobase_hton->create = innobase_create_handler; #ifdef MYSQL_TABLESPACES @@ -5686,7 +5685,7 @@ ha_innobase::table_flags() const all InnoDB features such as GEOMETRY, FULLTEXT etc. */ /* JAN: TODO: MySQL 5.7 flags &= ~(HA_INNOPART_DISABLED_TABLE_FLAGS); - + } */ } @@ -6126,8 +6125,6 @@ innobase_match_index_columns( if (innodb_idx_fld >= innodb_idx_fld_end) { DBUG_RETURN(FALSE); } - - mtype = innodb_idx_fld->col->mtype; } /* MariaDB-5.5 compatibility */ @@ -7311,19 +7308,6 @@ ha_innobase::close() /* The following accessor functions should really be inside MySQL code! */ -/** Gets field offset for a field in a table. -@param[in] table MySQL table object -@param[in] field MySQL field object -@return offset */ -static inline -uint -get_field_offset( - const TABLE* table, - const Field* field) -{ - return(static_cast((field->ptr - table->record[0]))); -} - #ifdef WITH_WSREP UNIV_INTERN int @@ -9649,7 +9633,7 @@ wsrep_calc_row_hash( } #endif /* WITH_WSREP */ -/* +/** Updates a row given as a parameter to a new value. Note that we are given whole rows, not just the fields which are updated: this incurs some overhead for CPU when we check which fields are actually updated. @@ -9694,10 +9678,9 @@ ha_innobase::update_row( + MAX_REF_PARTS * 3; m_upd_buf = reinterpret_cast( - my_malloc( - m_upd_buf_size, + my_malloc(//PSI_INSTRUMENT_ME, + m_upd_buf_size, MYF(MY_WME))); - /* JAN: TODO: MySQL 5.7: PSI_INSTRUMENT_ME,...*/ if (m_upd_buf == NULL) { m_upd_buf_size = 0; @@ -10942,10 +10925,7 @@ ha_innobase::ft_init_ext( /* Allocate FTS handler, and instantiate it before return */ fts_hdl = reinterpret_cast( - my_malloc(sizeof(NEW_FT_INFO), MYF(0))); - /* JAN: TODO: MySQL 5.7 PSI - my_malloc(PSI_INSTRUMENT_ME, sizeof(NEW_FT_INFO), MYF(0))); - */ + my_malloc(/*PSI_INSTRUMENT_ME,*/ sizeof(NEW_FT_INFO), MYF(0))); fts_hdl->please = const_cast<_ft_vft*>(&ft_vft_result); fts_hdl->could_you = const_cast<_ft_vft_ext*>(&ft_vft_ext_result); @@ -12356,13 +12336,7 @@ create_index( ind_type |= DICT_UNIQUE; } - /* JAN: TODO: MySQL 5.7 PSI - field_lengths = (ulint*) my_malloc(PSI_INSTRUMENT_ME, - key->user_defined_key_parts * sizeof * - field_lengths, MYF(MY_FAE)); - */ - - field_lengths = (ulint*) my_malloc( + field_lengths = (ulint*) my_malloc(//PSI_INSTRUMENT_ME, key->user_defined_key_parts * sizeof * field_lengths, MYF(MY_FAE)); @@ -12589,8 +12563,7 @@ validate_tablespace_name( err = HA_WRONG_CREATE_OPTION; } } else { - my_printf_error( - ER_WRONG_TABLESPACE_NAME, + my_printf_error(ER_WRONG_TABLESPACE_NAME, "InnoDB: A general tablespace" " name cannot start with `%s`.", MYF(0), reserved_space_name_prefix); @@ -13434,8 +13407,6 @@ index_bad: } } - //rec_format_t row_format = m_form->s->row_type; - if (m_create_info->key_block_size > 0) { /* The requested compressed page size (key_block_size) is given in kilobytes. If it is a valid number, store @@ -15114,9 +15085,7 @@ innobase_drop_database( } ptr++; - namebuf = (char*) my_malloc((uint) len + 2, MYF(0)); - // JAN: TODO: MySQL 5.7 - //namebuf = (char*) my_malloc(PSI_INSTRUMENT_ME, (uint) len + 2, MYF(0)); + namebuf = (char*) my_malloc(/*PSI_INSTRUMENT_ME,*/ (uint) len + 2, MYF(0)); memcpy(namebuf, ptr, len); namebuf[len] = '/'; @@ -15366,8 +15335,9 @@ For other error codes, the server will fall back to counting records. */ #ifdef MYSQL_57_SELECT_COUNT_OPTIMIZATION int -ha_innobase::records(ha_rows* num_rows) -/*===================================*/ +ha_innobase::records( +/*==================*/ + ha_rows* num_rows) /*!< out: number of rows */ { DBUG_ENTER("ha_innobase::records()"); @@ -15439,16 +15409,15 @@ ha_innobase::records(ha_rows* num_rows) case DB_LOCK_WAIT_TIMEOUT: *num_rows = HA_POS_ERROR; DBUG_RETURN(convert_error_code_to_mysql(ret, 0, m_user_thd)); - break; case DB_INTERRUPTED: *num_rows = HA_POS_ERROR; DBUG_RETURN(HA_ERR_QUERY_INTERRUPTED); - break; default: /* No other error besides the three below is returned from row_scan_index_for_mysql(). Make a debug catch. */ *num_rows = HA_POS_ERROR; ut_ad(0); + DBUG_RETURN(-1); } m_prebuilt->trx->op_info = ""; @@ -17894,12 +17863,8 @@ innodb_show_status( /* allocate buffer for the string, and read the contents of the temporary file */ - /* JAN: TODO: MySQL 5.7 PSI */ - if (!(str = (char*) my_malloc( + if (!(str = (char*) my_malloc(//PSI_INSTRUMENT_ME, usable_len + 1, MYF(0)))) { - /* if (!(str = (char*) my_malloc(PSI_INSTRUMENT_ME, - usable_len + 1, MYF(0)))) { - */ mutex_exit(&srv_monitor_file_mutex); DBUG_RETURN(1); } @@ -18334,15 +18299,9 @@ get_share( grows too big */ share = reinterpret_cast( - my_malloc( + my_malloc(//PSI_INSTRUMENT_ME, sizeof(*share) + length + 1, MYF(MY_FAE | MY_ZEROFILL))); - /* JAN: TODO: MySQL 5.7 PSI - share = reinterpret_cast( - my_malloc(PSI_INSTRUMENT_ME, - sizeof(*share) + length + 1, - MYF(MY_FAE | MY_ZEROFILL))); - */ share->table_name = reinterpret_cast( memcpy(share + 1, table_name, length + 1)); @@ -19320,64 +19279,6 @@ innobase_rollback_by_xid( } } -#ifdef INNOBASE_CURSOR_VIEW - -/*******************************************************************//** -Create a consistent view for a cursor based on current transaction -which is created if the corresponding MySQL thread still lacks one. -This consistent view is then used inside of MySQL when accessing records -using a cursor. -@return pointer to cursor view or NULL */ -static -void* -innobase_create_cursor_view( -/*========================*/ - handlerton* hton, /*!< in: innobase hton */ - THD* thd) /*!< in: user thread handle */ -{ - DBUG_ASSERT(hton == innodb_hton_ptr); - - return(read_cursor_view_create_for_mysql(check_trx_exists(thd))); -} - -/*******************************************************************//** -Close the given consistent cursor view of a transaction and restore -global read view to a transaction read view. Transaction is created if the -corresponding MySQL thread still lacks one. */ -static -void -innobase_close_cursor_view( -/*=======================*/ - handlerton* hton, /*!< in: innobase hton */ - THD* thd, /*!< in: user thread handle */ - void* curview)/*!< in: Consistent read view to be closed */ -{ - DBUG_ASSERT(hton == innodb_hton_ptr); - - read_cursor_view_close_for_mysql(check_trx_exists(thd), - (cursor_view_t*) curview); -} - -/*******************************************************************//** -Set the given consistent cursor view to a transaction which is created -if the corresponding MySQL thread still lacks one. If the given -consistent cursor view is NULL global read view of a transaction is -restored to a transaction read view. */ -static -void -innobase_set_cursor_view( -/*=====================*/ - handlerton* hton, /*!< in: innobase hton */ - THD* thd, /*!< in: user thread handle */ - void* curview)/*!< in: Consistent cursor view to be set */ -{ - DBUG_ASSERT(hton == innodb_hton_ptr); - - read_cursor_set_for_mysql(check_trx_exists(thd), - (cursor_view_t*) curview); -} -#endif /* INNOBASE_CURSOR_VIEW */ - bool ha_innobase::check_if_incompatible_data( /*====================================*/ @@ -20531,12 +20432,8 @@ innodb_monitor_validate( by InnoDB, so we can access it in another callback function innodb_monitor_update() and free it appropriately */ if (name) { - /* JAN: TODO: MySQL 5.7 PSI - monitor_name = my_strdup(PSI_INSTRUMENT_ME, + monitor_name = my_strdup(//PSI_INSTRUMENT_ME, name, MYF(0)); - */ - monitor_name = my_strdup( - name, MYF(0)); } else { return(1); } @@ -21860,7 +21757,7 @@ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, " write a constant magic number, do not allow values other than that" " magic number when reading;" " Files updated when this option is set to crc32 or strict_crc32 will" - " not be readable by InnoDB versions older than 5.6.3", + " not be readable by MariaDB versions older than 10.0.4", NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, &innodb_checksum_algorithm_typelib); @@ -23789,11 +23686,6 @@ innobase_get_computed_value( return(NULL); } - /* we just want to store the data in passed in MySQL record */ - if (ret != 0) { - return(NULL); - } - if (vctempl->mysql_null_bit_mask && (mysql_rec[vctempl->mysql_null_byte_offset] & vctempl->mysql_null_bit_mask)) { diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 1c71735d716..a78925d94e1 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -1157,19 +1157,3 @@ ib_push_frm_error( ulint n_keys, /*!< in: InnoDB #keys */ bool push_warning); /*!< in: print warning ? */ -/*****************************************************************//** -Validates the create options. We may build on this function -in future. For now, it checks two specifiers: -KEY_BLOCK_SIZE and ROW_FORMAT -If innodb_strict_mode is not set then this function is a no-op -@return NULL if valid, string if not. */ -UNIV_INTERN -const char* -create_options_are_invalid( -/*=======================*/ - THD* thd, /*!< in: connection thread. */ - TABLE* form, /*!< in: information on table - columns and indexes */ - HA_CREATE_INFO* create_info, /*!< in: create info. */ - bool use_tablespace) /*!< in: srv_file_per_table */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index cfc01d3d18e..9b4128de426 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -520,19 +520,7 @@ check_v_col_in_order( ut_ad(innobase_is_v_fld(field)); - /* Check if this column is in drop list */ - List_iterator_fast cf_it( - ha_alter_info->alter_info->drop_list); - - while ((drop = (cf_it++)) != NULL) { - if (my_strcasecmp(system_charset_info, - field->field_name, drop->name) == 0) { - dropped = true; - break; - } - } - - if (dropped) { + if (field->flags & FIELD_IS_DROPPED) { continue; } @@ -863,7 +851,7 @@ ha_innobase::check_if_supported_inplace_alter( new_key++) { #ifdef MYSQL_VIRTUAL_COLUMNS - /* Do not support adding/droping a vritual column, while + /* Do not support adding/droping a virtual column, while there is a table rebuild caused by adding a new FTS_DOC_ID */ if ((new_key->flags & HA_FULLTEXT) && add_drop_v_cols && !DICT_TF2_FLAG_IS_SET(m_prebuilt->table, @@ -880,7 +868,8 @@ ha_innobase::check_if_supported_inplace_alter( key_part++) { const Create_field* new_field; - DBUG_ASSERT(key_part->fieldnr < altered_table->s->fields); + DBUG_ASSERT(key_part->fieldnr + < altered_table->s->fields); cf_it.rewind(); for (uint fieldnr = 0; (new_field = cf_it++); @@ -1853,7 +1842,9 @@ null_field: } /*************************************************************//** -Copies an InnoDB index entry to table->record[0]. */ +Copies an InnoDB index entry to table->record[0]. +This is used in preparation for print_keydup_error() from +inline add index */ void innobase_fields_to_mysql( /*=====================*/ @@ -1913,7 +1904,9 @@ innobase_fields_to_mysql( } /*************************************************************//** -Copies an InnoDB row to table->record[0]. */ +Copies an InnoDB row to table->record[0]. +This is used in preparation for print_keydup_error() from +row_log_table_apply() */ void innobase_row_to_mysql( /*==================*/ @@ -3775,7 +3768,7 @@ prepare_inplace_add_virtual( charset_no += MAX_CHAR_COLL_NUM;); if (charset_no > MAX_CHAR_COLL_NUM) { - my_error(ER_WRONG_KEY_COLUMN, MYF(0), + my_error(ER_WRONG_KEY_COLUMN, MYF(0), "InnoDB", field->field_name); return(true); } @@ -3919,7 +3912,7 @@ prepare_inplace_drop_virtual( charset_no += MAX_CHAR_COLL_NUM;); if (charset_no > MAX_CHAR_COLL_NUM) { - my_error(ER_WRONG_KEY_COLUMN, MYF(0), + my_error(ER_WRONG_KEY_COLUMN, MYF(0), "InnoDB", field->field_name); return(true); } @@ -4548,10 +4541,8 @@ prepare_inplace_alter_table_dict( } } - /* - There should be no order change for virtual columns coming in - here - */ + /* There should be no order change for virtual columns coming in + here */ ut_ad(check_v_col_in_order(old_table, altered_table, ha_alter_info)); #endif /* MYSQL_VIRTUAL_COLUMNS */ @@ -4792,7 +4783,7 @@ prepare_inplace_alter_table_dict( if (charset_no > MAX_CHAR_COLL_NUM) { dict_mem_table_free( ctx->new_table); - my_error(ER_WRONG_KEY_COLUMN, MYF(0), + my_error(ER_WRONG_KEY_COLUMN, MYF(0), "InnoDB", field->field_name); goto new_clustered_failed; } @@ -5578,7 +5569,6 @@ rename_index_in_cache( DBUG_VOID_RETURN; } -# /** Rename all indexes in data dictionary cache of a given table that are specified in ha_alter_info. diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 37bc9c1f15d..4a13faa480f 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -9406,11 +9406,8 @@ i_s_innodb_mutexes_fill_table( TABLE_LIST* tables, /*!< in/out: tables to fill */ Item* ) /*!< in: condition (not used) */ { - ib_mutex_t* mutex; rw_lock_t* lock; - ulint block_mutex_oswait_count = 0; ulint block_lock_oswait_count = 0; - ib_mutex_t* block_mutex = NULL; rw_lock_t* block_lock = NULL; Field** fields = tables->table->field; @@ -9425,6 +9422,9 @@ i_s_innodb_mutexes_fill_table( // mutex_enter(&mutex_list_mutex); #ifdef JAN_TODO_FIXME + ib_mutex_t* mutex; + ulint block_mutex_oswait_count = 0; + ib_mutex_t* block_mutex = NULL; for (mutex = UT_LIST_GET_FIRST(os_mutex_list); mutex != NULL; mutex = UT_LIST_GET_NEXT(list, mutex)) { if (mutex->count_os_wait == 0) { diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 0b7c1c36231..e666cf5ccb2 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -30,10 +30,6 @@ Completed by Sunny Bains and Marko Makela #include "ha_prototypes.h" -#include - -#include "ha_prototypes.h" - #include "row0merge.h" #include "row0ext.h" #include "row0log.h" @@ -51,7 +47,6 @@ Completed by Sunny Bains and Marko Makela #include "fsp0sysspace.h" #include "ut0new.h" #include "ut0stage.h" -#include "math.h" /* log() */ #include "fil0crypt.h" float my_log2f(float n) diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index d4b8decaea7..759bfb57428 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -2394,7 +2394,8 @@ row_upd_sec_index_entry( << " of table " << index->table->name << " was not found on update: " << *entry << " at: " << rec_index_print(rec, index); - srv_mbr_print((unsigned char*)entry->fields[0].data); + if (entry->fields[0].data) + srv_mbr_print((unsigned char*)entry->fields[0].data); #ifdef UNIV_DEBUG mtr_commit(&mtr); mtr_start(&mtr); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 38f9744e2c6..d2f13ad9b37 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -45,8 +45,6 @@ Created 10/8/1995 Heikki Tuuri // // #include "mysql/psi/mysql_stage.h" // #include "mysql/psi/psi.h" -// JAN: TODO: MySQL 5.7 missing header -//#include "sql_thd_internal_api.h" #include "ha_prototypes.h" @@ -2757,7 +2755,7 @@ DECLARE_THREAD(srv_worker_thread)( srv_sys_mutex_exit(); /* We need to ensure that the worker threads exit after the - purge coordinator thread. Otherwise the purge coordinaor can + purge coordinator thread. Otherwise the purge coordinator can end up waiting forever in trx_purge_wait_for_workers_to_complete() */ do { From 528dd5f20c779382bec7a015bc9e092b1a7187dc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 14:43:30 +0100 Subject: [PATCH 080/135] cleanup: InnoDB, remove index_field_t::col_name * remnant of 5.6, does not exist in 5.7. bad merge? * also remove dict_table_get_col_name_for_mysql(), it was only used when index_field_t::col_name was not NULL --- storage/innobase/dict/dict0dict.cc | 35 ----------------------- storage/innobase/handler/handler0alter.cc | 1 - storage/innobase/include/dict0dict.h | 12 -------- storage/innobase/include/row0merge.h | 1 - storage/innobase/row/row0merge.cc | 4 +-- 5 files changed, 1 insertion(+), 52 deletions(-) diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index ddb96bf252c..4f77d2168f4 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -654,41 +654,6 @@ dict_table_get_col_name( return(s); } -/**********************************************************************//** -Returns a column's name. -@return column name. NOTE: not guaranteed to stay valid if table is -modified in any way (columns added, etc.). */ -UNIV_INTERN -const char* -dict_table_get_col_name_for_mysql( -/*==============================*/ - const dict_table_t* table, /*!< in: table */ - const char* col_name)/*! in: MySQL table column name */ -{ - ulint i; - const char* s; - - ut_ad(table); - ut_ad(col_name); - ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - - s = table->col_names; - if (s) { - /* If we have many virtual columns MySQL key_part->fieldnr - could be larger than number of columns in InnoDB table - when creating new indexes. */ - for (i = 0; i < table->n_def; i++) { - - if (!innobase_strcasecmp(s, col_name)) { - break; /* Found */ - } - s += strlen(s) + 1; - } - } - - return(s); -} - /** Returns a virtual column's name. @param[in] table target table @param[in] col_nr virtual column number (nth virtual column) diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 9b4128de426..23bedab03f1 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -2183,7 +2183,6 @@ innobase_create_index_field_def( #else index_field->is_v_col = false; index_field->col_no = key_part->fieldnr - num_m_v; - index_field->col_name = altered_table ? field->field_name : fields[key_part->fieldnr]->field_name; #endif /* MYSQL_VIRTUAL_COLUMNS */ if (DATA_LARGE_MTYPE(col_type) diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index e7eb558d6fd..6ac696e75eb 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -613,18 +613,6 @@ dict_table_get_col_name( ulint col_nr) /*!< in: column number */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -/**********************************************************************//** -Returns a column's name. -@return column name. NOTE: not guaranteed to stay valid if table is -modified in any way (columns added, etc.). */ -UNIV_INTERN -const char* -dict_table_get_col_name_for_mysql( -/*==============================*/ - const dict_table_t* table, /*!< in: table */ - const char* col_name)/*!< in: MySQL table column name */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); - /** Returns a virtual column's name. @param[in] table table object @param[in] col_nr virtual column number(nth virtual column) diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index f3b5860910c..8cb9eb7976e 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -114,7 +114,6 @@ struct index_field_t { ulint col_no; /*!< column offset */ ulint prefix_len; /*!< column prefix length, or 0 if indexing the whole column */ - const char* col_name; /*!< column name or NULL */ bool is_v_col; /*!< whether this is a virtual column */ }; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index e666cf5ccb2..d302b493f21 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4509,9 +4509,7 @@ row_merge_create_index( if (col_names && col_names[i]) { name = col_names[i]; } else { - name = ifield->col_name ? - dict_table_get_col_name_for_mysql(table, ifield->col_name) : - dict_table_get_col_name(table, ifield->col_no); + name = dict_table_get_col_name(table, ifield->col_no); } } From 7fca91f2b454db6e33d964a7484237793699f77d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Nov 2016 15:26:34 +0100 Subject: [PATCH 081/135] cleanup: InnoDB, dict_create_add_foreign_to_dictionary() remove 'table' argument, remnant of 5.6, does not exist in 5.7 --- storage/innobase/dict/dict0crea.cc | 9 +++------ storage/innobase/handler/handler0alter.cc | 2 +- storage/innobase/include/dict0crea.h | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index a34daede626..2d891854c03 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -2189,7 +2189,6 @@ Add a foreign key definition to the data dictionary tables. dberr_t dict_create_add_foreign_to_dictionary( /*==================================*/ - dict_table_t* table, /*!< in: table */ const char* name, /*!< in: table name */ const dict_foreign_t* foreign,/*!< in: foreign key */ trx_t* trx) /*!< in/out: dictionary transaction */ @@ -2231,8 +2230,7 @@ dict_create_add_foreign_to_dictionary( char* fk_def; innobase_convert_name(tablename, MAX_TABLE_NAME_LEN, - table->name.m_name, strlen(table->name.m_name), - trx->mysql_thd); + name, strlen(name), trx->mysql_thd); innobase_convert_name(buf, MAX_TABLE_NAME_LEN, foreign->id, strlen(foreign->id), trx->mysql_thd); @@ -2263,8 +2261,7 @@ dict_create_add_foreign_to_dictionary( char* fk_def; innobase_convert_name(tablename, MAX_TABLE_NAME_LEN, - table->name.m_name, strlen(table->name.m_name), - trx->mysql_thd); + name, strlen(name), trx->mysql_thd); innobase_convert_name(buf, MAX_TABLE_NAME_LEN, foreign->id, strlen(foreign->id), trx->mysql_thd); fk_def = dict_foreign_def_get((dict_foreign_t*)foreign, trx); @@ -2513,7 +2510,7 @@ dict_create_add_foreigns_to_dictionary( ut_ad(foreign->id != NULL); error = dict_create_add_foreign_to_dictionary( - (dict_table_t*)table, table->name.m_name, foreign, trx); + table->name.m_name, foreign, trx); if (error != DB_SUCCESS) { diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 23bedab03f1..3da543d246e 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -7697,7 +7697,7 @@ innobase_update_foreign_try( names, while the columns in ctx->old_table have not been renamed yet. */ error = dict_create_add_foreign_to_dictionary( - (dict_table_t*)ctx->old_table,ctx->old_table->name.m_name, fk, trx); + ctx->old_table->name.m_name, fk, trx); DBUG_EXECUTE_IF( "innodb_test_cannot_add_fk_system", diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index f9ef39fa8c6..51cef91d318 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -276,7 +276,6 @@ Add a foreign key definition to the data dictionary tables. dberr_t dict_create_add_foreign_to_dictionary( /*==================================*/ - dict_table_t* table, /*!< in: table */ const char* name, /*!< in: table name */ const dict_foreign_t* foreign,/*!< in: foreign key */ trx_t* trx) /*!< in/out: dictionary transaction */ From 1cae1af6f9286ca6695206ce20c63bb639c60310 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Nov 2016 22:35:02 +0100 Subject: [PATCH 082/135] MDEV-5800 InnoDB support for indexed vcols * remove old 5.2+ InnoDB support for virtual columns * enable corresponding parts of the innodb-5.7 sources * copy corresponding test cases from 5.7 * copy detailed Alter_inplace_info::HA_ALTER_FLAGS flags from 5.7 - and more detailed detection of changes in fill_alter_inplace_info() * more "innodb compatibility hooks" in sql_class.cc to - create/destroy/reset a THD (used by background purge threads) - find a prelocked table by name - open a table (from a background purge thread) * different from 5.7: - new service thread "thd_destructor_proxy" to make sure all THDs are destroyed at the correct point in time during the server shutdown - proper opening/closing of tables for vcol evaluations in + FK checks (use already opened prelocked tables) + purge threads (open the table, MDLock it, add it to tdc, close when not needed) - cache open tables in vc_templ - avoid unnecessary allocations, reuse table->record[0] and table->s->default_values - not needed in 5.7, because it overcalculates: + tell the server to calculate vcols for an on-going inline ADD INDEX + calculate vcols for correct error messages * update other engines (mroonga/tokudb) accordingly --- mysql-test/include/have_innodb.combinations | 8 + .../gcol/inc/gcol_column_def_options.inc | 2 +- .../suite/gcol/inc/innodb_v_large_col.inc | 53 + mysql-test/suite/gcol/r/gcol_bugfixes.result | 330 ++-- .../r/gcol_column_def_options_innodb.result | 170 +- .../suite/gcol/r/gcol_ins_upd_myisam.result | 4 + mysql-test/suite/gcol/r/gcol_rollback.result | 14 +- .../suite/gcol/r/gcol_select_innodb.result | 2 + .../suite/gcol/r/innodb_partition.result | 26 + .../gcol/r/innodb_prefix_index_check.result | 15 + .../suite/gcol/r/innodb_virtual_basic.result | 1562 +++++++++++++++++ .../suite/gcol/r/innodb_virtual_blob.result | 12 + .../suite/gcol/r/innodb_virtual_debug.result | 227 +++ .../gcol/r/innodb_virtual_debug_purge.result | 141 ++ .../suite/gcol/r/innodb_virtual_fk.result | 590 +++++++ .../gcol/r/innodb_virtual_fk_restart.result | 44 + .../suite/gcol/r/innodb_virtual_index.result | 196 +++ .../suite/gcol/r/innodb_virtual_purge.result | 140 ++ mysql-test/suite/gcol/r/innodb_wl8114.result | 52 + .../suite/gcol/r/main_alter_table.result | 52 + mysql-test/suite/gcol/r/main_mysqldump.result | 49 + mysql-test/suite/gcol/t/gcol_bugfixes.test | 273 ++- .../t/gcol_column_def_options_innodb.test | 2 +- mysql-test/suite/gcol/t/gcol_rollback.test | 4 +- mysql-test/suite/gcol/t/innodb_partition.test | 30 + .../gcol/t/innodb_prefix_index_check.test | 22 + .../suite/gcol/t/innodb_virtual_basic.test | 1474 ++++++++++++++++ .../suite/gcol/t/innodb_virtual_blob.test | 16 + .../suite/gcol/t/innodb_virtual_debug.test | 240 +++ .../gcol/t/innodb_virtual_debug_purge.test | 174 ++ .../suite/gcol/t/innodb_virtual_fk.test | 492 ++++++ .../gcol/t/innodb_virtual_fk_restart.test | 42 + .../suite/gcol/t/innodb_virtual_index.test | 220 +++ .../suite/gcol/t/innodb_virtual_purge.test | 138 ++ mysql-test/suite/gcol/t/innodb_wl8114.test | 42 + mysql-test/suite/gcol/t/main_alter_table.test | 50 + mysql-test/suite/gcol/t/main_mysqldump.test | 44 + .../suite/innodb/r/innodb_bug12400341.result | 6 +- .../suite/innodb/t/innodb_bug12400341.test | 6 +- .../suite/perfschema/r/threads_innodb.result | 1 + .../suite/vcol/r/vcol_keys_innodb.result | 18 +- mysql-test/suite/vcol/t/vcol_keys_innodb.test | 1 + sql/handler.cc | 1 + sql/handler.h | 101 +- sql/sql_class.cc | 87 + sql/sql_class.h | 3 +- sql/sql_parse.cc | 15 +- sql/sql_table.cc | 141 +- storage/innobase/handler/ha_innodb.cc | 567 +++--- storage/innobase/handler/ha_innodb.h | 18 +- storage/innobase/handler/handler0alter.cc | 422 ++--- storage/innobase/include/dict0dict.ic | 1 - storage/innobase/include/dict0mem.h | 11 +- storage/innobase/include/ha_prototypes.h | 16 +- storage/innobase/log/log0log.cc | 7 + storage/innobase/row/row0ins.cc | 6 - storage/innobase/row/row0merge.cc | 5 - storage/innobase/row/row0mysql.cc | 2 - storage/innobase/row/row0purge.cc | 4 +- storage/innobase/row/row0sel.cc | 2 - storage/innobase/row/row0upd.cc | 6 - storage/innobase/row/row0vers.cc | 6 - storage/innobase/srv/srv0srv.cc | 44 +- storage/mroonga/ha_mroonga.cpp | 4 +- storage/tokudb/ha_tokudb_alter_56.cc | 20 +- 65 files changed, 7367 insertions(+), 1106 deletions(-) create mode 100644 mysql-test/suite/gcol/inc/innodb_v_large_col.inc create mode 100644 mysql-test/suite/gcol/r/innodb_partition.result create mode 100644 mysql-test/suite/gcol/r/innodb_prefix_index_check.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_basic.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_blob.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_debug.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_fk.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_index.result create mode 100644 mysql-test/suite/gcol/r/innodb_virtual_purge.result create mode 100644 mysql-test/suite/gcol/r/innodb_wl8114.result create mode 100644 mysql-test/suite/gcol/r/main_alter_table.result create mode 100644 mysql-test/suite/gcol/r/main_mysqldump.result create mode 100644 mysql-test/suite/gcol/t/innodb_partition.test create mode 100644 mysql-test/suite/gcol/t/innodb_prefix_index_check.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_basic.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_blob.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_debug.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_fk.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_index.test create mode 100644 mysql-test/suite/gcol/t/innodb_virtual_purge.test create mode 100644 mysql-test/suite/gcol/t/innodb_wl8114.test create mode 100644 mysql-test/suite/gcol/t/main_alter_table.test create mode 100644 mysql-test/suite/gcol/t/main_mysqldump.test diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations index e893da0a313..7e9e6b9e3b0 100644 --- a/mysql-test/include/have_innodb.combinations +++ b/mysql-test/include/have_innodb.combinations @@ -9,9 +9,13 @@ innodb-locks innodb-buffer-pool-stats innodb-buffer-page innodb-buffer-page-lru +innodb-sys-columns +innodb-sys-fields innodb-sys-foreign innodb-sys-foreign-cols +innodb-sys-indexes innodb-sys-tables +innodb-sys-virtual innodb-metrics [xtradb_plugin] @@ -54,6 +58,10 @@ innodb-metrics innodb-buffer-pool-stats innodb-buffer-page innodb-buffer-page-lru +innodb-sys-columns +innodb-sys-fields innodb-sys-foreign innodb-sys-foreign-cols +innodb-sys-indexes innodb-sys-tables +innodb-sys-virtual diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc index 935a20503bf..c975cfe22fe 100644 --- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -395,7 +395,7 @@ ALTER TABLE t CHANGE c c varchar(10) as ('a'); ALTER TABLE t CHANGE dd d varchar(10); if ($support_virtual_index) { - +# no RENAME INDEX yet #ALTER TABLE t ADD INDEX idx(a), ADD INDEX idx1(c); #ALTER TABLE t RENAME INDEX idx TO idx2, RENAME INDEX idx1 TO idx3; #ALTER TABLE t DROP INDEX idx2, DROP INDEX idx3; diff --git a/mysql-test/suite/gcol/inc/innodb_v_large_col.inc b/mysql-test/suite/gcol/inc/innodb_v_large_col.inc new file mode 100644 index 00000000000..70e188635fa --- /dev/null +++ b/mysql-test/suite/gcol/inc/innodb_v_large_col.inc @@ -0,0 +1,53 @@ +--source include/have_innodb.inc + +eval CREATE TABLE `t` ( +`a` VARCHAR(10000), `b` VARCHAR(3000), +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) ) ROW_FORMAT=$row_format ENGINE=InnoDB; + +SHOW CREATE TABLE t; + +INSERT INTO t VALUES (REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); + +INSERT INTO t VALUES (REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; + +delimiter |; +CREATE PROCEDURE UPDATE_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 100) DO + UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; + SET i = i + 1; + END WHILE; +END| + +CREATE PROCEDURE DELETE_insert_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 100) DO + DELETE FROM t WHERE h = 1; + INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); + SET i = i + 1; + END WHILE; +END| +delimiter ;| + +CALL UPDATE_t(); + +CALL DELETE_insert_t(); + +UPDATE t SET a = NULL WHERE h=1; + +START TRANSACTION; +CALL UPDATE_t(); +ROLLBACK; + +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index 3ee376bd146..fa0badff96d 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -59,189 +59,147 @@ DROP TABLE t1; # CREATE TABLE c ( pk INTEGER AUTO_INCREMENT, -col_int_nokey INTEGER /*! NULL */, -col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, -col_date_nokey DATE /*! NULL */, -col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, -col_datetime_nokey DATETIME /*! NULL */, -col_time_nokey TIME /*! NULL */, -col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_varchar_nokey VARCHAR(1) /*! NULL */, -col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +col_int_nokey INTEGER, +gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, +col_date_nokey DATE, +gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME, +col_time_nokey TIME, +gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +col_varchar_nokey VARCHAR(1), +gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, PRIMARY KEY (pk), -UNIQUE KEY (col_int_key), -UNIQUE KEY (col_varchar_key), -UNIQUE KEY (col_date_key), -KEY (col_time_key), -KEY (col_datetime_key), -UNIQUE KEY (col_int_key, col_varchar_key), -KEY (col_int_key, col_int_nokey), -KEY(col_int_key,col_date_key), -KEY(col_int_key, col_time_key), -KEY(col_int_key, col_datetime_key), -UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), -UNIQUE KEY (col_varchar_key, col_varchar_nokey), -UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) +UNIQUE KEY (gcol_int_key), +UNIQUE KEY (gcol_varchar_key), +UNIQUE KEY (gcol_date_key), +KEY (gcol_time_key), +KEY (gcol_datetime_key), +UNIQUE KEY (gcol_int_key, gcol_varchar_key), +KEY (gcol_int_key, col_int_nokey), +KEY(gcol_int_key,gcol_date_key), +KEY(gcol_int_key, gcol_time_key), +KEY(gcol_int_key, gcol_datetime_key), +UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), +UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), +UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) ) ENGINE=INNODB; -INSERT /*! IGNORE */ INTO c ( -col_int_nokey, -col_date_nokey, -col_time_nokey, -col_datetime_nokey, -col_varchar_nokey -) VALUES (7, '2004-04-09', '14:03:03.042673', -'2001-11-28 00:50:27.051028', 'c'),(1, '2006-05-13', '01:46:09.016386', -'2007-10-09 19:53:04.008332', NULL); +INSERT IGNORE INTO c ( col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) +VALUES (7, '2004-04-09', '14:03:03.042673', '2001-11-28 00:50:27.051028', 'c'), +(1, '2006-05-13', '01:46:09.016386', '2007-10-09 19:53:04.008332', NULL); Warnings: -Warning 1048 Column 'col_varchar_key' cannot be null +Note 1265 Data truncated for column 'gcol_time_key' at row 1 +Note 1265 Data truncated for column 'gcol_time_key' at row 2 CREATE TABLE bb ( pk INTEGER AUTO_INCREMENT, -col_int_nokey INTEGER /*! NULL */, -col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, -col_date_nokey DATE /*! NULL */, -col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, -col_datetime_nokey DATETIME /*! NULL */, -col_time_nokey TIME /*! NULL */, -col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_varchar_nokey VARCHAR(1) /*! NULL */, -col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +col_int_nokey INTEGER, +gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, +col_date_nokey DATE, +gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME, +col_time_nokey TIME, +gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +col_varchar_nokey VARCHAR(1), +gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, PRIMARY KEY (pk), -UNIQUE KEY (col_int_key), -UNIQUE KEY (col_varchar_key), -UNIQUE KEY (col_date_key), -KEY (col_time_key), -KEY (col_datetime_key), -UNIQUE KEY (col_int_key, col_varchar_key), -KEY (col_int_key, col_int_nokey), -KEY(col_int_key,col_date_key), -KEY(col_int_key, col_time_key), -KEY(col_int_key, col_datetime_key), -UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), -UNIQUE KEY (col_varchar_key, col_varchar_nokey), -UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) +UNIQUE KEY (gcol_int_key), +UNIQUE KEY (gcol_varchar_key), +UNIQUE KEY (gcol_date_key), +KEY (gcol_time_key), +KEY (gcol_datetime_key), +UNIQUE KEY (gcol_int_key, gcol_varchar_key), +KEY (gcol_int_key, col_int_nokey), +KEY(gcol_int_key,gcol_date_key), +KEY(gcol_int_key, gcol_time_key), +KEY(gcol_int_key, gcol_datetime_key), +UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), +UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), +UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) ) AUTO_INCREMENT=10 ENGINE=INNODB; -INSERT /*! IGNORE */ INTO bb ( -col_int_nokey, -col_date_nokey, -col_time_nokey, -col_datetime_nokey, -col_varchar_nokey -) VALUES (0, '2003-08-04', '01:48:05.048577', -'2006-11-03 00:00:00', 'p'),(2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); +INSERT IGNORE INTO bb ( col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) +VALUES (0, '2003-08-04', '01:48:05.048577', '2006-11-03 00:00:00', 'p'), +(2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); +Warnings: +Note 1265 Data truncated for column 'gcol_time_key' at row 1 +Note 1265 Data truncated for column 'gcol_time_key' at row 2 CREATE TABLE cc ( pk INTEGER AUTO_INCREMENT, -col_int_nokey INTEGER /*! NULL */, -col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, -col_date_nokey DATE /*! NULL */, -col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, -col_datetime_nokey DATETIME /*! NULL */, -col_time_nokey TIME /*! NULL */, -col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_varchar_nokey VARCHAR(1) /*! NULL */, -col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +col_int_nokey INTEGER, +gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, +col_date_nokey DATE, +gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME, +col_time_nokey TIME, +gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +col_varchar_nokey VARCHAR(1), +gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, PRIMARY KEY (pk), -UNIQUE KEY (col_int_key), -UNIQUE KEY (col_varchar_key), -UNIQUE KEY (col_date_key), -KEY (col_time_key), -KEY (col_datetime_key), -UNIQUE KEY (col_int_key, col_varchar_key), -KEY (col_int_key, col_int_nokey), -KEY(col_int_key,col_date_key), -KEY(col_int_key, col_time_key), -KEY(col_int_key, col_datetime_key), -UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), -UNIQUE KEY (col_varchar_key, col_varchar_nokey), -UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) +UNIQUE KEY (gcol_int_key), +UNIQUE KEY (gcol_varchar_key), +UNIQUE KEY (gcol_date_key), +KEY (gcol_time_key), +KEY (gcol_datetime_key), +UNIQUE KEY (gcol_int_key, gcol_varchar_key), +KEY (gcol_int_key, col_int_nokey), +KEY(gcol_int_key,gcol_date_key), +KEY(gcol_int_key, gcol_time_key), +KEY(gcol_int_key, gcol_datetime_key), +UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), +UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), +UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) ) AUTO_INCREMENT=10 ENGINE=INNODB; -INSERT /*! IGNORE */ INTO cc ( -col_int_nokey, -col_date_nokey, -col_time_nokey, -col_datetime_nokey, -col_varchar_nokey -) VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'),(NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); +INSERT IGNORE INTO cc (col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) +VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'), +(NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); Warnings: -Warning 1048 Column 'col_int_key' cannot be null -Warning 1048 Column 'col_datetime_key' cannot be null -Warning 1048 Column 'col_time_key' cannot be null +Note 1265 Data truncated for column 'gcol_time_key' at row 1 EXPLAIN SELECT -gp1 . col_datetime_key AS g1 -FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +gp1 . gcol_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . gcol_datetime_key <> gp1 . col_time_nokey ) WHERE gp1 . col_varchar_nokey IN ( SELECT -DISTINCT p1 . col_varchar_key AS p1 +DISTINCT p1 . gcol_varchar_key AS p1 FROM bb AS p1 LEFT JOIN bb AS p2 -ON ( p1 . col_int_key = p2 . pk ) +ON ( p1 . gcol_int_key = p2 . pk ) ) AND gp1 . col_varchar_nokey = 'b' HAVING g1 > 6; -id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gp1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where -1 SIMPLE p1 NULL const col_varchar_key,col_varchar_key_2 col_varchar_key 4 const 1 100.00 NULL -1 SIMPLE p2 NULL eq_ref PRIMARY PRIMARY 4 test.p1.col_int_key 1 100.00 Using index; FirstMatch(gp1) -1 SIMPLE gp2 NULL index NULL col_datetime_key 5 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) -Warnings: -Warning 1292 Incorrect datetime value: '6' for column 'col_datetime_key' at row 1 -Note 1003 /* select#1 */ select `test`.`gp1`.`col_datetime_key` AS `g1` from `test`.`cc` `gp1` semi join (`test`.`bb` `p1` left join `test`.`bb` `p2` on((`test`.`p1`.`col_int_key` = `test`.`p2`.`pk`))) left join `test`.`c` `gp2` on((`test`.`gp2`.`col_datetime_key` <> `test`.`gp1`.`col_time_nokey`)) where ((`test`.`gp1`.`col_varchar_nokey` = 'b') and ('b' = `test`.`p1`.`col_varchar_key`)) having (`g1` > 6) +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT -gp1 . col_datetime_key AS g1 -FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +gp1 . gcol_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . gcol_datetime_key <> gp1 . col_time_nokey ) WHERE gp1 . col_varchar_nokey IN ( SELECT -DISTINCT p1 . col_varchar_key AS p1 +DISTINCT p1 . gcol_varchar_key AS p1 FROM bb AS p1 LEFT JOIN bb AS p2 -ON ( p1 . col_int_key = p2 . pk ) +ON ( p1 . gcol_int_key = p2 . pk ) ) AND gp1 . col_varchar_nokey = 'b' HAVING g1 > 6; g1 -Warnings: -Warning 1292 Incorrect datetime value: '6' for column 'col_datetime_key' at row 1 DROP TABLE bb, c, cc; # Bug#21284646: Assertion !(table || table->read_set || bitmap_is_set()) CREATE TABLE c ( pk INTEGER AUTO_INCREMENT, col_int_nokey INTEGER NOT NULL, -col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL not null, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, col_date_nokey DATE NOT NULL, -col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, col_datetime_nokey DATETIME NOT NULL, col_time_nokey TIME NOT NULL, -col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, -col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, col_varchar_nokey VARCHAR(1) NOT NULL, -col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, PRIMARY KEY (pk,col_int_nokey), UNIQUE KEY (col_int_key), UNIQUE KEY (col_varchar_key), @@ -264,6 +222,13 @@ INSERT INTO c (col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey (6, '2006-05-25', '19:47:59.011283', '2001-02-15 03:08:38.035426', 'y'), (2, '2002-10-13', '00:00:00', '1900-01-01 00:00:00', 's'), (4, '1900-01-01', '15:57:25.019666', '2005-08-15 00:00:00', 'r'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +Note 1265 Data truncated for column 'col_time_key' at row 2 +Note 1265 Data truncated for column 'col_time_key' at row 3 +Note 1265 Data truncated for column 'col_time_key' at row 4 +Note 1265 Data truncated for column 'col_time_key' at row 5 +Note 1265 Data truncated for column 'col_time_key' at row 6 ANALYZE TABLE c; Table Op Msg_type Msg_text test.c analyze status OK @@ -274,10 +239,8 @@ col_int_nokey <> 9 AND pk >= 8 HAVING x > '2000-02-06' ORDER BY col_time_nokey, pk; -id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE c NULL index_merge PRIMARY,col_varchar_key,col_int_key_2,col_varchar_key_2,col_int_key_7 col_varchar_key,PRIMARY 4,4 NULL 2 100.00 Using sort_union(col_varchar_key,PRIMARY); Using where -Warnings: -Note 1003 /* select#1 */ select count(distinct `test`.`c`.`col_varchar_key`) AS `x` from `test`.`c` where ((`test`.`c`.`col_varchar_key` in ('rr','rr')) or ((`test`.`c`.`col_int_nokey` <> 9) and (`test`.`c`.`pk` >= 8))) having (`x` > '2000-02-06') +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE c ALL PRIMARY,col_varchar_key,col_varchar_key_2 NULL NULL NULL 6 Using where SELECT COUNT(DISTINCT col_varchar_key) AS x FROM c WHERE col_varchar_key IN ('rr', 'rr') OR @@ -292,15 +255,15 @@ DROP TABLE c; # Bug#21341044: Conditional jump at sort_param::make_sort_key CREATE TABLE t1 ( pk INTEGER AUTO_INCREMENT, -col_int_nokey INTEGER /*! NULL */, +col_int_nokey INTEGER, col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, -col_blob_nokey BLOB /*! NULL */, +col_blob_nokey BLOB, col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, -col_longblob_nokey LONGBLOB /*! NULL */, -col_longtext_nokey LONGTEXT /*! NULL */, +col_longblob_nokey LONGBLOB, +col_longtext_nokey LONGTEXT, col_longblob_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 20)) VIRTUAL, col_longtext_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 18)) VIRTUAL, -col_text_nokey TEXT /*! NULL */, +col_text_nokey TEXT, col_text_key TEXT GENERATED ALWAYS AS (REPEAT(col_text_nokey, 30)) VIRTUAL, PRIMARY KEY (pk), KEY (col_int_key), @@ -350,7 +313,7 @@ CREATE TABLE t(a int); ALTER TABLE t ADD COLUMN b int GENERATED ALWAYS AS ( date_sub(a,interval a month)) VIRTUAL; ALTER TABLE t ADD COLUMN c int GENERATED ALWAYS AS (sum(a)); -ERROR HY000: Invalid use of group function +ERROR HY000: Function or expression 'sum()' cannot be used in the GENERATED ALWAYS AS clause of `c` DROP TABLE t; # # Bug#21628840: CRASH/MEMORY CORRUPTION ADDING INDEXES TO VIRTUAL COLUMN @@ -368,10 +331,8 @@ test.t1 analyze status OK # Make sure the index is correct. That's kinda important. EXPLAIN SELECT c FROM t1; -id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL index NULL c 5 NULL 5 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`c` AS `c` from `test`.`t1` +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL c 5 NULL 5 Using index SELECT c FROM t1; c 1 @@ -408,20 +369,16 @@ b CHAR(2) GENERATED ALWAYS AS (a IN (1)) VIRTUAL, KEY(c,b(1))); INSERT INTO v (a,c) VALUES (1,1); EXPLAIN SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); -id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -2 SUBQUERY t NULL ALL NULL NULL NULL NULL 1 100.00 NULL -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t` where 0 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); 1 EXPLAIN SELECT (SELECT MAX(c) FROM v); -id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select (/* select#2 */ select max(`test`.`v`.`c`) from `test`.`v`) AS `(SELECT MAX(c) FROM v)` +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away SELECT (SELECT MAX(c) FROM v); (SELECT MAX(c) FROM v) 1 @@ -479,13 +436,18 @@ PRIMARY KEY(c1), UNIQUE KEY(c13) ); INSERT INTO C (c8,c9) VALUES('1970-01-01',0),('1970-01-01',1); +Warnings: +Note 1265 Data truncated for column 'c11' at row 1 +Note 1265 Data truncated for column 'c13' at row 1 +Note 1265 Data truncated for column 'c11' at row 2 +Note 1265 Data truncated for column 'c13' at row 2 CREATE VIEW view_C AS SELECT * FROM C; SELECT /*+ NO_BNL(t1) */ t1.c13 FROM C AS t2 STRAIGHT_JOIN C AS t1 FORCE INDEX(c13); c13 00:00:00 -00:00:01 00:00:00 00:00:01 +00:00:01 SELECT DISTINCT t1.c13 FROM C AS t1, view_C AS t2; c13 00:00:00 @@ -493,17 +455,6 @@ c13 DROP TABLE C; DROP VIEW view_C; # -# Bug #21808680: JSON + GENERATED COLUMN CORRUPTS TABLE CACHE -# MEMORY, CRASHES -# -CREATE TABLE t (a INT, b JSON, c TEXT GENERATED ALWAYS AS (REPEAT(a=b, 2))); -INSERT INTO t (a, b) VALUES (1, '2'), (3, '3'); -SELECT * FROM t; -a b c -1 2 00 -3 3 11 -DROP TABLE t; -# # Bug#21810529: CRASH IN ITEM_FUNC::WALK WHEN CODE JUMPS TO GARBAGE # LOCATION # @@ -522,10 +473,10 @@ DROP TABLE t; # CREATE TABLE t(b BLOB); ALTER TABLE t ADD COLUMN c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL; -ERROR HY000: Expression of generated column 'c' contains a disallowed function. +ERROR 21000: Operand should contain 1 column(s) DROP TABLE t; CREATE TABLE t(b BLOB, c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL); -ERROR HY000: Expression of generated column 'c' contains a disallowed function. +ERROR 21000: Operand should contain 1 column(s) # # Bug#21929967 GCOLS: GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE # @@ -536,14 +487,12 @@ t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, `c` char(2) GENERATED ALWAYS AS ((`a` or `b`)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; a b c 1 1 1 SET SQL_MODE=PIPES_AS_CONCAT; -Warnings: -Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. SELECT * FROM t1; a b c 1 1 1 @@ -559,7 +508,7 @@ t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, `c` char(2) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; a b c @@ -576,17 +525,18 @@ DROP TABLE t1; # Bug#22018999: gcols: assertion failed: !error SET @save_old_sql_mode= @@sql_mode; SET sql_mode=""; -Warnings: -Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; -ERROR 22007: Truncated incorrect INTEGER value: 'a' +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'a' +DROP TABLE t; CREATE TABLE t (a INTEGER) engine=innodb; ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1)); -ERROR 22007: Truncated incorrect INTEGER value: 'a' +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'a' DROP TABLE t; set sql_mode= @save_old_sql_mode; -Warnings: -Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. # Bug#21875520 Problems with virtual column indexes CREATE TABLE t( a TIMESTAMP, diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index e750bf01d7d..6a738685a5d 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -22,11 +22,11 @@ drop table t1; create table t1 (a int); insert into t1 values(1); alter table t1 add column (b int generated always as (a+1) virtual, c int); -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 alter table t1 add column (d int, e int generated always as (a+1) virtual); -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 alter table t1 add column (f int generated always as (a+1) virtual, g int as(5) stored); affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 @@ -49,13 +49,21 @@ alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AUTO_INCREMENT' at line 1 drop table t1; # [PRIMARY] KEY +create table t1 (a int, b int generated always as (a+1) virtual key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 create table t1 (a int, b int generated always as (a+1) stored key); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key)' at line 1 +create table t1 (a int, b int generated always as (a+1) virtual primary key); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 create table t1 (a int, b int generated always as (a+1) stored primary key); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key)' at line 1 create table t1 (a int); +alter table t1 add column b int generated always as (a+1) virtual key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 alter table t1 add column b int generated always as (a+1) stored key; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key' at line 1 +alter table t1 add column c int generated always as (a+2) virtual primary key; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'primary key' at line 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -265,14 +273,6 @@ a b c 1 -1 0 2 -2 -1 drop table t1,tt; -# Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON -# VIRTUAL GC FOR MYISAM -CREATE TABLE A ( -pk INTEGER, -col_int_nokey INTEGER, -col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY -(col_int_key)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column # Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: # THD->CHANGE_LIST.IS_EMPTY() # @@ -369,6 +369,36 @@ SELECT * FROM t1; c2 c1 5 2 1 5 DROP TABLE t1, t2; +# Bug#21074624:i WL8149:SIG 11 INNOBASE_GET_COMPUTED_VALUE | +# INNOBASE/HANDLER/HA_INNODB.CC:19082 +CREATE TABLE t1 ( +col1 int(11) NOT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) NOT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL, +col6 int(11) GENERATED ALWAYS AS (col3 + col3) VIRTUAL, +col7 int(11) GENERATED ALWAYS AS (col5 / col5) VIRTUAL, +col8 int(11) GENERATED ALWAYS AS (col6 / col5) VIRTUAL, +col9 text, +extra int(11) DEFAULT NULL, +KEY idx (col5) +); +INSERT INTO t1(col1,col2,col3,col4,col9,extra) +VALUES(0,6,3,4,REPEAT(4,1000),0); +ALTER TABLE t1 DROP COLUMN col1; +DROP TABLE t1; +# Bug#21390605:VALGRIND ERROR ON DELETE FROM TABLE CONTAINING +# AN INDEXED VIRTUAL COLUMN +CREATE TABLE t1 ( +a INTEGER, +b INTEGER GENERATED ALWAYS AS (a) VIRTUAL, +c INTEGER GENERATED ALWAYS AS (b) VIRTUAL, +INDEX idx (b,c) +); +INSERT INTO t1 (a) VALUES (42); +DELETE FROM t1 WHERE c = 42; +DROP TABLE t1; # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES # IN FIND_FIELD_IN_TABLE # @@ -426,11 +456,11 @@ INSERT INTO t(a,b) VALUES(1,2); # Mixed drop/add/rename virtual with non-virtual columns, # ALGORITHM=INPLACE is not supported for InnoDB ALTER TABLE t DROP d, ADD e varchar(10); -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t ADD d int, ADD f char(10) AS ('aaa'); -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t CHANGE d dd int, CHANGE f ff varchar(10) AS ('bbb'); affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 @@ -446,11 +476,11 @@ affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 # Change order should be ALGORITHM=INPLACE on Innodb ALTER TABLE t CHANGE c c int(11) as (a) after f; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t CHANGE b b int(11) after c; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 # TODO: Changing virtual column type should be ALGORITHM=INPLACE on InnoDB, current it goes only with COPY method ALTER TABLE t CHANGE c c varchar(10) as ('a'); affected rows: 1 @@ -459,6 +489,12 @@ info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t CHANGE dd d varchar(10); affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t ADD INDEX idx(c), ADD INDEX idx1(d); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t DROP INDEX idx, DROP INDEX idx1; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 DROP TABLE t; # Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF CREATE TABLE t1( @@ -487,19 +523,34 @@ col1 col2 col3 col4 vgc1 sgc1 2 20 200 NULL 4000 0 ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; +ALTER TABLE t1 ADD INDEX vgc1 (vgc1); ALTER TABLE t1 ADD INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; +SELECT * FROM t1 order by col1; +col1 col2 col3 col4 vgc1 sgc1 +1 10 100 NULL 1000 -90 +2 20 200 NULL 4000 -180 +SELECT vgc1 FROM t1 order by vgc1; +vgc1 +1000 +4000 ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; SELECT * FROM t1 order by col1; col1 col2 col3 col4 vgc1 sgc1 -1 10 100 NULL 110 0 -2 20 200 NULL 220 0 +1 10 100 NULL 1000 0 +2 20 200 NULL 4000 0 SELECT sgc1 FROM t1 order by sgc1; sgc1 0 0 +ALTER TABLE t1 DROP INDEX vgc1; ALTER TABLE t1 DROP INDEX sgc1; +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; +ALTER TABLE t1 ADD UNIQUE INDEX vgc1 (vgc1); ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); +ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 / col3) VIRTUAL; +ERROR 23000: Duplicate entry '0' for key 'vgc1' ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; ERROR 23000: Duplicate entry '0' for key 'sgc1' ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; @@ -536,9 +587,72 @@ col1 col2 col3 col4 vgc1 sgc1 2 20 200 222 4000 4000 DROP TABLE t1; # +# bug#22018979: RECORD NOT FOUND ON UPDATE, +# VIRTUAL COLUMN, ASSERTION 0 +SET @sql_mode_save= @@sql_mode; +SET sql_mode= 'ANSI'; +CREATE TABLE t1 ( +a INT, +b VARCHAR(10), +c CHAR(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +PRIMARY KEY (a), +KEY c(c) +); +INSERT INTO t1(a, b) values(1, 'bbbb'), (2, 'cc'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" int(11) NOT NULL, + "b" varchar(10) DEFAULT NULL, + "c" char(3) AS (substr(b,1,3)) VIRTUAL, + PRIMARY KEY ("a"), + KEY "c" ("c") +) +SELECT * FROM t1 order by a; +a b c +1 bbbb bbb +2 cc cc +SET sql_mode= ''; +FLUSH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` varchar(10) DEFAULT NULL, + `c` char(3) AS (substr(b,1,3)) VIRTUAL, + PRIMARY KEY (`a`), + KEY `c` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1 order by a; +a b c +1 bbbb bbb +2 cc cc +DELETE FROM t1 where a= 2; +SET sql_mode= @sql_mode_save; +DROP TABLE t1; +# # Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE # ALLOWED IN GENERATED COLUMNS # +CREATE TABLE tzz(a INT DEFAULT 5, +gc1 INT AS (a+DEFAULT(a)) VIRTUAL, +gc2 INT AS (a+DEFAULT(a)) STORED, +KEY k1(gc1)); +INSERT INTO tzz(A) VALUES (1); +SELECT * FROM tzz; +a gc1 gc2 +1 6 6 +SELECT gc1 FROM tzz; +gc1 +6 +ALTER TABLE tzz MODIFY COLUMN a INT DEFAULT 6; +SELECT * FROM tzz; +a gc1 gc2 +1 7 7 +SELECT gc1 FROM tzz; +gc1 +7 +DROP TABLE tzz; # Test 1: ALTER DEFAULT # CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, @@ -546,11 +660,11 @@ b INT AS (1 + DEFAULT(a)) STORED, c INT AS (1 + DEFAULT(a)) VIRTUAL); INSERT INTO t1 VALUES (); ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 @@ -565,8 +679,8 @@ affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, ADD COLUMN c1 INT AS (1 + DEFAULT(a)) VIRTUAL; -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7, ADD COLUMN b INT AS (1 + DEFAULT(a)) STORED, ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result index 121978e2ec7..12e296972eb 100644 --- a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result @@ -550,6 +550,10 @@ b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL, KEY (a(183),b) ); INSERT INTO t VALUES(), (), (); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 DELETE IGNORE FROM t; DROP TABLE t; # diff --git a/mysql-test/suite/gcol/r/gcol_rollback.result b/mysql-test/suite/gcol/r/gcol_rollback.result index 006c8408a84..3fe40d1eccd 100644 --- a/mysql-test/suite/gcol/r/gcol_rollback.result +++ b/mysql-test/suite/gcol/r/gcol_rollback.result @@ -18,7 +18,6 @@ a b 9 9 BEGIN; INSERT INTO t (a) VALUES (10); -# Kill and restart SELECT * FROM t; a b 9 9 @@ -32,8 +31,11 @@ INSERT INTO t (a,c) VALUES (9, 10); SELECT * FROM t; a b c 9 9 10 +connect con1,localhost,root,,; +connection con1; SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE; +connection default; SET DEBUG_SYNC = 'now WAIT_FOR created'; BEGIN; INSERT INTO t (a,c) VALUES (10, 12); @@ -43,6 +45,9 @@ a b c 10 10 12 ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; +connection con1; +disconnect con1; +connection default; SELECT * FROM t; a b c 9 9 10 @@ -58,8 +63,11 @@ INSERT INTO t (a,b) VALUES (9, 10); SELECT * FROM t; a b c d 9 10 19 29 +connect con1,localhost,root,,; +connection con1; SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; +connection default; SET DEBUG_SYNC = 'now WAIT_FOR created'; BEGIN; INSERT INTO t (a,b) VALUES (10, 12); @@ -69,7 +77,11 @@ a b c d 10 12 22 34 ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; +connection con1; +disconnect con1; +connection default; SELECT * FROM t; a b d 9 10 29 DROP TABLE t; +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result index e815cfcbe8e..24daadb0d5b 100644 --- a/mysql-test/suite/gcol/r/gcol_select_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result @@ -563,6 +563,8 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c WHERE b.b>c.a; c +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'cccc' DROP TABLE t; set @optimizer_switch_save = @@optimizer_switch; set optimizer_switch='mrr_cost_based=off'; diff --git a/mysql-test/suite/gcol/r/innodb_partition.result b/mysql-test/suite/gcol/r/innodb_partition.result new file mode 100644 index 00000000000..8cdf8d41a7a --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_partition.result @@ -0,0 +1,26 @@ +# +# Bug#22444530 - GCOLS + PARTITIONED TABLE, CRASH IN +# +set sql_mode=''; +create table t ( +a int not null, +b int generated always as (1) virtual, +c int generated always as (1) virtual, +key (c) +) engine=innodb partition by key (a) partitions 2; +insert into t(a) values(1); +select b from t group by c; +b +1 +drop table t; +create table t ( +a int not null, +b blob generated always as ("a") virtual, +c int generated always as (1) virtual, +key (c) +) engine=innodb partition by key (a) partitions 2; +insert into t(a) values(1); +select b from t group by c; +b +a +drop table t; diff --git a/mysql-test/suite/gcol/r/innodb_prefix_index_check.result b/mysql-test/suite/gcol/r/innodb_prefix_index_check.result new file mode 100644 index 00000000000..01dbe4a6592 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_prefix_index_check.result @@ -0,0 +1,15 @@ +#Bug #22445211 GCOLS: SIMPLE DML, FAILING ASSERTION: +#!CURSOR->INDEX->IS_COMMITTED() +#Create and alter table examples for virtual column for full +#column index followed by prefix index. +CREATE TABLE t1( +f1 INT DEFAULT NULL, +f2 CHAR(2) GENERATED ALWAYS AS ('11') VIRTUAL, +f3 INT, +UNIQUE KEY(f1), +UNIQUE KEY(f3,f1), +KEY(f2,f1), +key(f1,f2(1)) +)ENGINE=INNODB; +REPLACE INTO t1(f3) VALUES (1),(1); +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result new file mode 100644 index 00000000000..bcd969c84fb --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result @@ -0,0 +1,1562 @@ +call mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual"); +set default_storage_engine=innodb; +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d CHAR(20), e CHAR(10) GENERATED ALWAYS AS (c), g INT); +INSERT INTO t VALUES(10, DEFAULT, "aa", "bb", DEFAULT, 20); +INSERT INTO t VALUES(11, DEFAULT, "jj", "kk", DEFAULT, 21); +CREATE INDEX idx ON t(e) algorithm=inplace; +INSERT INTO t VALUES(12, DEFAULT, 'mm', "nn", DEFAULT, 22); +SELECT e FROM t; +e +aa +jj +mm +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); +SELECT c FROM t; +c +NULL +14 +19 +29 +UPDATE t SET a = 10 WHERE a = 11; +SELECT c FROM t; +c +NULL +13 +19 +29 +SELECT * FROM t; +a b c h +10 3 13 mm +18 1 19 mm +28 1 29 mm +NULL NULL NULL mm +DELETE FROM t WHERE a = 18; +SELECT c FROM t; +c +NULL +13 +29 +START TRANSACTION; +INSERT INTO t VALUES (128, 22, DEFAULT, "xx"); +INSERT INTO t VALUES (1290, 212, DEFAULT, "xmx"); +ROLLBACK; +SELECT c FROM t; +c +NULL +13 +29 +SELECT * FROM t; +a b c h +10 3 13 mm +28 1 29 mm +NULL NULL NULL mm +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); +SELECT c FROM t; +c +3 +7 +33 +SELECT m FROM t; +m +5 +11 +30 +SELECT p FROM t; +p +ummuooo +uuuuu +XXXAAA +SELECT * FROM t; +a b c h j m n p +11 22 33 AAA 8 30 XXX XXXAAA +1 2 3 uuu 9 11 uu uuuuu +3 4 7 uooo 1 5 umm ummuooo +update t set a = 13 where a =11; +delete from t where a =13; +DROP INDEX idx1 ON t; +DROP INDEX idx2 ON t; +DROP TABLE t; +/* Test large BLOB data */ +CREATE TABLE `t` ( +`a` BLOB, +`b` BLOB, +`c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`h` VARCHAR(10) DEFAULT NULL +) ENGINE=InnoDB; +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, "kk"); +CREATE INDEX idx ON t(c(100)); +SELECT length(c) FROM t; +length(c) +32000 +START TRANSACTION; +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); +ROLLBACK; +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); +START TRANSACTION; +UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%"; +ROLLBACK; +SELECT COUNT(*) FROM t WHERE c like "aaa%"; +COUNT(*) +1 +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); +START TRANSACTION; +UPDATE t SET a = 100 WHERE a = 11; +UPDATE t SET a =22 WHERE a = 18; +UPDATE t SET a = 33 WHERE a = 22; +SELECT c FROM t; +c +29 +34 +103 +ROLLBACK; +SELECT c FROM t; +c +14 +19 +29 +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); +SELECT c FROM t; +c +14 +19 +29 +connect con1,localhost,root,,test; +START TRANSACTION; +SELECT c FROM t; +c +14 +19 +29 +connection default; +UPDATE t SET a = 19 WHERE a = 11; +connection con1; +SELECT c FROM t; +c +14 +19 +29 +ROLLBACK; +SELECT c FROM t; +c +19 +22 +29 +connection default; +disconnect con1; +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + x), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, y)), x INT, y CHAR(20), z INT, INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); +INSERT INTO t VALUES(1, 2, DEFAULT, "hhh", 3, DEFAULT, "nnn", DEFAULT, 4, "yyy", 5); +INSERT INTO t VALUES(2, 3, DEFAULT, "hhha", 4, DEFAULT, "nnna", DEFAULT, 5, "yyya", 6); +INSERT INTO t VALUES(12, 13, DEFAULT, "hhhb", 14, DEFAULT, "nnnb", DEFAULT, 15, "yyyb", 16); +CREATE INDEX idx6 ON t(p, c); +SELECT p, c FROM t; +p c +nnnayyya 5 +nnnbyyyb 25 +nnnyyy 3 +START TRANSACTION; +INSERT INTO t VALUES(32, 33, DEFAULT, "hhhb", 34, DEFAULT, "nnnb", DEFAULT, 35, "yyyb", 36); +ROLLBACK; +UPDATE t SET a = 100 WHERE a = 1; +START TRANSACTION; +UPDATE t SET a = 1 WHERE a = 100; +ROLLBACK; +DROP TABLE t; +CREATE TABLE t1(a INT); +ALTER TABLE t1 add COLUMN (b INT generated always as (a+1) virtual, c INT as(5) virtual); +ALTER TABLE t1 add COLUMN (d INT generated always as (a+1) virtual, e INT as(5) virtual); +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; +pos base_pos +65537 0 +196611 0 +ALTER TABLE t1 add COLUMN (f INT generated always as (a+1) virtual, g INT as(5) virtual), DROP COLUMN e; +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; +pos base_pos +65537 0 +196611 0 +262148 0 +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(1); +ALTER TABLE t1 add COLUMN (f INT generated always as (a+1) virtual, g INT ); +ALTER TABLE t1 add COLUMN (h INT generated always as (a+1) virtual), add INDEX idx (h), algorithm=inplace; +ALTER TABLE t1 add COLUMN (h1 INT generated always as (a+1) virtual), add INDEX idx1 (h1); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 DROP COLUMN h1, DROP INDEX idx; +DROP TABLE t1; +CREATE TABLE t1(a INT); +CREATE INDEX idx ON t1(a); +CREATE TABLE t3(a INT, b INT , INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a)); +CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a)); +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b)); +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1(a INT); +ALTER TABLE t1 add COLUMN (b INT generated always as (a+1) virtual, c INT as(5) virtual); +ALTER TABLE t1 change b x INT generated always as (a+1) virtual; +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; +pos base_pos +65537 0 +DROP TABLE t1; +CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a), fulltext INDEX idx (b)); +ERROR HY000: This is not yet supported for computed columns +CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a)); +ALTER TABLE t ADD FULLTEXT INDEX (b); +ERROR HY000: This is not yet supported for computed columns +DROP TABLE t; +CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a), spatial INDEX idx (b)); +ERROR 42000: All parts of a SPATIAL index must be NOT NULL +CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a)); +ALTER TABLE t ADD SPATIAL INDEX (b); +ERROR 42000: All parts of a SPATIAL index must be NOT NULL +DROP TABLE t; +CREATE TABLE t (a INT DEFAULT 1, b INT DEFAULT 2, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +CREATE INDEX idx ON t(c); +INSERT INTO t(h)VALUES ('mm'); +SELECT c FROM t; +c +3 +CREATE unique INDEX idx1 ON t(c); +INSERT INTO t(h)VALUES ('mm'); +ERROR 23000: Duplicate entry '3' for key 'idx1' +DROP TABLE t; +CREATE TABLE `t1` ( `a` INT(11) DEFAULT NULL, `b` INT(11) DEFAULT NULL, `c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, `x` INT(11) NOT NULL, `h` VARCHAR(10) DEFAULT NULL, PRIMARY KEY (`x`), KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1, 2, DEFAULT, 3, 'mm'); +INSERT INTO t1 VALUES (11, 22, DEFAULT, 23, 'mm'); +connect con1,localhost,root,,test; +UPDATE t1 SET x = 4 WHERE x =3; +DROP TABLE t1; +CREATE TABLE `t1` ( `a` INT(11) DEFAULT NULL, `b` INT(11) DEFAULT NULL, `c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, `x` INT(11) NOT NULL, `h` VARCHAR(10) DEFAULT NULL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1, 2, DEFAULT, 3, 'mm'); +INSERT INTO t1 VALUES (11, 22, DEFAULT, 23, 'mm'); +START TRANSACTION; +SELECT * FROM t1; +a b c x h +1 2 3 3 mm +11 22 33 23 mm +connection con1; +START TRANSACTION; +UPDATE t1 SET x = 15 WHERE x = 3; +UPDATE t1 SET b = 10 WHERE b=2; +ROLLBACK; +connection default; +SELECT c FROM t1; +c +3 +33 +disconnect con1; +DROP TABLE t1; +CREATE TABLE `t` ( +`a` INT(11) DEFAULT NULL, +`b` INT(11) DEFAULT NULL, +`c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, +`d` INT(11) GENERATED ALWAYS AS (a) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`), +KEY `idx` (`c`) +) ENGINE=InnoDB; +INSERT INTO t VALUES (11, 3, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (18, 1, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (28, 1, DEFAULT, DEFAULT, 3); +INSERT INTO t VALUES (null, null, DEFAULT, DEFAULT, 4); +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 2000) DO +UPDATE t SET a = 100 + i WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 2000) DO +UPDATE t SET a = 100 + i WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +SELECT c FROM t; +c +NULL +19 +29 +2103 +CALL DELETE_insert_t(); +SELECT c FROM t; +c +NULL +19 +29 +2103 +DROP INDEX idx ON t; +CALL UPDATE_t(); +SELECT c FROM t; +c +2103 +19 +29 +NULL +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +# Bug#20767937: WL8149:ASSERTION FAILED IN ROW_UPD_SEC_INDEX_ENTRY +CREATE TABLE b ( +col_INT_nokey INTEGER NOT NULL, +col_INT_key INTEGER GENERATED ALWAYS AS (col_INT_nokey) VIRTUAL, +col_date_nokey DATE, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey, +INTerval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, +col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, +col_time_nokey)), +col_VARCHAR_nokey VARCHAR(1) NOT NULL, +col_VARCHAR_key VARCHAR(2) GENERATED ALWAYS AS(CONCAT(col_VARCHAR_nokey, +col_VARCHAR_nokey)), +KEY (col_INT_key), +KEY (col_VARCHAR_key), +KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_INT_key, col_VARCHAR_key), +KEY (col_INT_key, col_VARCHAR_key, col_date_key, +col_time_key, col_datetime_key) +); +INSERT INTO b ( +col_INT_nokey, +col_date_nokey, +col_time_nokey, +col_datetime_nokey, +col_VARCHAR_nokey +) VALUES +(0, NULL, '21:22:34.025509', '2002-02-13 17:30:06.013935', 'j'), +(8, '2004-09-18', '10:50:38.059966', '2008-09-27 +00:34:58.026613', 'v'); +Warnings: +Note 1265 Data truncated for column 'col_time_key' at row 1 +Note 1265 Data truncated for column 'col_time_key' at row 2 +EXPLAIN SELECT col_INT_key FROM b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE b index NULL col_INT_key 5 NULL 2 Using index +SELECT col_INT_key FROM b; +col_INT_key +0 +8 +SELECT col_INT_nokey, col_INT_key FROM b; +col_INT_nokey col_INT_key +0 0 +8 8 +DELETE FROM b; +DROP TABLE b; +CREATE TABLE `t` ( +`a` VARCHAR(10000), `b` VARCHAR(3000), +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) ) ROW_FORMAT=COMPACT ENGINE=InnoDB; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` varchar(10000) DEFAULT NULL, + `b` varchar(3000) DEFAULT NULL, + `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) AS (`b`) VIRTUAL, + `e` int(11) AS (10) VIRTUAL, + `h` int(11) NOT NULL, + PRIMARY KEY (`h`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT +INSERT INTO t VALUES (REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +DELETE FROM t WHERE h = 1; +INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +CALL DELETE_insert_t(); +UPDATE t SET a = NULL WHERE h=1; +START TRANSACTION; +CALL UPDATE_t(); +ROLLBACK; +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +CREATE TABLE `t` ( +`a` BLOB, +`b` BLOB, +`c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` BLOB GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) +) ENGINE=InnoDB; +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 32000), REPEAT('b', 11000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 18000), REPEAT('n', 46000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = NULL WHERE h=1; +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 1000) WHERE h = 1; +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 200) DO +UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 200) DO +DELETE FROM t WHERE h = 1; +INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +CALL DELETE_insert_t(); +UPDATE t SET a = NULL WHERE h=1; +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +CREATE TABLE `t` ( +`m1` INT(11) DEFAULT NULL, +`m2` INT(11) DEFAULT NULL, +`m3` INT(11) GENERATED ALWAYS AS (m1 + m2) VIRTUAL, +`m4` INT(11) DEFAULT NULL, +`m5` CHAR(10) DEFAULT NULL, +`m6` CHAR(12) GENERATED ALWAYS AS (m5) VIRTUAL, +`a` VARCHAR(10000) DEFAULT NULL, +`b` VARCHAR(3000) DEFAULT NULL, +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`), +KEY `m3` (`m3`), +KEY `c` (`c`(100)), +KEY `e` (`e`,`d`(20)) +) ENGINE=InnoDB; +INSERT INTO t VALUES (1, 2, DEFAULT, 3, "aaa", DEFAULT, REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (11, 21, DEFAULT, 31, "bbb", DEFAULT, REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (21, 31, DEFAULT, 41, "zzz", DEFAULT, REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +ALTER TABLE t DROP COLUMN c; +DELETE FROM t; +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +CREATE INDEX idx ON t(a, c); +SELECT a, c FROM t; +a c +NULL NULL +11 14 +18 19 +28 29 +START TRANSACTION; +UPDATE t SET a = 13 where a = 11; +ROLLBACK; +DELETE FROM t; +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), m int); +INSERT INTO t VALUES (11, 3, DEFAULT, "a", 1); +INSERT INTO t VALUES (18, 1, DEFAULT, "b", 2); +INSERT INTO t VALUES (28, 1, DEFAULT, "c", 3 ); +INSERT INTO t VALUES (null, null, DEFAULT, "d", 4); +CREATE INDEX idx ON t(a, c, h); +SELECT a, c FROM t; +a c +NULL NULL +11 14 +18 19 +28 29 +START TRANSACTION; +UPDATE t SET m =10 WHERE m = 1; +UPDATE t SET h = "e" WHERE h="a"; +ROLLBACK; +SELECT a, c, h FROM t; +a c h +NULL NULL d +11 14 a +18 19 b +28 29 c +DROP TABLE t; +CREATE TABLE `t1` ( +`col1` int(11) NOT NULL, +`col2` int(11) NOT NULL, +`col3` int(11) NOT NULL, +`col4` int(11) DEFAULT NULL, +`col5` int(11) GENERATED ALWAYS AS (col2 % col3) VIRTUAL, +`col7` int(11) GENERATED ALWAYS AS (col5 * col5) VIRTUAL, +`col8` int(11) GENERATED ALWAYS AS (col5 % col5) VIRTUAL, +`col9` text, +`extra` int(11) DEFAULT NULL, +UNIQUE KEY `uidx` (`col5`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE t1 CHANGE COLUMN extra col6 INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` int(11) NOT NULL, + `col2` int(11) NOT NULL, + `col3` int(11) NOT NULL, + `col4` int(11) DEFAULT NULL, + `col5` int(11) AS ((`col2` % `col3`)) VIRTUAL, + `col7` int(11) AS ((`col5` * `col5`)) VIRTUAL, + `col8` int(11) AS ((`col5` % `col5`)) VIRTUAL, + `col9` text DEFAULT NULL, + `col6` int(11) DEFAULT NULL, + UNIQUE KEY `uidx` (`col5`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c point, d point GENERATED ALWAYS AS (c), spatial index idx (d)); +ERROR 42000: All parts of a SPATIAL index must be NOT NULL +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d char(20) GENERATED ALWAYS AS (c), fulltext index idx (d)); +ERROR HY000: This is not yet supported for computed columns +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); +alter table t add x int, add xx int generated ALWAYS AS(x); +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); +ALTER TABLE t DROP COLUMN c, algorithm=inplace; +ALTER TABLE t DROP COLUMN p, ADD COLUMN s VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), algorithm=inplace; +SELECT s FROM t; +s +XXXAAA +uuuuu +ummuooo +ALTER TABLE t ADD x VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), ADD INDEX idx (x), algorithm=inplace; +DROP TABLE t; +CREATE TABLE `t1` ( +`col1` int(11) DEFAULT NULL, +`col2` int(11) DEFAULT NULL, +`col3` int(11) DEFAULT NULL, +`col4` int(11) DEFAULT NULL, +`col5` int(11) GENERATED ALWAYS AS (col4 * col2) VIRTUAL, +`col6` int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL, +`col7` int(11) GENERATED ALWAYS AS (col5 / col6) VIRTUAL, +`col8` int(11) GENERATED ALWAYS AS (col5 + col5) VIRTUAL, +`col9` text, +`extra` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE t1 DROP COLUMN col7; +DROP TABLE t1; +CREATE TABLE t1 ( +col1 INTEGER NOT NULL, +gv_col INTEGER GENERATED ALWAYS AS (col1) VIRTUAL, +txt1 TEXT, +FULLTEXT INDEX fi(txt1) +); +select * from t1; +col1 gv_col txt1 +DROP TABLE t1; +CREATE TABLE t1 ( +col1 INTEGER NOT NULL, +col2 INTEGER NOT NULL, +col3 INTEGER DEFAULT NULL, +col4 INTEGER DEFAULT NULL, +col5 INTEGER DEFAULT NULL, +col6 INTEGER DEFAULT NULL, +col7 INTEGER DEFAULT NULL, +col8 INTEGER DEFAULT NULL, +col9 INTEGER DEFAULT NULL, +col10 INTEGER DEFAULT NULL, +col11 INTEGER DEFAULT NULL, +col12 INTEGER DEFAULT NULL, +col13 INTEGER DEFAULT NULL, +col14 INTEGER DEFAULT NULL, +col15 INTEGER DEFAULT NULL, +col16 INTEGER DEFAULT NULL, +col17 INTEGER DEFAULT NULL, +col18 INTEGER DEFAULT NULL, +col19 INTEGER DEFAULT NULL, +col20 INTEGER DEFAULT NULL, +col21 INTEGER DEFAULT NULL, +col22 INTEGER DEFAULT NULL, +col23 INTEGER DEFAULT NULL, +col24 INTEGER DEFAULT NULL, +col25 INTEGER DEFAULT NULL, +col26 INTEGER DEFAULT NULL, +col27 INTEGER DEFAULT NULL, +col28 INTEGER DEFAULT NULL, +col29 INTEGER DEFAULT NULL, +col30 INTEGER DEFAULT NULL, +col31 INTEGER DEFAULT NULL, +col32 INTEGER DEFAULT NULL, +col33 INTEGER DEFAULT NULL, +gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, +KEY idx1 (gcol1) +); +INSERT INTO t1 (col1, col2) +VALUES (0,1), (1,2), (2,3), (3,4), (4,5); +SELECT gcol1 FROM t1 FORCE INDEX(idx1); +gcol1 +1 +3 +5 +7 +9 +ALTER TABLE t1 ADD COLUMN extra INTEGER; +SELECT gcol1 FROM t1 FORCE INDEX(idx1); +gcol1 +1 +3 +5 +7 +9 +DROP TABLE t1; +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +INSERT INTO t1 VALUES(1, 2, default); +INSERT INTO t1 VALUES(3, 4, default); +INSERT INTO t1 VALUES(3, 12, default); +INSERT INTO t1 VALUES(4, 18, default); +CREATE INDEX idx ON t1(x); +SELECT x FROM t1; +x +3 +7 +15 +22 +DROP TABLE t1; +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (x) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +insert into t1 values(1, 2, default); +insert into t1 values(3, 4, default); +insert into t1 values(3, 12, default); +insert into t1 values(4, 18, default); +ERROR HY000: Table has no partition for value 22 +CREATE INDEX idx ON t1(x); +SELECT x FROM t1; +x +3 +7 +15 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a+1) ,c int) PARTITION BY RANGE (b) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) ); +INSERT INTO t1 VALUES (10,DEFAULT,2); +INSERT INTO t1 VALUES (19,DEFAULT,8); +CREATE INDEX idx ON t1 (b); +INSERT INTO t1 VALUES (5,DEFAULT,9); +SELECT * FROM t1; +a b c +5 6 9 +10 11 2 +19 20 8 +ALTER TABLE t1 REMOVE PARTITIONING; +DROP TABLE t1; +CREATE TABLE `t#P#1` (a INT, bt INT GENERATED ALWAYS AS (a+1) ,c int) +PARTITION BY RANGE (bt) +subpartition by hash (bt) +( +PARTITION p0 VALUES LESS THAN (6) ( +SUBPARTITION s0, +SUBPARTITION s1), +PARTITION p1 VALUES LESS THAN (11) ( +SUBPARTITION s2, +SUBPARTITION s3), +PARTITION p2 VALUES LESS THAN (16) ( +SUBPARTITION s4, +SUBPARTITION s5), +PARTITION p3 VALUES LESS THAN (21) ( +SUBPARTITION s6, +SUBPARTITION s7) +); +insert into `t#P#1` values (10,DEFAULT,2); +insert into `t#P#1` values (19,DEFAULT,8); +create index idx on `t#P#1` (bt); +insert into `t#P#1` values (5,DEFAULT,9); +select * from `t#P#1`; +a bt c +5 6 9 +10 11 2 +19 20 8 +alter table `t#P#1` remove partitioning; +drop table `t#P#1`; +CREATE TABLE `t` ( +`a` VARCHAR(10000), `b` VARCHAR(3000), +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) ) ROW_FORMAT=DYNAMIC ENGINE=InnoDB; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` varchar(10000) DEFAULT NULL, + `b` varchar(3000) DEFAULT NULL, + `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) AS (`b`) VIRTUAL, + `e` int(11) AS (10) VIRTUAL, + `h` int(11) NOT NULL, + PRIMARY KEY (`h`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +INSERT INTO t VALUES (REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +DELETE FROM t WHERE h = 1; +INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +CALL DELETE_insert_t(); +UPDATE t SET a = NULL WHERE h=1; +START TRANSACTION; +CALL UPDATE_t(); +ROLLBACK; +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +CREATE TABLE `t` ( +`a` VARCHAR(10000), `b` VARCHAR(3000), +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) ) ROW_FORMAT=REDUNDANT ENGINE=InnoDB; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` varchar(10000) DEFAULT NULL, + `b` varchar(3000) DEFAULT NULL, + `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) AS (`b`) VIRTUAL, + `e` int(11) AS (10) VIRTUAL, + `h` int(11) NOT NULL, + PRIMARY KEY (`h`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT +INSERT INTO t VALUES (REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +DELETE FROM t WHERE h = 1; +INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +CALL DELETE_insert_t(); +UPDATE t SET a = NULL WHERE h=1; +START TRANSACTION; +CALL UPDATE_t(); +ROLLBACK; +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +CREATE TABLE `t` ( +`a` VARCHAR(10000), `b` VARCHAR(3000), +`c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, +`e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, +`h` INT(11) NOT NULL, +PRIMARY KEY (`h`) ) ROW_FORMAT=COMPRESSED ENGINE=InnoDB; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` varchar(10000) DEFAULT NULL, + `b` varchar(3000) DEFAULT NULL, + `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) AS (`b`) VIRTUAL, + `e` int(11) AS (10) VIRTUAL, + `h` int(11) NOT NULL, + PRIMARY KEY (`h`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED +INSERT INTO t VALUES (REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); +CREATE INDEX idx ON t(c(100), d(20)); +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; +CREATE PROCEDURE UPDATE_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; +SET i = i + 1; +END WHILE; +END| +CREATE PROCEDURE DELETE_insert_t() +begin +DECLARE i INT DEFAULT 1; +WHILE (i <= 100) DO +DELETE FROM t WHERE h = 1; +INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); +SET i = i + 1; +END WHILE; +END| +CALL UPDATE_t(); +CALL DELETE_insert_t(); +UPDATE t SET a = NULL WHERE h=1; +START TRANSACTION; +CALL UPDATE_t(); +ROLLBACK; +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; +CREATE TABLE t(a TEXT CHARSET UTF8)ENGINE=INNODB; +ALTER TABLE t ADD COLUMN b BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +ALTER TABLE t ADD FULLTEXT INDEX (a) ; +Warnings: +Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID +ALTER TABLE t ADD INDEX (b(1)) ; +DROP TABLE t; +CREATE TABLE t(a TEXT CHARSET UTF8, FULLTEXT INDEX(a))ENGINE=INNODB; +ALTER TABLE t ADD COLUMN b BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +ALTER TABLE t ADD INDEX (b(1)) ; +DROP TABLE t; +CREATE TABLE t(a TEXT CHARSET UTF8)ENGINE=INNODB; +ALTER TABLE t ADD COLUMN FTS_DOC_ID BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +ALTER TABLE t ADD FULLTEXT INDEX (a) ; +ERROR HY000: Column 'FTS_DOC_ID' is of wrong type for an InnoDB FULLTEXT index +DROP TABLE t; +create table t (a int,b int,c int,d int,e int, +f int generated always as (a+b) virtual, +g int,h blob,i int,unique key (d,h(25))) engine=innodb; +select h from t where d is null; +h +drop table t; +create table t(a blob not null) engine=innodb; +alter table t add column b int; +alter table t add column c varbinary (1000) generated always as (a) virtual; +alter table t add unique index (c(39)); +replace into t set a = 'a',b =1; +replace into t set a = 'a',b =1; +drop table t; +CREATE TABLE t (a INT, b INT, h VARCHAR(10)); +INSERT INTO t VALUES (12, 3, "ss"); +INSERT INTO t VALUES (13, 4, "ss"); +INSERT INTO t VALUES (14, 0, "ss"); +alter table t add c INT GENERATED ALWAYS AS(a/b); +create index idx on t(c); +DROP TABLE t; +CREATE TABLE t ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int INT GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) STORED, +col_int_key INTEGER GENERATED ALWAYS AS (col_int + col_int_nokey) VIRTUAL, +col_date_nokey DATE /*! NULL */, +col_date DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) STORED, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date,interval 30 day)) VIRTUAL, +col_datetime_nokey DATETIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED, +col_time TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED, +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime, col_time_nokey)) VIRTUAL, +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time)) VIRTUAL, +col_varchar_nokey VARCHAR(1) /*! NULL */, +col_varchar VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey,col_varchar_nokey)) STORED, +col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar, 'x')) VIRTUAL, +unique KEY (pk,col_int_key), +KEY(col_int), +KEY(col_date), +KEY(col_datetime), +KEY(col_time), +KEY(col_varchar), +UNIQUE KEY (col_int_key), +KEY (col_time_key), +KEY (col_datetime_key), +UNIQUE KEY (col_int_key, col_varchar_key), +KEY (col_int_key, col_int_nokey), +KEY(col_int_key,col_date_key), +KEY(col_int_key, col_time_key), +KEY(col_int_key, col_datetime_key), +KEY(col_date_key,col_time_key,col_datetime_key), +KEY (col_varchar_key, col_varchar_nokey), +UNIQUE KEY (col_int_key, col_varchar_key, col_date_key, col_time_key, col_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB PARTITION BY KEY(col_int_key) PARTITIONS 3; +ALTER TABLE t DROP COLUMN `pk`; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `col_int_nokey` int(11) DEFAULT NULL, + `col_int` int(11) AS ((`col_int_nokey` + `col_int_nokey`)) PERSISTENT, + `col_int_key` int(11) AS ((`col_int` + `col_int_nokey`)) VIRTUAL, + `col_date_nokey` date DEFAULT NULL, + `col_date` date AS ((`col_date_nokey` + interval 30 day)) PERSISTENT, + `col_date_key` date AS ((`col_date` + interval 30 day)) VIRTUAL, + `col_datetime_nokey` datetime DEFAULT NULL, + `col_time_nokey` time DEFAULT NULL, + `col_datetime` datetime AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) PERSISTENT, + `col_time` time AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) PERSISTENT, + `col_datetime_key` datetime AS (addtime(`col_datetime`,`col_time_nokey`)) VIRTUAL, + `col_time_key` time AS (addtime(`col_datetime_nokey`,`col_time`)) VIRTUAL, + `col_varchar_nokey` varchar(1) DEFAULT NULL, + `col_varchar` varchar(2) AS (concat(`col_varchar_nokey`,`col_varchar_nokey`)) PERSISTENT, + `col_varchar_key` varchar(2) AS (concat(`col_varchar`,'x')) VIRTUAL, + UNIQUE KEY `pk` (`col_int_key`), + UNIQUE KEY `col_int_key` (`col_int_key`), + UNIQUE KEY `col_int_key_2` (`col_int_key`,`col_varchar_key`), + UNIQUE KEY `col_int_key_7` (`col_int_key`,`col_varchar_key`,`col_date_key`,`col_time_key`,`col_datetime_key`), + KEY `col_int` (`col_int`), + KEY `col_date` (`col_date`), + KEY `col_datetime` (`col_datetime`), + KEY `col_time` (`col_time`), + KEY `col_varchar` (`col_varchar`), + KEY `col_time_key` (`col_time_key`), + KEY `col_datetime_key` (`col_datetime_key`), + KEY `col_int_key_3` (`col_int_key`,`col_int_nokey`), + KEY `col_int_key_4` (`col_int_key`,`col_date_key`), + KEY `col_int_key_5` (`col_int_key`,`col_time_key`), + KEY `col_int_key_6` (`col_int_key`,`col_datetime_key`), + KEY `col_date_key` (`col_date_key`,`col_time_key`,`col_datetime_key`), + KEY `col_varchar_key` (`col_varchar_key`,`col_varchar_nokey`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (col_int_key) +PARTITIONS 3 +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +ALTER TABLE t ADD COLUMN xs INT GENERATED ALWAYS AS(a+b), ADD COLUMN mm INT +GENERATED ALWAYS AS(a+b) STORED, ALGORITHM = INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ALGORITHM = INPLACE; +ALTER TABLE t DROP COLUMN x, ALGORITHM = INPLACE; +ALTER TABLE t ADD COLUMN x1 INT GENERATED ALWAYS AS(a+b), DROP COLUMN c, +ALGORITHM = INPLACE; +DROP TABLE t; +CREATE TABLE t (a INT GENERATED ALWAYS AS(1) VIRTUAL,KEY(a)) ENGINE=INNODB; +INSERT INTO t VALUES(default); +SELECT a FROM t FOR UPDATE; +a +1 +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (x); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +SELECT x FROM t; +x +NULL +14 +19 +29 +DROP TABLE t; +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t1 VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm'); +ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE; +ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE; +Warnings: +Note 1831 Duplicate index 'idx' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release +DROP TABLE t1 ; +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t1 VALUES (11, 3, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t1 VALUES (18, 1, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t1 VALUES (28, 1, DEFAULT, DEFAULT, 'mm'); +ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST, ALGORITHM = INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +ALTER TABLE t1 CHANGE d d VARCHAR(10) GENERATED ALWAYS AS(h), ALGORITHM = INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` int(11) AS ((`a` + `b`)) VIRTUAL, + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `h` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE parent (id INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE child ( +id INT, +parent_id INT, +x int(11) GENERATED ALWAYS AS (parent_id+1), +INDEX par_ind (parent_id), +FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE +) ENGINE=INNODB; +ALTER TABLE child ADD INDEX `i1` (x); +CREATE TABLE child_1 ( +id INT, +parent_id INT, +x int(11) GENERATED ALWAYS AS (parent_id+1), +INDEX par_ind (parent_id), +FOREIGN KEY (parent_id) +REFERENCES parent(id) +) ENGINE=INNODB; +ALTER TABLE child_1 ADD INDEX `i1` (x); +DROP TABLE child_1; +DROP TABLE child; +CREATE TABLE child ( +id INT, +parent_id INT, +x int(11) GENERATED ALWAYS AS (parent_id+1), +INDEX par_ind (parent_id), +INDEX i1 (x), +FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE +) ENGINE=INNODB; +DROP TABLE child; +CREATE TABLE child ( +id INT, +parent_id INT, +x int(11) GENERATED ALWAYS AS (parent_id+1), +INDEX par_ind (parent_id), +INDEX `i1` (x) +) ENGINE=INNODB; +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE; +SET foreign_key_checks = 0; +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE; +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE SET NULL; +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON UPDATE CASCADE; +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id); +SET foreign_key_checks = 1; +DROP TABLE child; +DROP TABLE parent; +CREATE TABLE `ibstd_16` ( +`a` int(11) DEFAULT NULL, +`d` int(11) DEFAULT NULL, +`b` varchar(198) DEFAULT NULL, +`c` char(179) DEFAULT NULL, +`vadcol` int(11) GENERATED ALWAYS AS (a+length(d)) STORED, +`vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +UNIQUE KEY `b` (`b`(10),`d`), +KEY `d` (`d`), +KEY `a` (`a`), +KEY `c` (`c`(99),`b`(33)), +KEY `b_2` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `a_2` (`a`,`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=INNODB; +CREATE TABLE `ibstd_16_fk` ( +`a` int(11) DEFAULT NULL, +`d` int(11) DEFAULT NULL, +`b` varchar(198) DEFAULT NULL, +`c` char(179) DEFAULT NULL, +`vadcol` int(11) GENERATED ALWAYS AS (a+length(d)) STORED, +`vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +UNIQUE KEY `b` (`b`(10),`a`,`d`), +KEY `d` (`d`), +KEY `a` (`a`), +KEY `c` (`c`(99),`b`(33)), +KEY `b_2` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `a_2` (`a`,`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`,`d`), +CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL +) ENGINE=InnoDB; +DROP TABLE ibstd_16_fk; +CREATE TABLE `ibstd_16_fk` ( +`a` int(11) DEFAULT NULL, +`d` int(11) DEFAULT NULL, +`b` varchar(198) DEFAULT NULL, +`c` char(179) DEFAULT NULL, +`vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +UNIQUE KEY `b` (`b`(10),`a`,`d`), +KEY `d` (`d`), +KEY `a` (`a`), +KEY `c` (`c`(99),`b`(33)), +KEY `b_2` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`,`d`), +CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL +) ENGINE=InnoDB; +ALTER TABLE ibstd_16_fk ADD INDEX `a_2` (`a`,`vbidxcol`); +DROP TABLE ibstd_16_fk; +CREATE TABLE `ibstd_16_fk` ( +`a` int(11) DEFAULT NULL, +`d` int(11) DEFAULT NULL, +`b` varchar(198) DEFAULT NULL, +`c` char(179) DEFAULT NULL, +`vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, +UNIQUE KEY `b` (`b`(10),`a`,`d`), +KEY `d` (`d`), +KEY `a` (`a`), +KEY `c` (`c`(99),`b`(33)), +KEY `b_2` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `a_2` (`a`,`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=InnoDB; +ALTER TABLE `ibstd_16_fk` ADD CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL; +DROP INDEX a_2 ON ibstd_16_fk; +INSERT INTO ibstd_16 VALUES (1, 2, "aaa", "bbb", default, default, default); +INSERT INTO ibstd_16_fk VALUES(1, 3, "mmm", "SSS", default, default); +DELETE FROM ibstd_16 WHERE a = 1; +DROP TABLE ibstd_16_fk; +DROP TABLE ibstd_16; +create table t(a int) engine=innodb; +insert into t set a=1; +alter table t add column c int generated always as (1) virtual; +insert into t set a=2; +alter table t add unique index(c); +ERROR 23000: Duplicate entry '1' for key 'c' +insert into t set a=1; +drop table t; +create table t ( +x int, +a int generated always as (x) virtual, +b int generated always as (1) stored, +c int not null, +unique (b), +unique (a,b) +) engine=innodb; +insert into t(x, c) values(1, 3); +replace into t(x, c) values(1, 0); +drop table t; +CREATE TABLE t( +c7c CHAR(1)GENERATED ALWAYS AS (c3) VIRTUAL, +c1 int(1), +c2 int(1), +c3 int(1), +c4 int(1), +c5 int(1)GENERATED ALWAYS AS ((c2 - c4)) VIRTUAL, +UNIQUE KEY c5_9(c5) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE t CHANGE COLUMN c5 c5 INT(1) GENERATED ALWAYS AS(c2 - +c4)VIRTUAL AFTER c3,ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +ALTER TABLE t CHANGE COLUMN c7c c7c INT(1) GENERATED ALWAYS AS(c3) +VIRTUAL AFTER c5,ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +ALTER TABLE t DROP COLUMN c7c,ADD COLUMN c5c INT GENERATED ALWAYS AS(c4/ +c3)VIRTUAL AFTER c3,ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +DROP TABLE t; +CREATE TABLE `t` ( +`col1` int(11) DEFAULT NULL, +`col2` int(11) DEFAULT NULL, +`col4` int(11) DEFAULT NULL, +`col5` int(11) GENERATED ALWAYS AS ((`col2` % `col4`)) VIRTUAL, +`col6` int(11) GENERATED ALWAYS AS ((`col2` - `col2`)) VIRTUAL, +`col5x` int(11) GENERATED ALWAYS AS ((`col1` / `col1`)) VIRTUAL, +`col6x` int(11) GENERATED ALWAYS AS ((`col2` / `col4`)) VIRTUAL, +`col7x` int(11) GENERATED ALWAYS AS ((`col6` % `col6x`)) VIRTUAL, +`col8x` int(11) GENERATED ALWAYS AS ((`col6` / `col6`)) VIRTUAL, +`col9` text, +`col7c` int(11) GENERATED ALWAYS AS ((`col6x` % `col6x`)) VIRTUAL, +`col1b` varchar(20) GENERATED ALWAYS AS (`col1`) VIRTUAL, +`col3` int(11) DEFAULT NULL, +`col7` int(11) DEFAULT NULL, +`col5c` int(11) GENERATED ALWAYS AS ((`col5x` * `col6`)) VIRTUAL, +`col6c` varchar(20) GENERATED ALWAYS AS (`col5x`) VIRTUAL, +`col3b` bigint(20) GENERATED ALWAYS AS ((`col6x` * `col6`)) VIRTUAL, +`col1a` varchar(20) GENERATED ALWAYS AS (`col1`) VIRTUAL, +`col8` int(11) DEFAULT NULL, +UNIQUE KEY `col5` (`col5`), +UNIQUE KEY `col6x` (`col6x`), +UNIQUE KEY `col5_2` (`col5`), +KEY `idx2` (`col9`(10)), +KEY `idx4` (`col2`), +KEY `idx8` (`col9`(10),`col5`), +KEY `idx9` (`col6`), +KEY `idx6` (`col6`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +Warnings: +Note 1831 Duplicate index 'col5_2' defined on the table 'test.t'. This is deprecated and will be disallowed in a future release +Note 1831 Duplicate index 'idx6' defined on the table 'test.t'. This is deprecated and will be disallowed in a future release +ALTER TABLE t CHANGE COLUMN col3b col8a BIGINT GENERATED ALWAYS AS +(col6x * col6) VIRTUAL, ADD UNIQUE KEY uidx ( col8a ); +DROP TABLE t; +# +# Bug 22141031 - GCOLS: PURGED THREAD DIES: TRIED TO PURGE +# NON-DELETE-MARKED RECORD IN INDEX +# +create table t ( +a int,b int,c text,d int,e int,f int,g int, +h text generated always as ('1') virtual, +i int,j int,k int,l int,m int, +primary key (c(1)),unique key (c(1)), +key (i),key (h(1)) +) engine=innodb default charset latin1; +replace into t(c) values (''); +replace into t(c) values (''); +alter table t drop column d ; +drop table t; +# +# Bug 22139917 - ASSERTION: DICT_TABLE_GET_NTH_COL(USER_TABLE, NTH_COL) +# ->LEN < NEW_LEN +# +create table t ( +a int generated always as (1) virtual, +b varbinary(1), +c varbinary(1) generated always as (b) virtual +) engine=innodb; +alter table t change column b b varbinary(2), algorithm=inplace; +alter table t change column c c varbinary(2) generated always as (b) virtual, algorithm=inplace; +drop table t; +SET @@SESSION.sql_mode=0; +CREATE TABLE t( +c1 INT AUTO_INCREMENT, +c2 INT, +c3 INT GENERATED ALWAYS AS(c2 + c2)VIRTUAL, +c3k INT GENERATED ALWAYS AS(c2 + c3)VIRTUAL, +c4 DATE, +c5 DATE GENERATED ALWAYS AS(DATE_ADD(c4,interval 30 day)) VIRTUAL, +c5k DATE GENERATED ALWAYS AS(DATE_ADD(c4,interval 30 day)) VIRTUAL, +c5time_gckey DATE, +c6 TIME, +c5time DATE GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c6)) VIRTUAL, +c7 TIME GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c6)) VIRTUAL, +c5timek DATE GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c7)) VIRTUAL, +c7k TIME GENERATED ALWAYS AS(ADDTIME(c5time,c6)) VIRTUAL, +c8 CHAR(10), +c9 CHAR(20)GENERATED ALWAYS AS (CONCAT(c8,c8)) VIRTUAL, +c9k CHAR(15)GENERATED ALWAYS AS (CONCAT(c8,0)) VIRTUAL, +PRIMARY KEY(c1), +KEY(c3), +KEY(c9(10)), +UNIQUE KEY(c9k), +UNIQUE KEY(c3k,c9k(5),c5k,c7k,c5timek,c3,c9(5),c5,c7,c5time) +)ENGINE=INNODB; +INSERT INTO +t(c2,c4,c6,c5time_gckey,c8)VALUES(1,0,0,0,0),(0,0,0,0,'ityzg'),(0,0,1,0,'tyzgk +t'),(0,1,0,1,'yzgktb'),(0,0,0,0,'zgktb'),(0,0,0,0,'gktbkj'),(0,0,0,0,0),(0,0,1 +,0,1),(0,0,0,0,1),(0,0,0,0,'tbkjrkm'),(0,0,0,0,'bkjr'),(0,0,0,0,0),(0,0,0,0,0) +,(0,0,0,0,'rk'),(0,0,0,0,'kmqmknbtoe'),(1,0,0,0,'mqmknbt'),(0,1,0,0,'qmknb'),( +0,0,0,0,'mkn'),(0,0,0,0,'knbtoervql'),(0,0,1,0,1),(0,0,0,0,'nbtoerv'),(0,0,0,0 +,'btoerv'),(0,0,1,0,'toer'),(1,0,0,0,0),(0,0,0,0,'ervq'),(0,0,0,0,'rvqlzsvasu' +),(0,0,0,0,'vqlzs'),(0,0,0,0,0),(0,1,0,0,'lzsvasu'),(0,0,0,0,'zsvasurq'); +ERROR 23000: Duplicate entry '00' for key 'c9k' +SELECT +DISTINCT * FROM t +FORCE KEY(PRIMARY,c3k,c3,c9k,c9) +WHERE +(c9 IS NULL AND (c9=0)) +OR( +(c9k NOT IN ('ixfq','xfq','New Mexico','fq')OR c9 IS NULL) +) +OR(c9 BETWEEN 'hwstqua' AND 'wstquadcji' OR (c9k=0)) +AND(c3 IS NULL OR c3 IN (0,0,0)); +c1 c2 c3 c3k c4 c5 c5k c5time_gckey c6 c5time c7 c5timek c7k c8 c9 c9k +drop table t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT +GENERATED ALWAYS AS(a+b+b), e INT GENERATED ALWAYS AS(a), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, DEFAULT, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c, d); +CREATE INDEX idx1 ON t(c); +CREATE INDEX idx2 ON t(e, c, d); +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; +SELECT d FROM t; +d +NULL +17 +20 +30 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `d` int(11) AS (((`a` + `b`) + `b`)) VIRTUAL, + `e` int(11) AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + KEY `idx` (`d`), + KEY `idx2` (`e`,`d`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t DROP COLUMN d, ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +ALTER TABLE t DROP COLUMN d, ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (e), ALGORITHM=INPLACE, LOCK=NONE; +Warnings: +Note 1831 Duplicate index 'idx' defined on the table 'test.t'. This is deprecated and will be disallowed in a future release +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `e` int(11) AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + KEY `idx2` (`e`), + KEY `idx` (`e`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t ADD INDEX idx4(c, e), ADD COLUMN x VARCHAR(10) GENERATED ALWAYS AS(h), DROP INDEX idx, ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `e` int(11) AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) AS (`h`) VIRTUAL, + KEY `idx2` (`e`), + KEY `idx4` (`c`,`e`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD COLUMN j INT, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +ALTER TABLE t ADD INDEX (x), ADD COLUMN j INT, ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `e` int(11) AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) AS (`h`) VIRTUAL, + `j` int(11) DEFAULT NULL, + KEY `idx2` (`e`), + KEY `idx4` (`c`,`e`), + KEY `x` (`x`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD INDEX (i), ALGORITHM=INPLACE, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try LOCK=SHARED +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD INDEX (i), ALGORITHM=INPLACE, LOCK=SHARED; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `e` int(11) AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) AS (`h`) VIRTUAL, + `j` int(11) DEFAULT NULL, + `i` int(11) AS (((`a` + `a`) + `b`)) VIRTUAL, + KEY `idx2` (`e`), + KEY `idx4` (`c`,`e`), + KEY `x` (`x`), + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT i FROM t; +i +NULL +25 +37 +57 +SELECT * FROM t; +a b e h c x j i +11 3 11 mm 14 mm NULL 25 +18 1 18 mm 19 mm NULL 37 +28 1 28 mm 29 mm NULL 57 +NULL NULL NULL mm NULL mm NULL NULL +DROP TABLE t; +CREATE TABLE t ( +a INT, +b INT, +c INT GENERATED ALWAYS AS(a+b), +d INT GENERATED ALWAYS AS(a+b+b), +KEY vidx (c, d) +)ENGINE=INNODB; +INSERT INTO t (a,b) VALUES (0, 0), (1, NULL), (NULL, 2), (NULL, NULL); +SELECT c, d FROM t; +c d +NULL NULL +NULL NULL +NULL NULL +0 0 +SELECT * FROM t; +a b c d +0 0 0 0 +1 NULL NULL NULL +NULL 2 NULL NULL +NULL NULL NULL NULL +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; +SELECT d FROM t; +d +NULL +NULL +NULL +0 +SELECT * FROM t; +a b d +0 0 0 +1 NULL NULL +NULL 2 NULL +NULL NULL NULL +DROP TABLE t; +CREATE TABLE t ( +a INT, +b INT, +c INT GENERATED ALWAYS AS(a+b), +d INT GENERATED ALWAYS AS(a+b+b) +)ENGINE=INNODB; +INSERT INTO t (a,b) VALUES (0, 0), (1, NULL), (NULL, 2), (NULL, NULL); +SELECT * FROM t; +a b c d +0 0 0 0 +1 NULL NULL NULL +NULL 2 NULL NULL +NULL NULL NULL NULL +ALTER TABLE t DROP COLUMN c, ADD INDEX vidx(d), ALGORITHM=INPLACE; +SELECT d FROM t; +d +NULL +NULL +NULL +0 +SELECT * FROM t; +a b d +0 0 0 +1 NULL NULL +NULL 2 NULL +NULL NULL NULL +DROP TABLE t; +# +# Bug #22162200 MEMORY LEAK IN HA_INNOPART_SHARE +# ::SET_V_TEMPL PARTITIONED ON VIRTUAL COLUMN +# +create table t ( +c tinyint, +d longblob generated always as (c) virtual +) engine=innodb partition by key (c) partitions 2; +select d in(select d from t)from t group by d; +d in(select d from t) +drop table t; +# +# BUG#23052231 - ASSERTION FAILURE: ROW0MERGE.CC:2100:ADD_AUTOINC +# < DICT_TABLE_GET_N_USER_COLS +# +CREATE TABLE `t` ( +`a` int(11) NOT NULL, +`d` int(11) NOT NULL, +`b` varchar(198) NOT NULL, +`c` char(177) DEFAULT NULL, +`vadcol` int(11) GENERATED ALWAYS AS ((`a` + length(`d`))) STORED, +`vbcol` char(2) GENERATED ALWAYS AS (substr(`b`,2,2)) VIRTUAL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, +PRIMARY KEY (`b`(10),`a`,`d`), +KEY `d` (`d`), +KEY `a` (`a`), +KEY `c_renamed` (`c`(99),`b`(35)), +KEY `b` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `a_2` (`a`,`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t values (11, 1, "11", "aa", default, default, default); +ALTER TABLE t ADD COLUMN nc01128 BIGINT AUTO_INCREMENT NOT NULL, ADD KEY auto_nc01128(nc01128); +DROP TABLE t; +# +#Bug #22965271 NEEDS REBUILD FOR COLUMN LENGTH CHANGE THAT IS +#PART OF VIRTUAL INDEX. +# +CREATE TABLE t1( +a VARCHAR(45) CHARACTER SET LATIN1, +b VARCHAR(115) CHARACTER SET UTF8 GENERATED ALWAYS AS ('f1') VIRTUAL, +UNIQUE KEY (b,a))ENGINE=INNODB; +INSERT INTO t1(a) VALUES (''); +ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(85); +SELECT * FROM t1; +a b + f1 +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_blob.result b/mysql-test/suite/gcol/r/innodb_virtual_blob.result new file mode 100644 index 00000000000..f44716ea04f --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_blob.result @@ -0,0 +1,12 @@ +# +# Bug#22046353 ALTER: ASSERT PAGE_SIZE.EQUALS_TO(SPACE_PAGE_SIZE), +# BTR_COPY_BLOB_PREFIX +# +CREATE TABLE t1 +( f1 int primary key, f2 blob, +f3 blob generated always as (f2)) +row_format=compressed, engine=innodb; +insert into t1 (f1, f2) values (1, repeat('&', 50000)); +alter table t1 add index i1 (f3(200)) ; +alter table t1 row_format=compact; +drop table t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result new file mode 100644 index 00000000000..a54eda60c2d --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result @@ -0,0 +1,227 @@ +set default_storage_engine=innodb; +CREATE TABLE `t` ( +`a` VARCHAR(100), +`b` VARCHAR(100), +`c` VARCHAR(200) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`h` VARCHAR(10) DEFAULT NULL, +`i` int +) ENGINE=InnoDB; +INSERT INTO t VALUES (REPEAT('g', 100), REPEAT('x', 10), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2); +CREATE INDEX idx ON t(c(100)); +SET session debug_dbug="+d,ib_alter_add_virtual_fail"; +ALTER TABLE t ADD COLUMN x VARCHAR(200) GENERATED ALWAYS AS (a) VIRTUAL, +ALGORITHM = INPLACE; +ERROR 42000: The storage engine InnoDB can't index column `x` +ALTER TABLE t DROP COLUMN c, ALGORITHM = INPLACE; +ERROR 42000: The storage engine InnoDB can't index column `c` +SET session debug_dbug=""; +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, "mx"); +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +CREATE INDEX idx ON t(c); +connect con1,localhost,root,,; +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +update t set a=0 where a = 11; +start transaction; +update t set a=1 where a = 0; +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +SELECT c FROM t; +c +NULL +3 +19 +29 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + KEY `idx` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t; +a b c h +0 3 3 mm +18 1 19 mm +28 1 29 mm +NULL NULL NULL mx +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +ALTER TABLE t ADD COLUMN x INT; +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +start transaction; +update t set a=1 where a = 0; +rollback; +start transaction; +delete from t; +insert into t values(1,null,default,null); +rollback; +start transaction; +update t set b=b+1; +rollback; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +check table t; +Table Op Msg_type Msg_text +test.t check status OK +SELECT c FROM t; +c +NULL +3 +19 +29 +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +ALTER TABLE t ADD COLUMN x2 INT; +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +start transaction; +DELETE FROM t WHERE a = 0; +ROLLBACK; +DELETE FROM t WHERE a = 0; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +SELECT c FROM t; +c +NULL +19 +29 +disconnect con1; +DROP TABLE t; +SET DEBUG_SYNC = 'RESET'; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +CREATE INDEX idx_1 on t(c); +SET SESSION debug_dbug="+d,create_index_fail"; +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (x); +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +SET SESSION debug_dbug=""; +affected rows: 0 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + KEY `idx_1` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT c FROM t; +c +NULL +14 +19 +29 +DROP TABLE t; +# +# Bug#22018532 ASSERTION WHEN ONLINE REAPPLY REBUILD LOG ON +# MULTIPLE INDEXED VIRTUAL COLUMNS +# +create table t ( +a int as (1) virtual, +b int, +c int as (1) virtual, +unique(b), +unique(c), +key(a) +) engine=innodb; +insert ignore into t values(); +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +optimize table t; +connect con1,localhost,root,,; +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +insert ignore into t values(); +Warnings: +Warning 1062 Duplicate entry '1' for key 'c' +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +/* connection default */ optimize table t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize error Duplicate entry '1' for key 'a' +test.t optimize status Operation failed +Warnings: +Error 1062 Duplicate entry '1' for key 'a' +SELECT c FROM t; +c +1 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) AS (1) VIRTUAL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS (1) VIRTUAL, + UNIQUE KEY `b` (`b`), + UNIQUE KEY `c` (`c`), + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t; +a b c +1 NULL 1 +DROP TABLE t; +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_rebuild WAIT_FOR go_ahead'; +optimize table t; +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR start_rebuild'; +INSERT INTO t VALUES (48, 2, DEFAULT, 'xx'); +INSERT INTO t VALUES (68, 3, DEFAULT, 'sx'); +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +/* connection default */ optimize table t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize status OK +SELECT c FROM t; +c +NULL +14 +19 +29 +50 +71 +disconnect con1; +DROP TABLE t; +# +# Bug#22951879 - ASSERTS RELATED TO ONLINE DDL AND GCOL +# +create table ibstd_14 (a int not null, d int not null, b varchar(198) not null, c char(181), vadcol int as (a+length(d)) stored, vbcol char(2) as (substr(b,2,2)) virtual, vbidxcol char(3) as (substr(b,1,3)) virtual , index(d), index(a), index(vbidxcol), index(a,vbidxcol), index(vbidxcol,d), unique key (b(10), a, d), index(c(99), b(31)), index(b(5), c(10), a) , index(a,d)) engine=InnoDB stats_persistent=1 row_format=dynamic; +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +alter table ibstd_14 row_format=compressed key_block_size=4,add key kn3 (d,c,vbcol,b); +connect con1,localhost,root; +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +insert into ibstd_14 (a,d,b,c, vbidxcol, vbcol) values ('118','6',repeat('oacolaarlruoacuroauurloraarucoooarcooauoolacalllaulrruarrrucruuooclacuoouccarrcoocloccorrrrarourcooalloocooccouruolaorlcaocualolc','1'),repeat('lolrrlalcocroraaulauclaaucolcorcuooaolruaooooluooooouaoorlarucorullalcrrloccououaooaorluorraclrcooouuolocoaolcocaaculruoocucoocoooauuolarcoraraocaoolulolarru','1'),default,default); +insert into ibstd_14 (a,d,b,c, vbidxcol, vbcol) values ('118','6', 'aaaa', 'lll', default, default); +update ibstd_14 set b='11111' where b='aaaa'; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +select * from ibstd_14; +a d b c vadcol vbcol vbidxcol +118 6 oacolaarlruoacuroauurloraarucoooarcooauoolacalllaulrruarrrucruuooclacuoouccarrcoocloccorrrrarourcooalloocooccouruolaorlcaocualolc lolrrlalcocroraaulauclaaucolcorcuooaolruaooooluooooouaoorlarucorullalcrrloccououaooaorluorraclrcooouuolocoaolcocaaculruoocucoocoooauuolarcoraraocaoolulolarru 119 ac oac +118 6 11111 lll 119 11 111 +select d,c,vbcol,b from ibstd_14; +d c vbcol b +6 lll 11 11111 +6 lolrrlalcocroraaulauclaaucolcorcuooaolruaooooluooooouaoorlarucorullalcrrloccououaooaorluorraclrcooouuolocoaolcocaaculruoocucoocoooauuolarcoraraocaoolulolarru ac oacolaarlruoacuroauurloraarucoooarcooauoolacalllaulrruarrrucruuooclacuoouccarrcoocloccorrrrarourcooalloocooccouruolaorlcaocualolc +select vbcol from ibstd_14; +vbcol +11 +ac +drop table ibstd_14; +disconnect con1; +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result new file mode 100644 index 00000000000..82513c5c5ca --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -0,0 +1,141 @@ +set default_storage_engine=innodb; +set @old_dbug=@@global.debug_dbug; +CREATE TABLE `t` ( +`a` BLOB, +`b` BLOB, +`c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +`h` VARCHAR(10) DEFAULT NULL, +`i` int +) ENGINE=InnoDB; +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, "mm", 2); +CREATE INDEX idx ON t(c(100)); +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%"; +select sleep(3); +sleep(3) +0 +SET global debug_dbug=@old_dbug; +DROP TABLE t; +CREATE TABLE t ( +a TINYBLOB, +b TINYBLOB, +c TINYBLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +h VARCHAR(10) DEFAULT NULL, +i INT +) ROW_FORMAT=COMPACT ENGINE=InnoDB; +INSERT INTO t VALUES (REPEAT('g', 100), REPEAT('x', 100), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2); +CREATE INDEX idx ON t(c(100)); +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t SET a = REPEAT('m', 100) WHERE a like "aaa%"; +select sleep(3); +sleep(3) +0 +SET global debug_dbug=@old_dbug; +DROP TABLE t; +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +insert into t1 values(1, 2, default); +insert into t1 values(3, 4, default); +insert into t1 values(3, 12, default); +insert into t1 values(4, 18, default); +CREATE INDEX idx ON t1(x); +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t1 SET id = 10 WHERE id = 1; +select sleep(3); +sleep(3) +0 +SET global debug_dbug=@old_dbug; +DROP TABLE t1; +connect con1,localhost,root,,; +connection default; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3); +connection con1; +# disable purge +CREATE TABLE t0 (a INT) ENGINE=InnoDB; +BEGIN; +SELECT * FROM t0; +a +connection default; +DELETE FROM t1 WHERE a = 1; +UPDATE t1 SET a = 4, b = 4 WHERE a = 3; +INSERT INTO t1(a, b) VALUES (5, 5); +SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged'; +ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; +ERROR 0A000: LOCK=NONE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try LOCK=SHARED +ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; +# enable purge +COMMIT; +# wait for purge to process the deleted records. +Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = 3 +SET DEBUG_SYNC= 'now SIGNAL purged'; +connection default; +/* connection default */ ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + KEY `idx` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a b c +2 2 4 +4 4 8 +5 5 10 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b)); +INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4); +connection con1; +# disable purge +BEGIN; +SELECT * FROM t0; +a +connection default; +DELETE FROM t1 WHERE a = 1; +UPDATE t1 SET a = 2, b = 2 WHERE a = 5; +INSERT INTO t1(a, b) VALUES (6, 6); +SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged'; +ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; +DELETE FROM t1 WHERE a = 3; +UPDATE t1 SET a = 7, b = 7 WHERE a = 4; +INSERT INTO t1(a, b) VALUES (8, 8); +# enable purge +COMMIT; +# wait for purge to process the deleted/updated records. +SET DEBUG_SYNC= 'now SIGNAL purged'; +disconnect con1; +connection default; +/* connection default */ ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) AS ((`a` + `b`)) VIRTUAL, + KEY `idx` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a b c +2 2 4 +7 7 14 +6 6 12 +8 8 16 +DROP TABLE t0, t1; +set debug_sync=reset; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result new file mode 100644 index 00000000000..38a13edd8fa --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result @@ -0,0 +1,590 @@ +set default_storage_engine=innodb; +# +# Bug#22469130: FOREIGN KEY ON DELETE CASCADE NOT ALLOWED +# WHEN A VIRTUAL INDEX EXISTS. +# UPDATE CASCADE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# UPDATE SET NULL +CREATE TABLE t1(fld1 INT NOT NULL, fld2 INT NOT NULL PRIMARY KEY, +KEY(fld1)); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE SET NULL); +INSERT INTO t1 VALUES(1, 2); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +NULL +SELECT * FROM t2; +fld1 fld2 +NULL NULL +DROP TABLE t2, t1; +# DELETE CASCADE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +INSERT INTO t2 VALUES(1, DEFAULT); +INSERT INTO t2 VALUES(2, DEFAULT); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# DELETE SET NULL +CREATE TABLE t1(fld1 INT NOT NULL, fld2 INT NOT NULL PRIMARY KEY, KEY(fld1)); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE SET NULL); +INSERT INTO t1 VALUES(1, 1); +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1, DEFAULT); +INSERT INTO t2 VALUES(2, DEFAULT); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2 FROM t2; +fld2 +NULL +2 +SELECT * FROM t2; +fld1 fld2 +NULL NULL +2 2 +DROP TABLE t2, t1; +# VIRTUAL INDEX CONTAINS FK CONSTRAINT COLUMN +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT, fld3 INT AS (fld2) VIRTUAL, +KEY(fld3, fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 3); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +3 2 +SELECT * FROM t2; +fld1 fld2 fld3 +2 3 3 +DROP TABLE t2, t1; +# Multiple level of VIRTUAL columns. +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld3), KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT fld3 FROM t2; +fld3 +2 +SELECT * FROM t2; +fld1 fld2 fld3 +2 2 2 +DROP TABLE t2, t1; +# Drop the VIRTUAL INDEX using alter copy ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, KEY vk(fld2), +KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +3 3 +DROP TABLE t2, t1; +# Drop the VIRTUAL INDEX using INPLACE alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY vk(fld2), KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +3 3 +DROP TABLE t2, t1; +# Add the VIRTUAL INDEX using COPY alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +3 3 +DROP TABLE t2, t1; +# Add the VIRTUAL INDEX using INPLACE alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL,fld2 INT AS (fld1) VIRTUAL, +KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM= INPLACE; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +3 3 +DROP TABLE t2, t1; +# Drop the VIRTUAL INDEX contains fk constraint column +# using alter copy ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY vk(fld3, fld1), +KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 2 +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 3 +DROP TABLE t2, t1; +# Drop the VIRTUAL INDEX which contains fk constraint column +# using INPLACE alter operation +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY vk(fld3, fld1), +KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 2 +alter TABLE t2 DROP INDEX vk, ALGORITHM= INPLACE; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 3 +DROP TABLE t2, t1; +# Add the VIRTUAL INDEX contains fk constraint column +# using copy alter operatiON +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 2 +alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 3 +DROP TABLE t2, t1; +# Cascading UPDATEs and DELETEs for the multiple +# fk dependent TABLEs +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY(fld1), KEY(fld2, fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY(fld2, fld1), +FOREIGN KEY(fld1) REFERENCES t2(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2(fld1) VALUES(1), (2); +INSERT INTO t3(fld1) VALUES(1), (2); +UPDATE t1 SET fld1= 4 WHERE fld1= 1; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +4 4 +SELECT fld2, fld1 FROM t3; +fld2 fld1 +2 2 +4 4 +DROP TABLE t3, t2, t1; +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), KEY(fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), +FOREIGN KEY(fld1) REFERENCES t2(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, 1, DEFAULT), (2, 2, default); +INSERT INTO t3 VALUES(1, 1, DEFAULT), (2, 2, default); +UPDATE t1 SET fld1= 4 WHERE fld1= 1; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +1 4 +2 2 +SELECT fld3, fld1 FROM t3; +fld3 fld1 +1 4 +2 2 +DROP TABLE t3, t2, t1; +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY(fld1), KEY(fld2, fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, +KEY(fld2, fld1), FOREIGN KEY(fld1) REFERENCES t2(fld1) +ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2(fld1) VALUES(1), (2); +INSERT INTO t3(fld1) VALUES(1), (2); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2, fld1 FROM t2; +fld2 fld1 +2 2 +SELECT fld2, fld1 FROM t3; +fld2 fld1 +2 2 +DROP TABLE t3, t2, t1; +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, +KEY(fld3, fld1), KEY(fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON DELETE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), +FOREIGN KEY(fld1) REFERENCES t2(fld1) +ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, 1, DEFAULT), (2, 2, default); +INSERT INTO t3 VALUES(1, 1, DEFAULT), (2, 2, default); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 2 +SELECT fld3, fld1 FROM t3; +fld3 fld1 +2 2 +DROP TABLE t3, t2, t1; +# RENAME TABLE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY(fld2, fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +RENAME TABLE t2 to t3; +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2, fld1 FROM t3; +fld2 fld1 +2 2 +DROP TABLE t3, t1; +# FOREIGN_KEY_CHECKS disabled DURING INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 3 WHERE fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +3 +DROP TABLE t2, t1; +# GENERATED COLUMN COMPUTATION FAILS when SQL_MODE +# is set to ERROR_FOR_DIVISION_BY_ZERO +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (100/fld1) VIRTUAL, +KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +UPDATE t1 SET fld1= 0 WHERE fld1= 2; +SELECT fld2 FROM t2; +fld2 +NULL +100 +DROP TABLE t2, t1; +# CHANGE SQL_MODE and try the ERROR_FOR_DIVISION_BY_ZERO +SET sql_mode = STRICT_ALL_TABLES; +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (100/fld1) VIRTUAL, +KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +UPDATE t1 SET fld1= 0 WHERE fld1= 2; +SELECT fld2 FROM t2; +fld2 +NULL +100 +SELECT * FROM t2; +fld1 fld2 +1 100 +0 NULL +DROP TABLE t2, t1; +SET sql_mode = default; +# ADD FOREIGN CONSTRAINT USING COPY +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, KEY(fld2)); +ALTER TABLE t2 ADD FOREIGN KEY (fld1) +REFERENCES t1(fld1) ON UPDATE CASCADE, +ALGORITHM=copy; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# ADD FOREIGN CONSTRAINT USING INPLACE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, KEY(fld2)); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD FOREIGN KEY (fld1) +REFERENCES t1(fld1) ON UPDATE CASCADE, +ALGORITHM=inplace; +SET foreign_key_checks = 1; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# DROP FOREIGN CONSTRAINT USING COPY +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +CONSTRAINT fidx FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP FOREIGN KEY fidx, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; +# DROP FOREIGN CONSTRAINT USING INPLACE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, KEY(fld2), +CONSTRAINT fidx FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP FOREIGN KEY fidx, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; +# ADD VC INDEX and ADD FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 ADD INDEX(fld2), ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE, ALGORITHM=copy; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# ADD VC INDEX and ADD FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX(fld2), ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE, ALGORITHM=inplace; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# ADD VC INDEX and DROP FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 ADD INDEX(fld2), DROP FOREIGN KEY fidx, ALGORITHM=copy; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; +# ADD VC INDEX and DROP FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX(fld2), DROP FOREIGN KEY fidx, ALGORITHM=inplace; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; +# DROP VC INDEX and ADD FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY idx(fld2)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP INDEX idx, ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# DROP VC INDEX and ADD FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY idx(fld2)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP INDEX idx, ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +2 +SELECT * FROM t2; +fld1 fld2 +2 2 +DROP TABLE t2, t1; +# DROP VC INDEX and DROP FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY idx(fld2), +CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP KEY idx, DROP FOREIGN KEY fidx, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; +# DROP VC INDEX and DROP FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY idx(fld2), +CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP KEY idx, DROP FOREIGN KEY fidx, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +fld2 +1 +SELECT * FROM t2; +fld1 fld2 +1 1 +DROP TABLE t2, t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result new file mode 100644 index 00000000000..25faeaf4e84 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result @@ -0,0 +1,44 @@ +# +# Bug#22469130: FOREIGN KEY ON DELETE CASCADE NOT ALLOWED +# WHEN A VIRTUAL INDEX EXISTS. +# Add the VIRTUAL INDEX contains fk constraINT column +# using INPLACE alter operatiON +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, +fld3 INT AS (fld2) VIRTUAL, KEY(fld1), +FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 2 +alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE; +UPDATE t1 SET fld1=3; +SELECT fld3, fld1 FROM t2; +fld3 fld1 +2 3 +DROP TABLE t2, t1; +# TEMPORARY TABLE NAME and CHILD TABLE NAME are same +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2(fld1 INT NOT NULL, +fld2 INT AS (fld1) VIRTUAL, +KEY(fld2), +FOREIGN KEY(fld1) REFERENCES t1(fld1) +ON UPDATE CASCADE) engine=innodb; +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +CREATE TEMPORARY TABLE t2 (fld1 INT NOT NULL)ENGINE=INNODB; +UPDATE t1 SET fld1= 3 WHERE fld1= 2; +connect con1,localhost,root,,test; +SELECT fld2 FROM t2; +fld2 +1 +3 +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +connection default; +disconnect con1; +DROP TABLE t2; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result new file mode 100644 index 00000000000..b20c2085541 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result @@ -0,0 +1,196 @@ +# +# Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING +# THE NUMBER OF VIRTUAL COLUMNS +# +CREATE TABLE t1 (a INT, a1 INT GENERATED ALWAYS AS (a) VIRTUAL, a2 INT +GENERATED ALWAYS AS (a) VIRTUAL, a3 INT GENERATED ALWAYS AS (a) VIRTUAL, a4 +INT GENERATED ALWAYS AS (a) VIRTUAL, a5 INT GENERATED ALWAYS AS (a) VIRTUAL, +a6 INT GENERATED ALWAYS AS (a) VIRTUAL, a7 INT GENERATED ALWAYS AS (a) +VIRTUAL, a8 INT GENERATED ALWAYS AS (a) VIRTUAL, a9 INT GENERATED ALWAYS AS +(a) VIRTUAL, INDEX(a1, a2, a3, a4, a5, a6, a7, a8, a9)) ; +INSERT INTO t1(a) VALUES(10); +SELECT * FROM t1 WHERE a1=10 AND a2 = 10 AND a3 =10 AND a4 = 10 AND a5=10 AND +a6=10 AND a7=10 AND a8=10 AND a9=10; +a a1 a2 a3 a4 a5 a6 a7 a8 a9 +10 10 10 10 10 10 10 10 10 10 +DROP TABLE t1; +# +# Bug 22572997 - GCOL:INNODB: FAILING ASSERTION: N < REC_OFFS_N_FIELDS( +# OFFSETS) +# +SET @@SESSION.sql_mode=0; +CREATE TABLE t1( +c1 int(1)AUTO_INCREMENT, +c2 int(1), +c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, +c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, +c5 date, +c6 date GENERATED ALWAYS AS((c5 + interval 30 day)) VIRTUAL, +c7 DATE, +c8 time, +c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, +c10 time GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, +c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, +c12 CHAR(1), +c13 CHAR(1)GENERATED ALWAYS AS (concat(c12,c12)) VIRTUAL, +c14 CHAR(2)GENERATED ALWAYS AS (concat(c13,'x')) VIRTUAL, +PRIMARY KEY(c1), +KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE t2( +c1 int(1)AUTO_INCREMENT, +c2 int(1), +c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, +c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, +c5 date, +c6 date GENERATED ALWAYS AS((c5 + interval 30 day)) VIRTUAL, +c6a date GENERATED ALWAYS AS((c6 + interval 30 day)) VIRTUAL, +c7 DATE, +c8 time, +c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, +c10 time GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, +c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, +c11a time GENERATED ALWAYS AS(addtime(c7,c10)) VIRTUAL, +c12 CHAR(1), +c13 CHAR(2)GENERATED ALWAYS AS (concat(c12,c12)) VIRTUAL, +c14 CHAR(4)GENERATED ALWAYS AS (concat(c13,'x')) VIRTUAL, +PRIMARY KEY(c1), +KEY c13(c13), +KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2(c1,c2,c5,c7,c8,c12)VALUES (0,0,0,0,0,'v'); +CREATE TABLE t3( +c1 int(1)AUTO_INCREMENT, +c2 int(1), +c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, +c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, +c5 date, +c7 DATE, +c8 time, +c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, +c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, +c12 CHAR(1), +PRIMARY KEY(c1), +KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t3(c1,c2,c5,c7,c8,c12)VALUES +(0,0,0,0,0,'q'),(0,0,0,0,0,'g'),(0,0,0,0,0,'l'),(0,0,0,0,0,1),(0,0,0,0,0,'v'), +(0,1,0,0,0,'c'),(0,0,0,0,0,'x'); +UPDATE +t2 AS O1,t3 AS O2 +SET O1.c12=1 +WHERE O1.c14 NOT IN +( +SELECT +DISTINCT I1.c14 AS y +FROM t1 AS I1 +ORDER BY I1.c14); +SET @@SESSION.sql_mode=default; +DROP TABLE t1, t2, t3; +# +# Bug 22650296 - ASSERTION IN INNOBASE_BUILD_COL_MAP, ALTER +# +CREATE TABLE `ibstd_08` ( +`nc00577` tinyint(4) DEFAULT NULL, +`nc07844` varchar(41) DEFAULT NULL, +`gc01908` point NOT NULL, +`nc04156` char(17) DEFAULT NULL, +`nc09536` longblob NOT NULL, +`nc09231` decimal(10,0) NOT NULL, +`a` int(11) NOT NULL, +`b` varchar(198) NOT NULL, +`nc04560` mediumtext, +`c` char(187) DEFAULT NULL, +`vbidxcol` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, +`gc00881` polygon NOT NULL, +`nc05121` int(11) NOT NULL DEFAULT '85941481', +KEY `a` (`a`), +KEY `b` (`b`(3),`a`), +KEY `c` (`c`(99),`b`(25)), +KEY `b_2` (`b`(5),`c`(10),`a`), +KEY `vbidxcol` (`vbidxcol`), +KEY `a_2` (`a`,`vbidxcol`), +KEY `vbidxcol_2` (`vbidxcol`), +FULLTEXT KEY `ftsic` (`c`,`b`) +) ENGINE=InnoDB; +Warnings: +Note 1831 Duplicate index 'vbidxcol_2' defined on the table 'test.ibstd_08'. This is deprecated and will be disallowed in a future release +ALTER TABLE ibstd_08 ADD COLUMN nc07006 BIGINT AUTO_INCREMENT NOT NULL , ADD KEY auto_nc07006(nc07006); +Warnings: +Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID +DROP TABLE ibstd_08; +# +# Bug 22899305 - GCOLS: FAILING ASSERTION: !(COL->PRTYPE & 256) +# AND SEGFAULT +# +set sql_mode=""; +create table t (a int) engine=innodb; +create table s ( +b int generated always as (1) virtual, +c int, +d int generated always as (1) virtual, +key (d) +) engine=innodb; +insert into t(a) values ((select d from s for update)); +insert into s(c) values (''); +Warnings: +Warning 1366 Incorrect integer value: '' for column 'c' at row 1 +SET sql_mode = default; +drop table if exists t,s; +# +# Bug 23014521 - GCOL:INNODB: FAILING ASSERTION: !IS_V +# +CREATE TABLE t1 ( +col1 int(11) NOT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) NOT NULL, +col4 int(11) DEFAULT NULL, +col5 int(11) GENERATED ALWAYS AS ((col1 % col4)) VIRTUAL, +col6 int(11) GENERATED ALWAYS AS ((col2 - col4)) VIRTUAL, +col5x int(11) GENERATED ALWAYS AS ((col3 / col2)) VIRTUAL, +col6b varchar(20) GENERATED ALWAYS AS (col2) VIRTUAL, +col6x int(11) GENERATED ALWAYS AS ((col2 % col1)) VIRTUAL, +col7 int(11) GENERATED ALWAYS AS ((col6x + col5x)) VIRTUAL, +col8 int(11) GENERATED ALWAYS AS ((col5x / col5)) VIRTUAL, +col7x int(11) GENERATED ALWAYS AS ((col5x + col5)) VIRTUAL, +col8x int(11) GENERATED ALWAYS AS ((col5 / col5x)) VIRTUAL, +col9 text, +col2b varchar(20) GENERATED ALWAYS AS (col4) VIRTUAL, +col8a int(11) GENERATED ALWAYS AS (col2) VIRTUAL, +col4b varchar(20) GENERATED ALWAYS AS (col4) VIRTUAL, +col1c int(11) GENERATED ALWAYS AS ((col2 * col1)) VIRTUAL, +extra int(11) DEFAULT NULL, +col5c int(11) GENERATED ALWAYS AS ((col1 / col1)) VIRTUAL, +col6a bigint(20) GENERATED ALWAYS AS ((col3 / col1)) VIRTUAL, +col1a varchar(20) GENERATED ALWAYS AS (col6) VIRTUAL, +col6c int(11) GENERATED ALWAYS AS ((col2 % col2)) VIRTUAL, +col7c bigint(20) GENERATED ALWAYS AS ((col2 / col1)) VIRTUAL, +col2c int(11) GENERATED ALWAYS AS ((col5 % col5)) VIRTUAL, +col1b int(11) GENERATED ALWAYS AS ((col1 / col2)) VIRTUAL, +col3b bigint(20) GENERATED ALWAYS AS ((col6x % col6)) VIRTUAL, +UNIQUE KEY idx7 (col1,col3,col2), +UNIQUE KEY uidx (col9(10)), +KEY idx15 (col9(10) DESC,col2 DESC), +KEY idx10 (col9(10) DESC,col1 DESC), +KEY idx11 (col6x DESC), +KEY idx6 (col9(10) DESC,col7 DESC), +KEY idx14 (col6 DESC) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x) +VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +CREATE FULLTEXT INDEX idx ON t1(col9); +Warnings: +Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x) +VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace; +DROP TABLE t1; +CREATE TABLE t1 ( +col1 int(11) NOT NULL, +col2 int(11) DEFAULT NULL, +col3 int(11) NOT NULL, +col4 int(11) DEFAULT NULL) engine=innodb; +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2) +VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_purge.result new file mode 100644 index 00000000000..658f49b4b31 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_purge.result @@ -0,0 +1,140 @@ +# +# Bug#21869656 UNDO LOG DOES NOT CONTAIN ENOUGH INFORMATION +# ON INDEXED VIRTUAL COLUMNS +# +CREATE TABLE t1 (a INT, b INT, +a1 INT GENERATED ALWAYS AS (a) VIRTUAL, INDEX(a1) +) ENGINE=InnoDB; +INSERT INTO t1 (a,b) VALUES(1,1); +connect con1,localhost,root,,; +CREATE TABLE t0 (a INT) ENGINE=InnoDB; +BEGIN; +SELECT * FROM t0; +a +connection default; +UPDATE t1 SET a=0; +ALTER TABLE t1 DROP COLUMN a1, ALGORITHM=INPLACE; +ALTER TABLE t1 ADD COLUMN b1 INT GENERATED ALWAYS AS (b) VIRTUAL, ADD +INDEX(b1), +ALGORITHM=INPLACE; +connection con1; +COMMIT; +UPDATE t1 SET a=1; +connection default; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT b1 FROM t1; +b1 +1 +ALTER TABLE t1 +ADD COLUMN a1 INT GENERATED ALWAYS AS (a) VIRTUAL, +ADD COLUMN a2 INT GENERATED ALWAYS AS (a + b) VIRTUAL, +ADD COLUMN a3 INT GENERATED ALWAYS AS (a - b) VIRTUAL, +ADD COLUMN a4 INT GENERATED ALWAYS AS (a - b) VIRTUAL, +ADD INDEX(a1), ADD INDEX(a2), ADD INDEX(a3), ALGORITHM=INPLACE; +CREATE TABLE t2 ( +a BLOB, +b BLOB, +c BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +h VARCHAR(10) DEFAULT NULL +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, 'kk'); +INSERT INTO t2 VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); +CREATE INDEX idx ON t2(c(100)); +INSERT INTO t1 (a, b) VALUES(1,1); +connection con1; +BEGIN; +SELECT * FROM t0; +a +connection default; +UPDATE t1 SET a=0; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +UPDATE t1 SET b=0; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t1 DROP COLUMN a3, ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET a=2; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t1 DROP COLUMN a2, ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET b=3; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t1 ADD COLUMN b2 INT GENERATED ALWAYS AS (b) VIRTUAL, +ADD INDEX(b2), ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET b=9; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t1 ADD COLUMN b3 INT GENERATED ALWAYS AS (a) VIRTUAL, +ADD INDEX(b3), ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET b=10; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t2 DROP COLUMN c; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t2 SET a = REPEAT('s', 6000) WHERE a like 'aaa%'; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +ALTER TABLE t2 ADD COLUMN x1 BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +ADD COLUMN x2 BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +ADD INDEX(x1(100), x2(120)), ADD INDEX (x1(20)); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET a=5; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +UPDATE t2 SET a = REPEAT('m', 16000) WHERE a like 'sss%'; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +ALTER TABLE t1 DROP COLUMN b2, ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET a=6; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +ALTER TABLE t2 DROP COLUMN x1, DROP COLUMN x2, ALGORITHM=INPLACE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t2 SET a = REPEAT('x', 1000) WHERE a like 'mmm%'; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +ALTER TABLE t1 DROP INDEX b3; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +UPDATE t1 SET a=100; +affected rows: 2 +info: Rows matched: 2 Changed: 2 Warnings: 0 +connection con1; +COMMIT; +disconnect con1; +connection default; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT b1 FROM t1; +b1 +10 +10 +SELECT * FROM t1; +a b b1 a1 a4 b3 +100 10 10 100 90 100 +100 10 10 100 90 100 +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +DROP TABLE t2, t1, t0; +CREATE TABLE t1 (a VARCHAR(30), b INT, a2 VARCHAR(30) GENERATED ALWAYS AS (a) VIRTUAL); +CREATE INDEX idx ON t1(a2(10), b, a2(20)); +ERROR 42S21: Duplicate column name 'a2' +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/r/innodb_wl8114.result b/mysql-test/suite/gcol/r/innodb_wl8114.result new file mode 100644 index 00000000000..42e65101365 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_wl8114.result @@ -0,0 +1,52 @@ +CREATE TABLE t_8114 (a int) ENGINE = INNODB; +ALTER TABLE t_8114 ADD b INT GENERATED ALWAYS AS (a) VIRTUAL; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; +NAME +test/t_8114 +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); +NAME POS MTYPE PRTYPE LEN +a 0 6 1027 4 +b 65537 6 9219 4 +INSERT INTO t_8114 VALUES (9, default); +INSERT INTO t_8114 VALUES (3, default); +INSERT INTO t_8114 VALUES (1, default); +INSERT INTO t_8114 VALUES (5, default); +SELECT * FROM t_8114; +a b +9 9 +3 3 +1 1 +5 5 +DROP TABLE t_8114; +CREATE TABLE t_8114 (Column_1 CHAR(5) GENERATED ALWAYS AS (PI()+5), Column_2 CHAR(5)) engine=innodb; +SELECT NAME, FLAG, N_COLS FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; +NAME FLAG N_COLS +test/t_8114 33 4 +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); +NAME POS MTYPE PRTYPE LEN +Column_2 0 2 524542 5 +Column_1 65536 2 532734 5 +INSERT INTO t_8114 VALUES (default, "aa"); +INSERT INTO t_8114 VALUES (default, "bb"); +INSERT INTO t_8114 VALUES (default, "ee"); +INSERT INTO t_8114 VALUES (default, "pp"); +SELECT * FROM t_8114; +Column_1 Column_2 +8.142 aa +8.142 bb +8.142 ee +8.142 pp +ALTER TABLE t_8114 DROP Column_1; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; +NAME +test/t_8114 +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); +NAME POS MTYPE PRTYPE LEN +Column_2 0 2 524542 5 +SELECT * FROM t_8114; +Column_2 +aa +bb +ee +pp +DROP TABLE t_8114; diff --git a/mysql-test/suite/gcol/r/main_alter_table.result b/mysql-test/suite/gcol/r/main_alter_table.result new file mode 100644 index 00000000000..864169ee16c --- /dev/null +++ b/mysql-test/suite/gcol/r/main_alter_table.result @@ -0,0 +1,52 @@ +# +# Bug#22017616: ASSERTION FAILED: TABLE_SHARE->IS_MISSING_PRIMARY_KEY() +# == M_PREBUILT->CLUST_IND +# +# Ensure that adding indexes with virtual columns are not promoted to +# primary keys +# +# Base line with normal column - should be promoted +CREATE TABLE t0(a INT NOT NULL) ENGINE=INNODB; +ALTER TABLE t0 ADD UNIQUE INDEX (a); +# Case a: Create table with virtual unique not null column +CREATE TABLE t1(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL UNIQUE) ENGINE=INNODB; +SELECT * FROM t1; +a +# Case b: Create table with index on virtual point column +CREATE TABLE t2(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL, UNIQUE INDEX no_pk(a(1))) ENGINE=INNODB; +SELECT * FROM t2; +a +# Case c: Add unique index on virtual point column +CREATE TABLE t3(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL) +ENGINE=INNODB; +ALTER TABLE t3 ADD UNIQUE INDEX (a(1)); +SELECT * FROM t3; +a +# Case d: Add unique index on virtual blob column +CREATE TABLE t4 (a BLOB, b BLOB GENERATED ALWAYS AS (a) VIRTUAL) ENGINE=INNODB; +ALTER TABLE t4 ADD UNIQUE INDEX (b(1)); +SELECT * FROM t4; +a b +# Query I_S to verify that 'a' is promoted to pk only when it +# isn't virtual +SELECT T.NAME AS TABLE_NAME, I.NAME AS INDEX_NAME, +CASE (I.TYPE & 3) +WHEN 3 THEN "yes" + ELSE "no" END AS IS_PRIMARY_KEY, +F.NAME AS FIELD_NAME, F.POS AS FIELD_POS FROM +INFORMATION_SCHEMA.INNODB_SYS_TABLES AS T JOIN +INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS I JOIN +INFORMATION_SCHEMA.INNODB_SYS_FIELDS AS F +ON I.INDEX_ID = F.INDEX_ID AND I.TABLE_ID = T.TABLE_ID +WHERE T.NAME LIKE 'test/%'; +TABLE_NAME INDEX_NAME IS_PRIMARY_KEY FIELD_NAME FIELD_POS +test/t0 a yes a 0 +test/t1 a no a 0 +test/t2 no_pk no a 0 +test/t3 a no a 0 +test/t4 b no b 0 +DROP TABLE t0; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/gcol/r/main_mysqldump.result b/mysql-test/suite/gcol/r/main_mysqldump.result new file mode 100644 index 00000000000..78d99a0bdb0 --- /dev/null +++ b/mysql-test/suite/gcol/r/main_mysqldump.result @@ -0,0 +1,49 @@ +CREATE DATABASE dump_generated; +USE dump_generated; +CREATE TABLE t1 (pk INTEGER, a INTEGER, b INTEGER, c VARCHAR(16), +sum INTEGER GENERATED ALWAYS AS (a+b), +sub VARCHAR(4) GENERATED ALWAYS AS (SUBSTRING(c, 1, 4)), +key k1(sum), +key k2(sub) +) engine=innodb; +INSERT INTO t1(pk, a, b, c) VALUES (1, 11, 12, 'oneone'), (2, 21, 22, 'twotwo'); +SELECT * FROM t1; +pk a b c sum sub +1 11 12 oneone 23 oneo +2 21 22 twotwo 43 twot +DELETE FROM t1; +SELECT * FROM t1; +pk a b c sum sub +1 11 12 oneone 23 oneo +2 21 22 twotwo 43 twot +DELETE FROM t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t1; +SELECT * FROM t1; +pk a b c sum sub +1 11 12 oneone 23 oneo +2 21 22 twotwo 43 twot +DROP TABLE t1; +# A table with regular columns after generated +CREATE TABLE t2 (pk INTEGER, a INTEGER, b INTEGER, +sum INTEGER GENERATED ALWAYS AS (a+b), +c VARCHAR(16), +key k1(sum) +) engine=innodb; +INSERT INTO t2(pk, a, b, c) VALUES (1, 11, 12, 'oneone'), (2, 21, 22, 'twotwo'); +SELECT * FROM t2; +pk a b sum c +1 11 12 23 oneone +2 21 22 43 twotwo +DELETE FROM t2; +SELECT * FROM t2; +pk a b sum c +1 11 12 23 oneone +2 21 22 43 twotwo +DELETE FROM t2; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t2.txt' INTO TABLE t2; +SELECT * FROM t2; +pk a b sum c +1 11 12 23 oneone +2 21 22 43 twotwo +DROP TABLE t2; +DROP DATABASE dump_generated; diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test index 8c084d0b54a..c4a566c3c62 100644 --- a/mysql-test/suite/gcol/t/gcol_bugfixes.test +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -80,164 +80,113 @@ DROP TABLE t1; --echo # CREATE TABLE c ( - pk INTEGER AUTO_INCREMENT, - col_int_nokey INTEGER /*! NULL */, - col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER, + gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, + col_date_nokey DATE, + gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, + col_datetime_nokey DATETIME, + col_time_nokey TIME, + gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + col_varchar_nokey VARCHAR(1), + gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, + PRIMARY KEY (pk), + UNIQUE KEY (gcol_int_key), + UNIQUE KEY (gcol_varchar_key), + UNIQUE KEY (gcol_date_key), + KEY (gcol_time_key), + KEY (gcol_datetime_key), + UNIQUE KEY (gcol_int_key, gcol_varchar_key), + KEY (gcol_int_key, col_int_nokey), + KEY(gcol_int_key,gcol_date_key), + KEY(gcol_int_key, gcol_time_key), + KEY(gcol_int_key, gcol_datetime_key), + UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), + UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), + UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) +) ENGINE=INNODB; - col_date_nokey DATE /*! NULL */, - col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, - - col_datetime_nokey DATETIME /*! NULL */, - col_time_nokey TIME /*! NULL */, - - col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - - col_varchar_nokey VARCHAR(1) /*! NULL */, - col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, - - PRIMARY KEY (pk), - UNIQUE KEY (col_int_key), - UNIQUE KEY (col_varchar_key), - UNIQUE KEY (col_date_key), - KEY (col_time_key), - KEY (col_datetime_key), - UNIQUE KEY (col_int_key, col_varchar_key), - KEY (col_int_key, col_int_nokey), - KEY(col_int_key,col_date_key), - KEY(col_int_key, col_time_key), - KEY(col_int_key, col_datetime_key), - UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), - UNIQUE KEY (col_varchar_key, col_varchar_nokey), - UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) - ) ENGINE=INNODB; - -INSERT /*! IGNORE */ INTO c ( - col_int_nokey, - col_date_nokey, - col_time_nokey, - col_datetime_nokey, - col_varchar_nokey - ) VALUES (7, '2004-04-09', '14:03:03.042673', -'2001-11-28 00:50:27.051028', 'c'),(1, '2006-05-13', '01:46:09.016386', -'2007-10-09 19:53:04.008332', NULL); +INSERT IGNORE INTO c ( col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) +VALUES (7, '2004-04-09', '14:03:03.042673', '2001-11-28 00:50:27.051028', 'c'), + (1, '2006-05-13', '01:46:09.016386', '2007-10-09 19:53:04.008332', NULL); CREATE TABLE bb ( - pk INTEGER AUTO_INCREMENT, - col_int_nokey INTEGER /*! NULL */, - col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER, + gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, + col_date_nokey DATE, + gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, + col_datetime_nokey DATETIME, + col_time_nokey TIME, + gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + col_varchar_nokey VARCHAR(1), + gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, + PRIMARY KEY (pk), + UNIQUE KEY (gcol_int_key), + UNIQUE KEY (gcol_varchar_key), + UNIQUE KEY (gcol_date_key), + KEY (gcol_time_key), + KEY (gcol_datetime_key), + UNIQUE KEY (gcol_int_key, gcol_varchar_key), + KEY (gcol_int_key, col_int_nokey), + KEY(gcol_int_key,gcol_date_key), + KEY(gcol_int_key, gcol_time_key), + KEY(gcol_int_key, gcol_datetime_key), + UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), + UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), + UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB; - col_date_nokey DATE /*! NULL */, - col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, - - col_datetime_nokey DATETIME /*! NULL */, - col_time_nokey TIME /*! NULL */, - - col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - - col_varchar_nokey VARCHAR(1) /*! NULL */, - col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, - - PRIMARY KEY (pk), - UNIQUE KEY (col_int_key), - UNIQUE KEY (col_varchar_key), - UNIQUE KEY (col_date_key), - KEY (col_time_key), - KEY (col_datetime_key), - UNIQUE KEY (col_int_key, col_varchar_key), - KEY (col_int_key, col_int_nokey), - KEY(col_int_key,col_date_key), - KEY(col_int_key, col_time_key), - KEY(col_int_key, col_datetime_key), - UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), - UNIQUE KEY (col_varchar_key, col_varchar_nokey), - UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) - ) AUTO_INCREMENT=10 ENGINE=INNODB; - -INSERT /*! IGNORE */ INTO bb ( - col_int_nokey, - col_date_nokey, - col_time_nokey, - col_datetime_nokey, - col_varchar_nokey - ) VALUES (0, '2003-08-04', '01:48:05.048577', -'2006-11-03 00:00:00', 'p'),(2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); +INSERT IGNORE INTO bb ( col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) + VALUES (0, '2003-08-04', '01:48:05.048577', '2006-11-03 00:00:00', 'p'), + (2, '2007-11-06', '00:00:00', '2009-11-26 19:28:11.005115', 'n'); CREATE TABLE cc ( - pk INTEGER AUTO_INCREMENT, - col_int_nokey INTEGER /*! NULL */, - col_int_key INTEGER GENERATED ALWAYS AS -(col_int_nokey + col_int_nokey) VIRTUAL not null, + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER, + gcol_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, + col_date_nokey DATE, + gcol_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, + col_datetime_nokey DATETIME, + col_time_nokey TIME, + gcol_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + gcol_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + col_varchar_nokey VARCHAR(1), + gcol_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, + PRIMARY KEY (pk), + UNIQUE KEY (gcol_int_key), + UNIQUE KEY (gcol_varchar_key), + UNIQUE KEY (gcol_date_key), + KEY (gcol_time_key), + KEY (gcol_datetime_key), + UNIQUE KEY (gcol_int_key, gcol_varchar_key), + KEY (gcol_int_key, col_int_nokey), + KEY(gcol_int_key,gcol_date_key), + KEY(gcol_int_key, gcol_time_key), + KEY(gcol_int_key, gcol_datetime_key), + UNIQUE KEY(gcol_date_key,gcol_time_key,gcol_datetime_key), + UNIQUE KEY (gcol_varchar_key, col_varchar_nokey), + UNIQUE KEY (gcol_int_key, gcol_varchar_key, gcol_date_key, gcol_time_key, gcol_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB; - col_date_nokey DATE /*! NULL */, - col_date_key DATE GENERATED ALWAYS AS -(DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, - - col_datetime_nokey DATETIME /*! NULL */, - col_time_nokey TIME /*! NULL */, - - col_datetime_key DATETIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - col_time_key TIME GENERATED ALWAYS AS -(ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - - col_varchar_nokey VARCHAR(1) /*! NULL */, - col_varchar_key VARCHAR(2) GENERATED ALWAYS AS -(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, - - PRIMARY KEY (pk), - UNIQUE KEY (col_int_key), - UNIQUE KEY (col_varchar_key), - UNIQUE KEY (col_date_key), - KEY (col_time_key), - KEY (col_datetime_key), - UNIQUE KEY (col_int_key, col_varchar_key), - KEY (col_int_key, col_int_nokey), - KEY(col_int_key,col_date_key), - KEY(col_int_key, col_time_key), - KEY(col_int_key, col_datetime_key), - UNIQUE -KEY(col_date_key,col_time_key,col_datetime_key), - UNIQUE KEY (col_varchar_key, col_varchar_nokey), - UNIQUE KEY (col_int_key, col_varchar_key, -col_date_key, col_time_key, col_datetime_key) - ) AUTO_INCREMENT=10 ENGINE=INNODB; - -INSERT /*! IGNORE */ INTO cc ( - col_int_nokey, - col_date_nokey, - col_time_nokey, - col_datetime_nokey, - col_varchar_nokey - ) VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'),(NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); +INSERT IGNORE INTO cc (col_int_nokey, col_date_nokey, col_time_nokey, col_datetime_nokey, col_varchar_nokey) + VALUES (172, '2009-04-23', '00:00:00', '2000-12-07 10:17:40.013275', 'h'), + (NULL, '2002-10-06', '00:50:49.017545', NULL, 'm'); let $query= SELECT -gp1 . col_datetime_key AS g1 -FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . col_datetime_key <> gp1 . +gp1 . gcol_datetime_key AS g1 +FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . gcol_datetime_key <> gp1 . col_time_nokey ) WHERE gp1 . col_varchar_nokey IN ( SELECT -DISTINCT p1 . col_varchar_key AS p1 +DISTINCT p1 . gcol_varchar_key AS p1 FROM bb AS p1 LEFT JOIN bb AS p2 -ON ( p1 . col_int_key = p2 . pk ) +ON ( p1 . gcol_int_key = p2 . pk ) ) AND gp1 . col_varchar_nokey = 'b' HAVING g1 > 6; @@ -251,15 +200,15 @@ DROP TABLE bb, c, cc; CREATE TABLE c ( pk INTEGER AUTO_INCREMENT, col_int_nokey INTEGER NOT NULL, - col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL not null, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, col_date_nokey DATE NOT NULL, - col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL not null, + col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) VIRTUAL, col_datetime_nokey DATETIME NOT NULL, col_time_nokey TIME NOT NULL, - col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, - col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL not null, + col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, + col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) VIRTUAL, col_varchar_nokey VARCHAR(1) NOT NULL, - col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL not null, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL, PRIMARY KEY (pk,col_int_nokey), UNIQUE KEY (col_int_key), UNIQUE KEY (col_varchar_key), @@ -303,15 +252,15 @@ DROP TABLE c; CREATE TABLE t1 ( pk INTEGER AUTO_INCREMENT, - col_int_nokey INTEGER /*! NULL */, + col_int_nokey INTEGER, col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, - col_blob_nokey BLOB /*! NULL */, + col_blob_nokey BLOB, col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, - col_longblob_nokey LONGBLOB /*! NULL */, - col_longtext_nokey LONGTEXT /*! NULL */, + col_longblob_nokey LONGBLOB, + col_longtext_nokey LONGTEXT, col_longblob_key LONGBLOB GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 20)) VIRTUAL, col_longtext_key LONGTEXT GENERATED ALWAYS AS (REPEAT(col_longblob_nokey, 18)) VIRTUAL, - col_text_nokey TEXT /*! NULL */, + col_text_nokey TEXT, col_text_key TEXT GENERATED ALWAYS AS (REPEAT(col_text_nokey, 30)) VIRTUAL, PRIMARY KEY (pk), KEY (col_int_key), @@ -339,7 +288,6 @@ VALUES (5, 'bjjv', 'bjjv', 'bjjv', 'bjjv'), (0, 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu', 'jjvvkymalu'), (3, 'j', 'j', 'j', 'j'); - SELECT alias1.pk AS field1 FROM t1 AS alias1 LEFT OUTER JOIN t1 AS alias2 ON alias1.col_int_key = alias2.col_int_key @@ -357,7 +305,7 @@ DROP TABLE t1; CREATE TABLE t(a int); ALTER TABLE t ADD COLUMN b int GENERATED ALWAYS AS ( date_sub(a,interval a month)) VIRTUAL; ---error 1111 +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED ALTER TABLE t ADD COLUMN c int GENERATED ALWAYS AS (sum(a)); DROP TABLE t; @@ -487,16 +435,6 @@ SELECT DISTINCT t1.c13 FROM C AS t1, view_C AS t2; DROP TABLE C; DROP VIEW view_C; ---echo # ---echo # Bug #21808680: JSON + GENERATED COLUMN CORRUPTS TABLE CACHE ---echo # MEMORY, CRASHES ---echo # -CREATE TABLE t (a INT, b JSON, c TEXT GENERATED ALWAYS AS (REPEAT(a=b, 2))); -INSERT INTO t (a, b) VALUES (1, '2'), (3, '3'); -# The next statement used to crash. -SELECT * FROM t; -DROP TABLE t; - --echo # --echo # Bug#21810529: CRASH IN ITEM_FUNC::WALK WHEN CODE JUMPS TO GARBAGE --echo # LOCATION @@ -517,10 +455,10 @@ DROP TABLE t; --echo # CREATE TABLE t(b BLOB); ---error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_OPERAND_COLUMNS ALTER TABLE t ADD COLUMN c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL; DROP TABLE t; ---error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_OPERAND_COLUMNS CREATE TABLE t(b BLOB, c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL); --echo # @@ -552,12 +490,11 @@ DROP TABLE t1; SET @save_old_sql_mode= @@sql_mode; SET sql_mode=""; ---error ER_TRUNCATED_WRONG_VALUE CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; +DROP TABLE t; CREATE TABLE t (a INTEGER) engine=innodb; ---error ER_TRUNCATED_WRONG_VALUE ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1)); DROP TABLE t; diff --git a/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test b/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test index 285974d1ccc..68931cd0706 100644 --- a/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test +++ b/mysql-test/suite/gcol/t/gcol_column_def_options_innodb.test @@ -36,7 +36,7 @@ eval SET @@session.default_storage_engine = 'InnoDB'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines -let $support_virtual_index= 0; +let $support_virtual_index= 1; --source suite/gcol/inc/gcol_column_def_options.inc #------------------------------------------------------------------------------# diff --git a/mysql-test/suite/gcol/t/gcol_rollback.test b/mysql-test/suite/gcol/t/gcol_rollback.test index 5109012b2e2..4cd1fcc46ac 100644 --- a/mysql-test/suite/gcol/t/gcol_rollback.test +++ b/mysql-test/suite/gcol/t/gcol_rollback.test @@ -26,7 +26,8 @@ SELECT * FROM t; BEGIN; INSERT INTO t (a) VALUES (10); ---source include/kill_and_restart_mysqld.inc +--let $shutdown_timeout= 0 +--source include/restart_mysqld.inc SELECT * FROM t; DROP TABLE t; @@ -103,6 +104,7 @@ connection default; SELECT * FROM t; DROP TABLE t; +SET DEBUG_SYNC = 'RESET'; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/gcol/t/innodb_partition.test b/mysql-test/suite/gcol/t/innodb_partition.test new file mode 100644 index 00000000000..268a8c7c083 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_partition.test @@ -0,0 +1,30 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +--echo # +--echo # Bug#22444530 - GCOLS + PARTITIONED TABLE, CRASH IN +--echo # +set sql_mode=''; +create table t ( + a int not null, + b int generated always as (1) virtual, + c int generated always as (1) virtual, + key (c) +) engine=innodb partition by key (a) partitions 2; +insert into t(a) values(1); +select b from t group by c; + +drop table t; + +# Make column b a BLOB +create table t ( + a int not null, + b blob generated always as ("a") virtual, + c int generated always as (1) virtual, + key (c) +) engine=innodb partition by key (a) partitions 2; +insert into t(a) values(1); +select b from t group by c; + +drop table t; + diff --git a/mysql-test/suite/gcol/t/innodb_prefix_index_check.test b/mysql-test/suite/gcol/t/innodb_prefix_index_check.test new file mode 100644 index 00000000000..4923ead91ac --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_prefix_index_check.test @@ -0,0 +1,22 @@ +--source include/have_innodb.inc + +--echo #Bug #22445211 GCOLS: SIMPLE DML, FAILING ASSERTION: +--echo #!CURSOR->INDEX->IS_COMMITTED() + +--echo #Create and alter table examples for virtual column for full +--echo #column index followed by prefix index. + +CREATE TABLE t1( +f1 INT DEFAULT NULL, +f2 CHAR(2) GENERATED ALWAYS AS ('11') VIRTUAL, +f3 INT, +UNIQUE KEY(f1), +UNIQUE KEY(f3,f1), +KEY(f2,f1), +key(f1,f2(1)) +)ENGINE=INNODB; + +REPLACE INTO t1(f3) VALUES (1),(1); + +DROP TABLE t1; + diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test new file mode 100644 index 00000000000..342d9e42976 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test @@ -0,0 +1,1474 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +call mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual"); + +set default_storage_engine=innodb; + +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d CHAR(20), e CHAR(10) GENERATED ALWAYS AS (c), g INT); +INSERT INTO t VALUES(10, DEFAULT, "aa", "bb", DEFAULT, 20); +INSERT INTO t VALUES(11, DEFAULT, "jj", "kk", DEFAULT, 21); + +CREATE INDEX idx ON t(e) algorithm=inplace; +INSERT INTO t VALUES(12, DEFAULT, 'mm', "nn", DEFAULT, 22); + +SELECT e FROM t; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +CREATE INDEX idx ON t(c); +SELECT c FROM t; + +UPDATE t SET a = 10 WHERE a = 11; +SELECT c FROM t; + +SELECT * FROM t; + +DELETE FROM t WHERE a = 18; + +SELECT c FROM t; + +START TRANSACTION; + +INSERT INTO t VALUES (128, 22, DEFAULT, "xx"); +INSERT INTO t VALUES (1290, 212, DEFAULT, "xmx"); +ROLLBACK; + +SELECT c FROM t; +SELECT * FROM t; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); + +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); + +SELECT c FROM t; +SELECT m FROM t; +SELECT p FROM t; +SELECT * FROM t; + +update t set a = 13 where a =11; + +delete from t where a =13; + +DROP INDEX idx1 ON t; +DROP INDEX idx2 ON t; +DROP TABLE t; + +/* Test large BLOB data */ +CREATE TABLE `t` ( + `a` BLOB, + `b` BLOB, + `c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + `h` VARCHAR(10) DEFAULT NULL +) ENGINE=InnoDB; + +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, "kk"); + +CREATE INDEX idx ON t(c(100)); + +SELECT length(c) FROM t; + +START TRANSACTION; + +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); + +ROLLBACK; + +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); + +START TRANSACTION; + +UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%"; + +ROLLBACK; + +# This SELECT did not give correct answer, even though InnoDB return +# all qualified rows +SELECT COUNT(*) FROM t WHERE c like "aaa%"; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); + +START TRANSACTION; + +UPDATE t SET a = 100 WHERE a = 11; + +UPDATE t SET a =22 WHERE a = 18; + +UPDATE t SET a = 33 WHERE a = 22; + +SELECT c FROM t; + +ROLLBACK; + +SELECT c FROM t; +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c); +SELECT c FROM t; + +connect(con1,localhost,root,,test); +START TRANSACTION; +SELECT c FROM t; + +connection default; +UPDATE t SET a = 19 WHERE a = 11; + +# this should report the same value as previous one (14, 19, 29). +connection con1; +SELECT c FROM t; + +ROLLBACK; + +SELECT c FROM t; + +connection default; +disconnect con1; + +DROP TABLE t; + +# CREATE a more complex TABLE +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + x), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, y)), x INT, y CHAR(20), z INT, INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); + +INSERT INTO t VALUES(1, 2, DEFAULT, "hhh", 3, DEFAULT, "nnn", DEFAULT, 4, "yyy", 5); + +INSERT INTO t VALUES(2, 3, DEFAULT, "hhha", 4, DEFAULT, "nnna", DEFAULT, 5, "yyya", 6); + +INSERT INTO t VALUES(12, 13, DEFAULT, "hhhb", 14, DEFAULT, "nnnb", DEFAULT, 15, "yyyb", 16); + +# CREATE an INDEX ON multiple virtual COLUMN +CREATE INDEX idx6 ON t(p, c); + +SELECT p, c FROM t; + +START TRANSACTION; +INSERT INTO t VALUES(32, 33, DEFAULT, "hhhb", 34, DEFAULT, "nnnb", DEFAULT, 35, "yyyb", 36); +ROLLBACK; + +UPDATE t SET a = 100 WHERE a = 1; + +START TRANSACTION; +UPDATE t SET a = 1 WHERE a = 100; +ROLLBACK; + +DROP TABLE t; + +CREATE TABLE t1(a INT); +ALTER TABLE t1 add COLUMN (b INT generated always as (a+1) virtual, c INT as(5) virtual); +ALTER TABLE t1 add COLUMN (d INT generated always as (a+1) virtual, e INT as(5) virtual); + +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; + +#--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +ALTER TABLE t1 add COLUMN (f INT generated always as (a+1) virtual, g INT as(5) virtual), DROP COLUMN e; + +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; + +DROP TABLE t1; + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(1); + +ALTER TABLE t1 add COLUMN (f INT generated always as (a+1) virtual, g INT ); + +# Inplace ADD/DROP virtual COLUMNs can only go with their own for +# inplace algorithm, not to combine with other operations, except create index +ALTER TABLE t1 add COLUMN (h INT generated always as (a+1) virtual), add INDEX idx (h), algorithm=inplace; + +--enable_info +ALTER TABLE t1 add COLUMN (h1 INT generated always as (a+1) virtual), add INDEX idx1 (h1); +--disable_info + +ALTER TABLE t1 DROP COLUMN h1, DROP INDEX idx; + +DROP TABLE t1; + +# Virtual COLUMN cannot be INDEXed +CREATE TABLE t1(a INT); +CREATE INDEX idx ON t1(a); +CREATE TABLE t3(a INT, b INT , INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a)); +--error ER_CANT_CREATE_TABLE +CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a)); +CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b)); +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1(a INT); +ALTER TABLE t1 add COLUMN (b INT generated always as (a+1) virtual, c INT as(5) virtual); + +ALTER TABLE t1 change b x INT generated always as (a+1) virtual; + +SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; + +DROP TABLE t1; + +# We do not support Fulltext or Spatial INDEX ON Virtual Columns +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a), fulltext INDEX idx (b)); +CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a)); +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +ALTER TABLE t ADD FULLTEXT INDEX (b); +DROP TABLE t; + +--error ER_SPATIAL_CANT_HAVE_NULL +CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a), spatial INDEX idx (b)); +CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a)); +--error ER_SPATIAL_CANT_HAVE_NULL +ALTER TABLE t ADD SPATIAL INDEX (b); +DROP TABLE t; + +#test DEFAULT value +CREATE TABLE t (a INT DEFAULT 1, b INT DEFAULT 2, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); +CREATE INDEX idx ON t(c); +INSERT INTO t(h)VALUES ('mm'); +SELECT c FROM t; + +CREATE unique INDEX idx1 ON t(c); + +--error ER_DUP_ENTRY +INSERT INTO t(h)VALUES ('mm'); + +DROP TABLE t; + +CREATE TABLE `t1` ( `a` INT(11) DEFAULT NULL, `b` INT(11) DEFAULT NULL, `c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, `x` INT(11) NOT NULL, `h` VARCHAR(10) DEFAULT NULL, PRIMARY KEY (`x`), KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES (1, 2, DEFAULT, 3, 'mm'); +INSERT INTO t1 VALUES (11, 22, DEFAULT, 23, 'mm'); + +connect(con1,localhost,root,,test); +UPDATE t1 SET x = 4 WHERE x =3; +DROP TABLE t1; + +CREATE TABLE `t1` ( `a` INT(11) DEFAULT NULL, `b` INT(11) DEFAULT NULL, `c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, `x` INT(11) NOT NULL, `h` VARCHAR(10) DEFAULT NULL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES (1, 2, DEFAULT, 3, 'mm'); +INSERT INTO t1 VALUES (11, 22, DEFAULT, 23, 'mm'); + +START TRANSACTION; +SELECT * FROM t1; + +connection con1; +START TRANSACTION; +UPDATE t1 SET x = 15 WHERE x = 3; + +UPDATE t1 SET b = 10 WHERE b=2; +ROLLBACK; + +connection default; +SELECT c FROM t1; + +disconnect con1; + +DROP TABLE t1; + +CREATE TABLE `t` ( + `a` INT(11) DEFAULT NULL, + `b` INT(11) DEFAULT NULL, + `c` INT(11) GENERATED ALWAYS AS (a+b) VIRTUAL, + `d` INT(11) GENERATED ALWAYS AS (a) VIRTUAL, + `h` INT(11) NOT NULL, + PRIMARY KEY (`h`), + KEY `idx` (`c`) +) ENGINE=InnoDB; + +INSERT INTO t VALUES (11, 3, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (18, 1, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (28, 1, DEFAULT, DEFAULT, 3); +INSERT INTO t VALUES (null, null, DEFAULT, DEFAULT, 4); + +delimiter |; +CREATE PROCEDURE UPDATE_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 2000) DO + UPDATE t SET a = 100 + i WHERE h = 1; + SET i = i + 1; + END WHILE; +END| + +CREATE PROCEDURE DELETE_insert_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 2000) DO + UPDATE t SET a = 100 + i WHERE h = 1; + SET i = i + 1; + END WHILE; +END| +delimiter ;| + +CALL UPDATE_t(); +SELECT c FROM t; + +CALL DELETE_insert_t(); +SELECT c FROM t; + +DROP INDEX idx ON t; +CALL UPDATE_t(); +SELECT c FROM t; + +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; + +DROP TABLE t; + +--echo # Bug#20767937: WL8149:ASSERTION FAILED IN ROW_UPD_SEC_INDEX_ENTRY +CREATE TABLE b ( +col_INT_nokey INTEGER NOT NULL, +col_INT_key INTEGER GENERATED ALWAYS AS (col_INT_nokey) VIRTUAL, +col_date_nokey DATE, +col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey, + INTerval 30 day)) VIRTUAL, + +col_datetime_nokey DATETIME NOT NULL, +col_time_nokey TIME NOT NULL, + +col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, + col_time_nokey)), +col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, + col_time_nokey)), + +col_VARCHAR_nokey VARCHAR(1) NOT NULL, +col_VARCHAR_key VARCHAR(2) GENERATED ALWAYS AS(CONCAT(col_VARCHAR_nokey, + col_VARCHAR_nokey)), + +KEY (col_INT_key), +KEY (col_VARCHAR_key), +KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_INT_key, col_VARCHAR_key), +KEY (col_INT_key, col_VARCHAR_key, col_date_key, +col_time_key, col_datetime_key) +); +INSERT INTO b ( + col_INT_nokey, + col_date_nokey, + col_time_nokey, + col_datetime_nokey, + col_VARCHAR_nokey +) VALUES +(0, NULL, '21:22:34.025509', '2002-02-13 17:30:06.013935', 'j'), +(8, '2004-09-18', '10:50:38.059966', '2008-09-27 +00:34:58.026613', 'v'); + +EXPLAIN SELECT col_INT_key FROM b; +SELECT col_INT_key FROM b; +SELECT col_INT_nokey, col_INT_key FROM b; +DELETE FROM b; + +DROP TABLE b; + +let $row_format=COMPACT; +--source inc/innodb_v_large_col.inc + +CREATE TABLE `t` ( + `a` BLOB, + `b` BLOB, + `c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + `d` BLOB GENERATED ALWAYS AS (b) VIRTUAL, + `e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, + `h` INT(11) NOT NULL, + PRIMARY KEY (`h`) +) ENGINE=InnoDB; + +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, DEFAULT, DEFAULT, 1); +INSERT INTO t VALUES (REPEAT('a', 32000), REPEAT('b', 11000), DEFAULT, DEFAULT, DEFAULT, 2); +INSERT INTO t VALUES (REPEAT('m', 18000), REPEAT('n', 46000), DEFAULT, DEFAULT, DEFAULT, 3); + +CREATE INDEX idx ON t(c(100), d(20)); + +UPDATE t SET a = NULL WHERE h=1; + +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 2000) WHERE h = 1; + +UPDATE t SET a = REPEAT(CAST(1 AS CHAR), 1000) WHERE h = 1; + +delimiter |; + +CREATE PROCEDURE UPDATE_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 200) DO + UPDATE t SET a = REPEAT(CAST(i AS CHAR), 2000) WHERE h = 1; + SET i = i + 1; + END WHILE; +END| + +CREATE PROCEDURE DELETE_insert_t() +begin + DECLARE i INT DEFAULT 1; + WHILE (i <= 200) DO + DELETE FROM t WHERE h = 1; + INSERT INTO t VALUES (REPEAT(CAST(i AS CHAR), 2000) , REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 1); + SET i = i + 1; + END WHILE; +END| +delimiter ;| + +CALL UPDATE_t(); +CALL DELETE_insert_t(); + +UPDATE t SET a = NULL WHERE h=1; + +DROP PROCEDURE DELETE_insert_t; +DROP PROCEDURE UPDATE_t; +DROP TABLE t; + +CREATE TABLE `t` ( + `m1` INT(11) DEFAULT NULL, + `m2` INT(11) DEFAULT NULL, + `m3` INT(11) GENERATED ALWAYS AS (m1 + m2) VIRTUAL, + `m4` INT(11) DEFAULT NULL, + `m5` CHAR(10) DEFAULT NULL, + `m6` CHAR(12) GENERATED ALWAYS AS (m5) VIRTUAL, + `a` VARCHAR(10000) DEFAULT NULL, + `b` VARCHAR(3000) DEFAULT NULL, + `c` VARCHAR(14000) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + `d` VARCHAR(5000) GENERATED ALWAYS AS (b) VIRTUAL, + `e` INT(11) GENERATED ALWAYS AS (10) VIRTUAL, + `h` INT(11) NOT NULL, + PRIMARY KEY (`h`), + KEY `m3` (`m3`), + KEY `c` (`c`(100)), + KEY `e` (`e`,`d`(20)) +) ENGINE=InnoDB; + +INSERT INTO t VALUES (1, 2, DEFAULT, 3, "aaa", DEFAULT, REPEAT('g', 10000), REPEAT('x', 2800), DEFAULT, DEFAULT, DEFAULT, 1); + +INSERT INTO t VALUES (11, 21, DEFAULT, 31, "bbb", DEFAULT, REPEAT('a', 9000), REPEAT('b', 2000), DEFAULT, DEFAULT, DEFAULT, 2); + +INSERT INTO t VALUES (21, 31, DEFAULT, 41, "zzz", DEFAULT, REPEAT('m', 8000), REPEAT('n', 3000), DEFAULT, DEFAULT, DEFAULT, 3); + +ALTER TABLE t DROP COLUMN c; + +DELETE FROM t; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +CREATE INDEX idx ON t(a, c); +SELECT a, c FROM t; + +START TRANSACTION; + +UPDATE t SET a = 13 where a = 11; + +ROLLBACK; +DELETE FROM t; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), m int); + +INSERT INTO t VALUES (11, 3, DEFAULT, "a", 1); +INSERT INTO t VALUES (18, 1, DEFAULT, "b", 2); +INSERT INTO t VALUES (28, 1, DEFAULT, "c", 3 ); +INSERT INTO t VALUES (null, null, DEFAULT, "d", 4); + +CREATE INDEX idx ON t(a, c, h); +SELECT a, c FROM t; + +START TRANSACTION; +UPDATE t SET m =10 WHERE m = 1; +UPDATE t SET h = "e" WHERE h="a"; +ROLLBACK; +SELECT a, c, h FROM t; + +DROP TABLE t; + +# bug#21065137 - WL8149:FAILING ASSERTION: NAME_OFS < FULL_LEN +CREATE TABLE `t1` ( + `col1` int(11) NOT NULL, + `col2` int(11) NOT NULL, + `col3` int(11) NOT NULL, + `col4` int(11) DEFAULT NULL, + `col5` int(11) GENERATED ALWAYS AS (col2 % col3) VIRTUAL, + `col7` int(11) GENERATED ALWAYS AS (col5 * col5) VIRTUAL, + `col8` int(11) GENERATED ALWAYS AS (col5 % col5) VIRTUAL, + `col9` text, + `extra` int(11) DEFAULT NULL, + UNIQUE KEY `uidx` (`col5`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +ALTER TABLE t1 CHANGE COLUMN extra col6 INT; + +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# No spatial and FTS index on virtual columns +--error ER_SPATIAL_CANT_HAVE_NULL +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c point, d point GENERATED ALWAYS AS (c), spatial index idx (d)); + +--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d char(20) GENERATED ALWAYS AS (c), fulltext index idx (d)); + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); + +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); + +alter table t add x int, add xx int generated ALWAYS AS(x); + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); + +INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); +INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); +INSERT INTO t VALUES(3, 4, DEFAULT, "uooo", 1, DEFAULT, "umm", DEFAULT); + +ALTER TABLE t DROP COLUMN c, algorithm=inplace; +ALTER TABLE t DROP COLUMN p, ADD COLUMN s VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), algorithm=inplace; + +# This should fail +#ALTER TABLE t ADD x INT, DROP COLUMN m, algorithm=inplace; +SELECT s FROM t; + +ALTER TABLE t ADD x VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), ADD INDEX idx (x), algorithm=inplace; +DROP TABLE t; + +CREATE TABLE `t1` ( + `col1` int(11) DEFAULT NULL, + `col2` int(11) DEFAULT NULL, + `col3` int(11) DEFAULT NULL, + `col4` int(11) DEFAULT NULL, + `col5` int(11) GENERATED ALWAYS AS (col4 * col2) VIRTUAL, + `col6` int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL, + `col7` int(11) GENERATED ALWAYS AS (col5 / col6) VIRTUAL, + `col8` int(11) GENERATED ALWAYS AS (col5 + col5) VIRTUAL, + `col9` text, + `extra` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +ALTER TABLE t1 DROP COLUMN col7; + +DROP TABLE t1; + +CREATE TABLE t1 ( + col1 INTEGER NOT NULL, + gv_col INTEGER GENERATED ALWAYS AS (col1) VIRTUAL, + txt1 TEXT, + FULLTEXT INDEX fi(txt1) +); + +select * from t1; + +DROP TABLE t1; + +CREATE TABLE t1 ( + col1 INTEGER NOT NULL, + col2 INTEGER NOT NULL, + col3 INTEGER DEFAULT NULL, + col4 INTEGER DEFAULT NULL, + col5 INTEGER DEFAULT NULL, + col6 INTEGER DEFAULT NULL, + col7 INTEGER DEFAULT NULL, + col8 INTEGER DEFAULT NULL, + col9 INTEGER DEFAULT NULL, + col10 INTEGER DEFAULT NULL, + col11 INTEGER DEFAULT NULL, + col12 INTEGER DEFAULT NULL, + col13 INTEGER DEFAULT NULL, + col14 INTEGER DEFAULT NULL, + col15 INTEGER DEFAULT NULL, + col16 INTEGER DEFAULT NULL, + col17 INTEGER DEFAULT NULL, + col18 INTEGER DEFAULT NULL, + col19 INTEGER DEFAULT NULL, + col20 INTEGER DEFAULT NULL, + col21 INTEGER DEFAULT NULL, + col22 INTEGER DEFAULT NULL, + col23 INTEGER DEFAULT NULL, + col24 INTEGER DEFAULT NULL, + col25 INTEGER DEFAULT NULL, + col26 INTEGER DEFAULT NULL, + col27 INTEGER DEFAULT NULL, + col28 INTEGER DEFAULT NULL, + col29 INTEGER DEFAULT NULL, + col30 INTEGER DEFAULT NULL, + col31 INTEGER DEFAULT NULL, + col32 INTEGER DEFAULT NULL, + col33 INTEGER DEFAULT NULL, + gcol1 INTEGER GENERATED ALWAYS AS (col1 + col2) VIRTUAL, + KEY idx1 (gcol1) +); + +INSERT INTO t1 (col1, col2) + VALUES (0,1), (1,2), (2,3), (3,4), (4,5); + +SELECT gcol1 FROM t1 FORCE INDEX(idx1); + +ALTER TABLE t1 ADD COLUMN extra INTEGER; + +SELECT gcol1 FROM t1 FORCE INDEX(idx1); + +DROP TABLE t1; + +CREATE TABLE t1 ( + id INT NOT NULL, + store_id INT NOT NULL, + x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( + PARTITION p0 VALUES LESS THAN (6), + PARTITION p1 VALUES LESS THAN (11), + PARTITION p2 VALUES LESS THAN (16), + PARTITION p3 VALUES LESS THAN (21) +); + +INSERT INTO t1 VALUES(1, 2, default); +INSERT INTO t1 VALUES(3, 4, default); + +INSERT INTO t1 VALUES(3, 12, default); +INSERT INTO t1 VALUES(4, 18, default); + +CREATE INDEX idx ON t1(x); + +SELECT x FROM t1; + +DROP TABLE t1; + +CREATE TABLE t1 ( + id INT NOT NULL, + store_id INT NOT NULL, + x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (x) ( + PARTITION p0 VALUES LESS THAN (6), + PARTITION p1 VALUES LESS THAN (11), + PARTITION p2 VALUES LESS THAN (16), + PARTITION p3 VALUES LESS THAN (21) +); + +insert into t1 values(1, 2, default); +insert into t1 values(3, 4, default); + +insert into t1 values(3, 12, default); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +insert into t1 values(4, 18, default); + +CREATE INDEX idx ON t1(x); +SELECT x FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a+1) ,c int) PARTITION BY RANGE (b) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) ); + +INSERT INTO t1 VALUES (10,DEFAULT,2); +INSERT INTO t1 VALUES (19,DEFAULT,8); + +CREATE INDEX idx ON t1 (b); + +INSERT INTO t1 VALUES (5,DEFAULT,9); + +SELECT * FROM t1; + +ALTER TABLE t1 REMOVE PARTITIONING; + +DROP TABLE t1; + +CREATE TABLE `t#P#1` (a INT, bt INT GENERATED ALWAYS AS (a+1) ,c int) +PARTITION BY RANGE (bt) +subpartition by hash (bt) + ( + PARTITION p0 VALUES LESS THAN (6) ( + SUBPARTITION s0, + SUBPARTITION s1), + PARTITION p1 VALUES LESS THAN (11) ( + SUBPARTITION s2, + SUBPARTITION s3), + PARTITION p2 VALUES LESS THAN (16) ( + SUBPARTITION s4, + SUBPARTITION s5), + PARTITION p3 VALUES LESS THAN (21) ( + SUBPARTITION s6, + SUBPARTITION s7) + ); +insert into `t#P#1` values (10,DEFAULT,2); +insert into `t#P#1` values (19,DEFAULT,8); +create index idx on `t#P#1` (bt); +insert into `t#P#1` values (5,DEFAULT,9); +select * from `t#P#1`; +alter table `t#P#1` remove partitioning; +drop table `t#P#1`; + +let $row_format=DYNAMIC; +--source inc/innodb_v_large_col.inc + +let $row_format=REDUNDANT; +--source inc/innodb_v_large_col.inc + +let $row_format=COMPRESSED; +--source inc/innodb_v_large_col.inc + +# Make sure FTS_DOC_ID for FULLTEXT index set with correct column id with +# virtual columns +CREATE TABLE t(a TEXT CHARSET UTF8)ENGINE=INNODB; +ALTER TABLE t ADD COLUMN b BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +ALTER TABLE t ADD FULLTEXT INDEX (a) ; +ALTER TABLE t ADD INDEX (b(1)) ; + +DROP TABLE t; + +CREATE TABLE t(a TEXT CHARSET UTF8, FULLTEXT INDEX(a))ENGINE=INNODB; +ALTER TABLE t ADD COLUMN b BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +ALTER TABLE t ADD INDEX (b(1)) ; +DROP TABLE t; + +# Virtual column cannot be used as DOC ID column for FULLTEXT index +CREATE TABLE t(a TEXT CHARSET UTF8)ENGINE=INNODB; +ALTER TABLE t ADD COLUMN FTS_DOC_ID BLOB GENERATED ALWAYS AS (a) VIRTUAL ; +--error ER_INNODB_FT_WRONG_DOCID_COLUMN +ALTER TABLE t ADD FULLTEXT INDEX (a) ; +DROP TABLE t; + +# Test uses ICP on column h and d +create table t (a int,b int,c int,d int,e int, +f int generated always as (a+b) virtual, +g int,h blob,i int,unique key (d,h(25))) engine=innodb; + +select h from t where d is null; +drop table t; + +# Test Add virtual column of MySQL long true type +create table t(a blob not null) engine=innodb; +alter table t add column b int; +alter table t add column c varbinary (1000) generated always as (a) virtual; +alter table t add unique index (c(39)); +replace into t set a = 'a',b =1; +replace into t set a = 'a',b =1; +drop table t; + +CREATE TABLE t (a INT, b INT, h VARCHAR(10)); +INSERT INTO t VALUES (12, 3, "ss"); +INSERT INTO t VALUES (13, 4, "ss"); +INSERT INTO t VALUES (14, 0, "ss"); +alter table t add c INT GENERATED ALWAYS AS(a/b); +create index idx on t(c); +DROP TABLE t; + +CREATE TABLE t ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int INT GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) STORED, + col_int_key INTEGER GENERATED ALWAYS AS (col_int + col_int_nokey) VIRTUAL, + col_date_nokey DATE /*! NULL */, + col_date DATE GENERATED ALWAYS AS (DATE_ADD(col_date_nokey,interval 30 day)) STORED, + col_date_key DATE GENERATED ALWAYS AS (DATE_ADD(col_date,interval 30 day)) VIRTUAL, + col_datetime_nokey DATETIME /*! NULL */, + col_time_nokey TIME /*! NULL */, + col_datetime DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED, + col_time TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time_nokey)) STORED, + col_datetime_key DATETIME GENERATED ALWAYS AS (ADDTIME(col_datetime, col_time_nokey)) VIRTUAL, + col_time_key TIME GENERATED ALWAYS AS (ADDTIME(col_datetime_nokey, col_time)) VIRTUAL, + col_varchar_nokey VARCHAR(1) /*! NULL */, + col_varchar VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar_nokey,col_varchar_nokey)) STORED, + col_varchar_key VARCHAR(2) GENERATED ALWAYS AS (CONCAT(col_varchar, 'x')) VIRTUAL, + unique KEY (pk,col_int_key), + KEY(col_int), + KEY(col_date), + KEY(col_datetime), + KEY(col_time), + KEY(col_varchar), + UNIQUE KEY (col_int_key), + KEY (col_time_key), + KEY (col_datetime_key), + UNIQUE KEY (col_int_key, col_varchar_key), + KEY (col_int_key, col_int_nokey), + KEY(col_int_key,col_date_key), + KEY(col_int_key, col_time_key), + KEY(col_int_key, col_datetime_key), + KEY(col_date_key,col_time_key,col_datetime_key), + KEY (col_varchar_key, col_varchar_nokey), + UNIQUE KEY (col_int_key, col_varchar_key, col_date_key, col_time_key, col_datetime_key) +) AUTO_INCREMENT=10 ENGINE=INNODB PARTITION BY KEY(col_int_key) PARTITIONS 3; + +ALTER TABLE t DROP COLUMN `pk`; + +SHOW CREATE TABLE t; + +DROP TABLE t; + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t ADD COLUMN xs INT GENERATED ALWAYS AS(a+b), ADD COLUMN mm INT +GENERATED ALWAYS AS(a+b) STORED, ALGORITHM = INPLACE; + +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ALGORITHM = INPLACE; + +ALTER TABLE t DROP COLUMN x, ALGORITHM = INPLACE; + +ALTER TABLE t ADD COLUMN x1 INT GENERATED ALWAYS AS(a+b), DROP COLUMN c, +ALGORITHM = INPLACE; + +DROP TABLE t; + +if (0) { +# Some test on virtual/stored column numbering for spatial indexing +CREATE TABLE `t` ( + `a` INT GENERATED ALWAYS AS (1) VIRTUAL, + `b` INT GENERATED ALWAYS AS (1) VIRTUAL, + `c` INT GENERATED ALWAYS AS (1) VIRTUAL, + `d` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e` POINT GENERATED ALWAYS AS (1) STORED +) ENGINE=INNODB; +ALTER TABLE t ADD SPATIAL INDEX (`e`); +DROP TABLE t; +CREATE TABLE `t` ( + `a` INT GENERATED ALWAYS AS (1) VIRTUAL, + `b` INT GENERATED ALWAYS AS (1) VIRTUAL, + `c` INT GENERATED ALWAYS AS (1) VIRTUAL, + `d` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e` POINT GENERATED ALWAYS AS (1) STORED, + SPATIAL INDEX (`e`) +) ENGINE=INNODB; +DROP TABLE t; +CREATE TABLE `t` ( + `a` INT GENERATED ALWAYS AS (1) VIRTUAL, + `b` INT GENERATED ALWAYS AS (1) VIRTUAL, + `c` INT GENERATED ALWAYS AS (1) VIRTUAL, + `d` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e2` POINT GENERATED ALWAYS AS (1) STORED, + `e` POINT GENERATED ALWAYS AS (1) STORED +) ENGINE=INNODB; +ALTER TABLE t ADD SPATIAL INDEX (`e`); +DROP TABLE t; +CREATE TABLE `t` ( + `a` INT GENERATED ALWAYS AS (1) VIRTUAL, + `b` INT GENERATED ALWAYS AS (1) VIRTUAL, + `c` INT GENERATED ALWAYS AS (1) VIRTUAL, + `d` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e2` POINT GENERATED ALWAYS AS (1) STORED, + `d2` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e` POINT GENERATED ALWAYS AS (1) STORED +) ENGINE=INNODB; +ALTER TABLE t ADD SPATIAL INDEX (`e`); +DROP TABLE t; +CREATE TABLE `t` ( + `a` INT GENERATED ALWAYS AS (1) VIRTUAL, + `b` INT GENERATED ALWAYS AS (1) VIRTUAL, + `c` INT GENERATED ALWAYS AS (1) VIRTUAL, + `d` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e2` POINT GENERATED ALWAYS AS (1) STORED, + `d2` INT GENERATED ALWAYS AS (1) VIRTUAL, + `e` int +) ENGINE=INNODB; +ALTER TABLE t ADD INDEX (`e`); +DROP TABLE t; +} + +CREATE TABLE t (a INT GENERATED ALWAYS AS(1) VIRTUAL,KEY(a)) ENGINE=INNODB; +INSERT INTO t VALUES(default); +SELECT a FROM t FOR UPDATE; +DROP TABLE t; + +# Test add virtual column and add index at the same time +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); + +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); + +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); + +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +--enable_info +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (x); +--disable_info + +SELECT x FROM t; + +DROP TABLE t; + +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t1 VALUES (11, 3, DEFAULT, 'mm'); + +INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm'); + +INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm'); + +ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE; +ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE; + +DROP TABLE t1 ; + +# Check ALTER TABLE CHANGE VIRTUAL COLUMN TYPE and ORDER +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t1 VALUES (11, 3, DEFAULT, DEFAULT, 'mm'); + +INSERT INTO t1 VALUES (18, 1, DEFAULT, DEFAULT, 'mm'); + +INSERT INTO t1 VALUES (28, 1, DEFAULT, DEFAULT, 'mm'); + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST, ALGORITHM = INPLACE; + +# Change column type is not allow for inplace also +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t1 CHANGE d d VARCHAR(10) GENERATED ALWAYS AS(h), ALGORITHM = INPLACE; + +ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST; + +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# Test foreign key which could be a base column of indexed virtual column +CREATE TABLE parent (id INT PRIMARY KEY) ENGINE=INNODB; + +CREATE TABLE child ( + id INT, + parent_id INT, + x int(11) GENERATED ALWAYS AS (parent_id+1), + INDEX par_ind (parent_id), + FOREIGN KEY (parent_id) + REFERENCES parent(id) + ON DELETE CASCADE +) ENGINE=INNODB; + +ALTER TABLE child ADD INDEX `i1` (x); + +# If foreign constrain does not have cascade clause, or with "no action" clause +# the index can still be created +CREATE TABLE child_1 ( + id INT, + parent_id INT, + x int(11) GENERATED ALWAYS AS (parent_id+1), + INDEX par_ind (parent_id), + FOREIGN KEY (parent_id) + REFERENCES parent(id) +) ENGINE=INNODB; + +# This should be successful +ALTER TABLE child_1 ADD INDEX `i1` (x); + +DROP TABLE child_1; + +DROP TABLE child; + +CREATE TABLE child ( + id INT, + parent_id INT, + x int(11) GENERATED ALWAYS AS (parent_id+1), + INDEX par_ind (parent_id), + INDEX i1 (x), + + FOREIGN KEY (parent_id) + REFERENCES parent(id) + ON DELETE CASCADE +) ENGINE=INNODB; + +DROP TABLE child; + +CREATE TABLE child ( + id INT, + parent_id INT, + x int(11) GENERATED ALWAYS AS (parent_id+1), + INDEX par_ind (parent_id), + INDEX `i1` (x) +) ENGINE=INNODB; + +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE; + +# Check inplace option +SET foreign_key_checks = 0; + +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE; + +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE SET NULL; + +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON UPDATE CASCADE; + +# this should be successful +ALTER TABLE child ADD FOREIGN KEY (parent_id) +REFERENCES parent(id); + +SET foreign_key_checks = 1; + +DROP TABLE child; + +DROP TABLE parent; + +# Test for Bug 21890816 - ASSERT UPDATE->OLD_VROW, VIRTUAL COLUMNS +CREATE TABLE `ibstd_16` ( + `a` int(11) DEFAULT NULL, + `d` int(11) DEFAULT NULL, + `b` varchar(198) DEFAULT NULL, + `c` char(179) DEFAULT NULL, + `vadcol` int(11) GENERATED ALWAYS AS (a+length(d)) STORED, + `vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, + UNIQUE KEY `b` (`b`(10),`d`), + KEY `d` (`d`), + KEY `a` (`a`), + KEY `c` (`c`(99),`b`(33)), + KEY `b_2` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `a_2` (`a`,`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=INNODB; + +# Block when FK constraint on base column of stored column. +#--error ER_CANNOT_ADD_FOREIGN +CREATE TABLE `ibstd_16_fk` ( + `a` int(11) DEFAULT NULL, + `d` int(11) DEFAULT NULL, + `b` varchar(198) DEFAULT NULL, + `c` char(179) DEFAULT NULL, + `vadcol` int(11) GENERATED ALWAYS AS (a+length(d)) STORED, + `vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, + UNIQUE KEY `b` (`b`(10),`a`,`d`), + KEY `d` (`d`), + KEY `a` (`a`), + KEY `c` (`c`(99),`b`(33)), + KEY `b_2` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `a_2` (`a`,`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`,`d`), + CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL +) ENGINE=InnoDB; +DROP TABLE ibstd_16_fk; + +# Take out "KEY `a_2` (`a`,`vbidxcol`)", this should then be successful +CREATE TABLE `ibstd_16_fk` ( + `a` int(11) DEFAULT NULL, + `d` int(11) DEFAULT NULL, + `b` varchar(198) DEFAULT NULL, + `c` char(179) DEFAULT NULL, + `vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, + UNIQUE KEY `b` (`b`(10),`a`,`d`), + KEY `d` (`d`), + KEY `a` (`a`), + KEY `c` (`c`(99),`b`(33)), + KEY `b_2` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`,`d`), + CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL +) ENGINE=InnoDB; + +ALTER TABLE ibstd_16_fk ADD INDEX `a_2` (`a`,`vbidxcol`); + +# Now try to add a table with virtual index, and then add constraint +DROP TABLE ibstd_16_fk; + +# Create a table without constraint +CREATE TABLE `ibstd_16_fk` ( + `a` int(11) DEFAULT NULL, + `d` int(11) DEFAULT NULL, + `b` varchar(198) DEFAULT NULL, + `c` char(179) DEFAULT NULL, + `vbcol` char(2) GENERATED ALWAYS AS (substr(b,2,2)) VIRTUAL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, + UNIQUE KEY `b` (`b`(10),`a`,`d`), + KEY `d` (`d`), + KEY `a` (`a`), + KEY `c` (`c`(99),`b`(33)), + KEY `b_2` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `a_2` (`a`,`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=InnoDB; + +ALTER TABLE `ibstd_16_fk` ADD CONSTRAINT `fk_16` FOREIGN KEY (`a`) REFERENCES `ibstd_16` (`a`) ON DELETE SET NULL; + +# DROP the index +DROP INDEX a_2 ON ibstd_16_fk; + +INSERT INTO ibstd_16 VALUES (1, 2, "aaa", "bbb", default, default, default); +INSERT INTO ibstd_16_fk VALUES(1, 3, "mmm", "SSS", default, default); + +# Cascading delete/update on column non-related to virtual column or virtual +# index will be fine +DELETE FROM ibstd_16 WHERE a = 1; + +DROP TABLE ibstd_16_fk; +DROP TABLE ibstd_16; + +# Bug 21941320 - GCOLS: FAILING ASSERTION: N_IDX > 0 +create table t(a int) engine=innodb; +insert into t set a=1; +alter table t add column c int generated always as (1) virtual; +insert into t set a=2; + +# Following will cause create index fail, we need to make sure the column +# ord_part is reset +--error ER_DUP_ENTRY +alter table t add unique index(c); +insert into t set a=1; +drop table t; + +# Bug 21875974 - VCOL : READ OF FREED MEMORY IN DTUPLE_GET_N_FIELDS +# CAUSE CRASH + +create table t ( + x int, + a int generated always as (x) virtual, + b int generated always as (1) stored, + c int not null, + unique (b), + unique (a,b) +) engine=innodb; + +insert into t(x, c) values(1, 3); + +# This will exercise row_vers_impl_x_locked_low() for virtual columns +replace into t(x, c) values(1, 0); + +drop table t; + +# Bug22123674 VCOL:INNODB: FAILING ASSERTION: !UT_STRCMP(NAME, +# FIELD->FIELD_NAME) + +CREATE TABLE t( +c7c CHAR(1)GENERATED ALWAYS AS (c3) VIRTUAL, +c1 int(1), +c2 int(1), +c3 int(1), +c4 int(1), +c5 int(1)GENERATED ALWAYS AS ((c2 - c4)) VIRTUAL, +UNIQUE KEY c5_9(c5) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t CHANGE COLUMN c5 c5 INT(1) GENERATED ALWAYS AS(c2 - +c4)VIRTUAL AFTER c3,ALGORITHM=INPLACE; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t CHANGE COLUMN c7c c7c INT(1) GENERATED ALWAYS AS(c3) +VIRTUAL AFTER c5,ALGORITHM=INPLACE; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t DROP COLUMN c7c,ADD COLUMN c5c INT GENERATED ALWAYS AS(c4/ +c3)VIRTUAL AFTER c3,ALGORITHM=INPLACE; + +DROP TABLE t; + +# Bug22111464 VCOL:INNODB: FAILING ASSERTION: I < TABLE->N_DEF + +CREATE TABLE `t` ( + `col1` int(11) DEFAULT NULL, + `col2` int(11) DEFAULT NULL, + `col4` int(11) DEFAULT NULL, + `col5` int(11) GENERATED ALWAYS AS ((`col2` % `col4`)) VIRTUAL, + `col6` int(11) GENERATED ALWAYS AS ((`col2` - `col2`)) VIRTUAL, + `col5x` int(11) GENERATED ALWAYS AS ((`col1` / `col1`)) VIRTUAL, + `col6x` int(11) GENERATED ALWAYS AS ((`col2` / `col4`)) VIRTUAL, + `col7x` int(11) GENERATED ALWAYS AS ((`col6` % `col6x`)) VIRTUAL, + `col8x` int(11) GENERATED ALWAYS AS ((`col6` / `col6`)) VIRTUAL, + `col9` text, + `col7c` int(11) GENERATED ALWAYS AS ((`col6x` % `col6x`)) VIRTUAL, + `col1b` varchar(20) GENERATED ALWAYS AS (`col1`) VIRTUAL, + `col3` int(11) DEFAULT NULL, + `col7` int(11) DEFAULT NULL, + `col5c` int(11) GENERATED ALWAYS AS ((`col5x` * `col6`)) VIRTUAL, + `col6c` varchar(20) GENERATED ALWAYS AS (`col5x`) VIRTUAL, + `col3b` bigint(20) GENERATED ALWAYS AS ((`col6x` * `col6`)) VIRTUAL, + `col1a` varchar(20) GENERATED ALWAYS AS (`col1`) VIRTUAL, + `col8` int(11) DEFAULT NULL, + UNIQUE KEY `col5` (`col5`), + UNIQUE KEY `col6x` (`col6x`), + UNIQUE KEY `col5_2` (`col5`), + KEY `idx2` (`col9`(10)), + KEY `idx4` (`col2`), + KEY `idx8` (`col9`(10),`col5`), + KEY `idx9` (`col6`), + KEY `idx6` (`col6`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +ALTER TABLE t CHANGE COLUMN col3b col8a BIGINT GENERATED ALWAYS AS +(col6x * col6) VIRTUAL, ADD UNIQUE KEY uidx ( col8a ); + +DROP TABLE t; + +--echo # +--echo # Bug 22141031 - GCOLS: PURGED THREAD DIES: TRIED TO PURGE +--echo # NON-DELETE-MARKED RECORD IN INDEX +--echo # +create table t ( + a int,b int,c text,d int,e int,f int,g int, + h text generated always as ('1') virtual, + i int,j int,k int,l int,m int, + primary key (c(1)),unique key (c(1)), + key (i),key (h(1)) +) engine=innodb default charset latin1; + +replace into t(c) values (''); +replace into t(c) values (''); +alter table t drop column d ; + +drop table t; + +--echo # +--echo # Bug 22139917 - ASSERTION: DICT_TABLE_GET_NTH_COL(USER_TABLE, NTH_COL) +--echo # ->LEN < NEW_LEN +--echo # + +create table t ( + a int generated always as (1) virtual, + b varbinary(1), + c varbinary(1) generated always as (b) virtual +) engine=innodb; +alter table t change column b b varbinary(2), algorithm=inplace; +alter table t change column c c varbinary(2) generated always as (b) virtual, algorithm=inplace; + +drop table t; + +# Bug22202788 GCOL:ASSERTION:0 IN ROW_SEL_GET_CLUST_REC_FOR_MYSQL AT +# ROW0SEL.CC +SET @@SESSION.sql_mode=0; + +CREATE TABLE t( + c1 INT AUTO_INCREMENT, + c2 INT, + c3 INT GENERATED ALWAYS AS(c2 + c2)VIRTUAL, + c3k INT GENERATED ALWAYS AS(c2 + c3)VIRTUAL, + c4 DATE, + c5 DATE GENERATED ALWAYS AS(DATE_ADD(c4,interval 30 day)) VIRTUAL, + c5k DATE GENERATED ALWAYS AS(DATE_ADD(c4,interval 30 day)) VIRTUAL, + c5time_gckey DATE, + c6 TIME, + c5time DATE GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c6)) VIRTUAL, + c7 TIME GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c6)) VIRTUAL, + c5timek DATE GENERATED ALWAYS AS(ADDTIME(c5time_gckey,c7)) VIRTUAL, + c7k TIME GENERATED ALWAYS AS(ADDTIME(c5time,c6)) VIRTUAL, + c8 CHAR(10), + c9 CHAR(20)GENERATED ALWAYS AS (CONCAT(c8,c8)) VIRTUAL, + c9k CHAR(15)GENERATED ALWAYS AS (CONCAT(c8,0)) VIRTUAL, + PRIMARY KEY(c1), + KEY(c3), + KEY(c9(10)), + UNIQUE KEY(c9k), + UNIQUE KEY(c3k,c9k(5),c5k,c7k,c5timek,c3,c9(5),c5,c7,c5time) +)ENGINE=INNODB; + +--error ER_DUP_ENTRY +INSERT INTO +t(c2,c4,c6,c5time_gckey,c8)VALUES(1,0,0,0,0),(0,0,0,0,'ityzg'),(0,0,1,0,'tyzgk +t'),(0,1,0,1,'yzgktb'),(0,0,0,0,'zgktb'),(0,0,0,0,'gktbkj'),(0,0,0,0,0),(0,0,1 +,0,1),(0,0,0,0,1),(0,0,0,0,'tbkjrkm'),(0,0,0,0,'bkjr'),(0,0,0,0,0),(0,0,0,0,0) +,(0,0,0,0,'rk'),(0,0,0,0,'kmqmknbtoe'),(1,0,0,0,'mqmknbt'),(0,1,0,0,'qmknb'),( +0,0,0,0,'mkn'),(0,0,0,0,'knbtoervql'),(0,0,1,0,1),(0,0,0,0,'nbtoerv'),(0,0,0,0 +,'btoerv'),(0,0,1,0,'toer'),(1,0,0,0,0),(0,0,0,0,'ervq'),(0,0,0,0,'rvqlzsvasu' +),(0,0,0,0,'vqlzs'),(0,0,0,0,0),(0,1,0,0,'lzsvasu'),(0,0,0,0,'zsvasurq'); + +SELECT +DISTINCT * FROM t +FORCE KEY(PRIMARY,c3k,c3,c9k,c9) +WHERE +(c9 IS NULL AND (c9=0)) +OR( +(c9k NOT IN ('ixfq','xfq','New Mexico','fq')OR c9 IS NULL) +) +OR(c9 BETWEEN 'hwstqua' AND 'wstquadcji' OR (c9k=0)) +AND(c3 IS NULL OR c3 IN (0,0,0)); + +drop table t; + +# +# BUG#22082762 RE-ENABLE SUPPORT FOR ADDING VIRTUAL INDEX WHILE DROPPING VIRTUAL COLUMN +# + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT +GENERATED ALWAYS AS(a+b+b), e INT GENERATED ALWAYS AS(a), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, DEFAULT, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, DEFAULT, DEFAULT, 'mm'); +CREATE INDEX idx ON t(c, d); +CREATE INDEX idx1 ON t(c); +CREATE INDEX idx2 ON t(e, c, d); + +# This will drop column c, drop index idx1 on column c, and build index +# idx and idx2, so they become idx(d) and idx2(e, d) respectively. +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; + +SELECT d FROM t; + +SHOW CREATE TABLE t; + +# Drop a column, adding a new column and also adding a index on this new column +# is not allowed for INPLACE algorithm +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t DROP COLUMN d, ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE; + +# Add an index on existing column along with dropping a column is allowed +ALTER TABLE t DROP COLUMN d, ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (e), ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t; + +# Add an index on existing column along with adding a virtual column and droping a virtual index +ALTER TABLE t ADD INDEX idx4(c, e), ADD COLUMN x VARCHAR(10) GENERATED ALWAYS AS(h), DROP INDEX idx, ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD COLUMN j INT, ALGORITHM=INPLACE; + +# Add an index along with adding a regular column is allowed. +ALTER TABLE t ADD INDEX (x), ADD COLUMN j INT, ALGORITHM=INPLACE, LOCK=NONE; +SHOW CREATE TABLE t; + +# Online add an index on newly added virtual column is not allowed. +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD INDEX (i), ALGORITHM=INPLACE, LOCK=NONE; + +ALTER TABLE t ADD COLUMN i INT GENERATED ALWAYS AS(a+a+b), ADD INDEX (i), ALGORITHM=INPLACE, LOCK=SHARED; +SHOW CREATE TABLE t; + +SELECT i FROM t; + +SELECT * FROM t; + +DROP TABLE t; + +# +# BUG#22469459 WRONG VALUES IN ADDED INDEX WHILE DROPPING VIRTUAL COLUMN +# + +# Drop column with existing index on it. +CREATE TABLE t ( + a INT, + b INT, + c INT GENERATED ALWAYS AS(a+b), + d INT GENERATED ALWAYS AS(a+b+b), + KEY vidx (c, d) +)ENGINE=INNODB; + +INSERT INTO t (a,b) VALUES (0, 0), (1, NULL), (NULL, 2), (NULL, NULL); + +SELECT c, d FROM t; + +SELECT * FROM t; + +ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; + +SELECT d FROM t; + +SELECT * FROM t; + +DROP TABLE t; + +# Drop column with a new index. +CREATE TABLE t ( + a INT, + b INT, + c INT GENERATED ALWAYS AS(a+b), + d INT GENERATED ALWAYS AS(a+b+b) +)ENGINE=INNODB; + +INSERT INTO t (a,b) VALUES (0, 0), (1, NULL), (NULL, 2), (NULL, NULL); + +SELECT * FROM t; + +ALTER TABLE t DROP COLUMN c, ADD INDEX vidx(d), ALGORITHM=INPLACE; + +SELECT d FROM t; + +SELECT * FROM t; + +DROP TABLE t; + +--echo # +--echo # Bug #22162200 MEMORY LEAK IN HA_INNOPART_SHARE +--echo # ::SET_V_TEMPL PARTITIONED ON VIRTUAL COLUMN +--echo # +create table t ( + c tinyint, + d longblob generated always as (c) virtual +) engine=innodb partition by key (c) partitions 2; + +select d in(select d from t)from t group by d; +drop table t; + +--echo # +--echo # BUG#23052231 - ASSERTION FAILURE: ROW0MERGE.CC:2100:ADD_AUTOINC +--echo # < DICT_TABLE_GET_N_USER_COLS +--echo # +CREATE TABLE `t` ( + `a` int(11) NOT NULL, + `d` int(11) NOT NULL, + `b` varchar(198) NOT NULL, + `c` char(177) DEFAULT NULL, + `vadcol` int(11) GENERATED ALWAYS AS ((`a` + length(`d`))) STORED, + `vbcol` char(2) GENERATED ALWAYS AS (substr(`b`,2,2)) VIRTUAL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, + PRIMARY KEY (`b`(10),`a`,`d`), + KEY `d` (`d`), + KEY `a` (`a`), + KEY `c_renamed` (`c`(99),`b`(35)), + KEY `b` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `a_2` (`a`,`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`,`d`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t values (11, 1, "11", "aa", default, default, default); + +ALTER TABLE t ADD COLUMN nc01128 BIGINT AUTO_INCREMENT NOT NULL, ADD KEY auto_nc01128(nc01128); + +DROP TABLE t; + +--echo # +--echo #Bug #22965271 NEEDS REBUILD FOR COLUMN LENGTH CHANGE THAT IS +--echo #PART OF VIRTUAL INDEX. +--echo # + +CREATE TABLE t1( +a VARCHAR(45) CHARACTER SET LATIN1, +b VARCHAR(115) CHARACTER SET UTF8 GENERATED ALWAYS AS ('f1') VIRTUAL, +UNIQUE KEY (b,a))ENGINE=INNODB; +INSERT INTO t1(a) VALUES (''); +ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(85); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_blob.test b/mysql-test/suite/gcol/t/innodb_virtual_blob.test new file mode 100644 index 00000000000..a97992d81e7 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_blob.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug#22046353 ALTER: ASSERT PAGE_SIZE.EQUALS_TO(SPACE_PAGE_SIZE), +--echo # BTR_COPY_BLOB_PREFIX +--echo # + +CREATE TABLE t1 +( f1 int primary key, f2 blob, + f3 blob generated always as (f2)) + row_format=compressed, engine=innodb; +insert into t1 (f1, f2) values (1, repeat('&', 50000)); +alter table t1 add index i1 (f3(200)) ; +alter table t1 row_format=compact; +drop table t1; + diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test new file mode 100644 index 00000000000..72be27775ed --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test @@ -0,0 +1,240 @@ +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/have_debug.inc +--source include/count_sessions.inc + +set default_storage_engine=innodb; +CREATE TABLE `t` ( + `a` VARCHAR(100), + `b` VARCHAR(100), + `c` VARCHAR(200) GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + `h` VARCHAR(10) DEFAULT NULL, + `i` int +) ENGINE=InnoDB; + +INSERT INTO t VALUES (REPEAT('g', 100), REPEAT('x', 10), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2); + +CREATE INDEX idx ON t(c(100)); + +SET session debug_dbug="+d,ib_alter_add_virtual_fail"; +--error ER_WRONG_KEY_COLUMN +ALTER TABLE t ADD COLUMN x VARCHAR(200) GENERATED ALWAYS AS (a) VIRTUAL, +ALGORITHM = INPLACE; +--error ER_WRONG_KEY_COLUMN +ALTER TABLE t DROP COLUMN c, ALGORITHM = INPLACE; +SET session debug_dbug=""; +DROP TABLE t; + +#online test +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, "mx"); + +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +--send CREATE INDEX idx ON t(c) + +connect (con1,localhost,root,,); + +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +update t set a=0 where a = 11; +start transaction; +update t set a=1 where a = 0; +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +reap; + +SELECT c FROM t; +SHOW CREATE TABLE t; +SELECT * FROM t; + +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +--send ALTER TABLE t ADD COLUMN x INT + +connection con1; + +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +start transaction; +update t set a=1 where a = 0; +rollback; +start transaction; +delete from t; +insert into t values(1,null,default,null); +rollback; +start transaction; +update t set b=b+1; +rollback; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +reap; + +check table t; +SELECT c FROM t; + +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +--send ALTER TABLE t ADD COLUMN x2 INT + +connection con1; + +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +start transaction; +DELETE FROM t WHERE a = 0; +ROLLBACK; +DELETE FROM t WHERE a = 0; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +reap; + +SELECT c FROM t; + +disconnect con1; +DROP TABLE t; + +SET DEBUG_SYNC = 'RESET'; + + +# Test add virtual column and add index at the same time +# introduce some error + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); + +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); + +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); + +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +CREATE INDEX idx_1 on t(c); + +SET SESSION debug_dbug="+d,create_index_fail"; + +--enable_info +--error ER_DUP_ENTRY +ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (x); +SET SESSION debug_dbug=""; +--disable_info + +SHOW CREATE TABLE t; + +SELECT c FROM t; + +DROP TABLE t; + + +--echo # +--echo # Bug#22018532 ASSERTION WHEN ONLINE REAPPLY REBUILD LOG ON +--echo # MULTIPLE INDEXED VIRTUAL COLUMNS +--echo # + +create table t ( + a int as (1) virtual, + b int, + c int as (1) virtual, + unique(b), + unique(c), + key(a) +) engine=innodb; + +insert ignore into t values(); + +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +--send optimize table t + +connect (con1,localhost,root,,); + +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +insert ignore into t values(); +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +--echo /* connection default */ optimize table t; +reap; +SELECT c FROM t; +SHOW CREATE TABLE t; +SELECT * FROM t; +DROP TABLE t; + +# Do another test without duplicate error + +CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10)); + +INSERT INTO t VALUES (11, 3, DEFAULT, 'mm'); +INSERT INTO t VALUES (18, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (28, 1, DEFAULT, 'mm'); +INSERT INTO t VALUES (null, null, DEFAULT, 'mm'); + +CREATE INDEX idx ON t(c); + +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_rebuild WAIT_FOR go_ahead'; +--send optimize table t + +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR start_rebuild'; +INSERT INTO t VALUES (48, 2, DEFAULT, 'xx'); +INSERT INTO t VALUES (68, 3, DEFAULT, 'sx'); +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +--echo /* connection default */ optimize table t; +reap; + +SELECT c FROM t; + +disconnect con1; + +DROP TABLE t; + +--echo # +--echo # Bug#22951879 - ASSERTS RELATED TO ONLINE DDL AND GCOL +--echo # + +# Create a table with 2 virtual column, one (vbidxcol) is indexed and +# the other one (vbcol) is not +create table ibstd_14 (a int not null, d int not null, b varchar(198) not null, c char(181), vadcol int as (a+length(d)) stored, vbcol char(2) as (substr(b,2,2)) virtual, vbidxcol char(3) as (substr(b,1,3)) virtual , index(d), index(a), index(vbidxcol), index(a,vbidxcol), index(vbidxcol,d), unique key (b(10), a, d), index(c(99), b(31)), index(b(5), c(10), a) , index(a,d)) engine=InnoDB stats_persistent=1 row_format=dynamic; + +# Do an alter table rebuild table and also create a new index on this +# non-indexed virtual column +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead'; +--send alter table ibstd_14 row_format=compressed key_block_size=4,add key kn3 (d,c,vbcol,b) + +# Do a concurrent insert, and make sure this newly indexed virtual column +# is also logged +connect (con1,localhost,root); +SET DEBUG_SYNC = 'now WAIT_FOR start_create'; +insert into ibstd_14 (a,d,b,c, vbidxcol, vbcol) values ('118','6',repeat('oacolaarlruoacuroauurloraarucoooarcooauoolacalllaulrruarrrucruuooclacuoouccarrcoocloccorrrrarourcooalloocooccouruolaorlcaocualolc','1'),repeat('lolrrlalcocroraaulauclaaucolcorcuooaolruaooooluooooouaoorlarucorullalcrrloccououaooaorluorraclrcooouuolocoaolcocaaculruoocucoocoooauuolarcoraraocaoolulolarru','1'),default,default); + +insert into ibstd_14 (a,d,b,c, vbidxcol, vbcol) values ('118','6', 'aaaa', 'lll', default, default); + +# Also do an concurrent update, make sure this is performed +update ibstd_14 set b='11111' where b='aaaa'; + +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; + +connection default; +reap; + +select * from ibstd_14; + +# This will use the newly added "kn3" index, to check materialized vbcol +# after log reapply +select d,c,vbcol,b from ibstd_14; + +# check the value is inserted into the index +select vbcol from ibstd_14; + +drop table ibstd_14; + +disconnect con1; + +SET DEBUG_SYNC = 'RESET'; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test new file mode 100644 index 00000000000..d2634aa1ee8 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test @@ -0,0 +1,174 @@ +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/have_debug.inc +--source include/have_partition.inc + +set default_storage_engine=innodb; +set @old_dbug=@@global.debug_dbug; + +CREATE TABLE `t` ( + `a` BLOB, + `b` BLOB, + `c` BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + `h` VARCHAR(10) DEFAULT NULL, + `i` int +) ENGINE=InnoDB; + +INSERT INTO t VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, "mm", 2); + +CREATE INDEX idx ON t(c(100)); + +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%"; +select sleep(3); +SET global debug_dbug=@old_dbug; +DROP TABLE t; + + +CREATE TABLE t ( + a TINYBLOB, + b TINYBLOB, + c TINYBLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + h VARCHAR(10) DEFAULT NULL, + i INT +) ROW_FORMAT=COMPACT ENGINE=InnoDB; + +INSERT INTO t VALUES (REPEAT('g', 100), REPEAT('x', 100), DEFAULT, "kk", 1); +INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2); + +CREATE INDEX idx ON t(c(100)); + +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t SET a = REPEAT('m', 100) WHERE a like "aaa%"; +select sleep(3); +SET global debug_dbug=@old_dbug; +DROP TABLE t; + + +CREATE TABLE t1 ( + id INT NOT NULL, + store_id INT NOT NULL, + x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( + PARTITION p0 VALUES LESS THAN (6), + PARTITION p1 VALUES LESS THAN (11), + PARTITION p2 VALUES LESS THAN (16), + PARTITION p3 VALUES LESS THAN (21) +); + +insert into t1 values(1, 2, default); +insert into t1 values(3, 4, default); + +insert into t1 values(3, 12, default); +insert into t1 values(4, 18, default); + +CREATE INDEX idx ON t1(x); + +SET global debug_dbug="+d,ib_purge_virtual_index_callback"; +UPDATE t1 SET id = 10 WHERE id = 1; +select sleep(3); +SET global debug_dbug=@old_dbug; +DROP TABLE t1; + +# +# BUG#22082762 RE-ENABLE SUPPORT FOR ADDING VIRTUAL INDEX WHILE DROPPING VIRTUAL COLUMN +# +--source include/count_sessions.inc + +connect (con1,localhost,root,,); +connection default; + +# Test adding virtual index on newly added virtual column +CREATE TABLE t1 (a INT, b INT); + +INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3); + +connection con1; +--echo # disable purge +CREATE TABLE t0 (a INT) ENGINE=InnoDB; +BEGIN; SELECT * FROM t0; + +connection default; +DELETE FROM t1 WHERE a = 1; + +UPDATE t1 SET a = 4, b = 4 WHERE a = 3; + +INSERT INTO t1(a, b) VALUES (5, 5); + +SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged'; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; +send ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED; + +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; + +--echo # enable purge +COMMIT; + +--echo # wait for purge to process the deleted records. +--source include/wait_innodb_all_purged.inc + +SET DEBUG_SYNC= 'now SIGNAL purged'; + +connection default; +--echo /* connection default */ ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED; +--reap +SHOW CREATE TABLE t1; + +SELECT * FROM t1; + +DROP TABLE t1; + +# Test adding virutal index on existing virtual column +CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b)); + +INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4); + +connection con1; +--echo # disable purge +BEGIN; SELECT * FROM t0; + +connection default; +DELETE FROM t1 WHERE a = 1; + +UPDATE t1 SET a = 2, b = 2 WHERE a = 5; + +INSERT INTO t1(a, b) VALUES (6, 6); + +SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged'; +send ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; + +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; + +DELETE FROM t1 WHERE a = 3; + +UPDATE t1 SET a = 7, b = 7 WHERE a = 4; + +INSERT INTO t1(a, b) VALUES (8, 8); + +--echo # enable purge +COMMIT; + +--echo # wait for purge to process the deleted/updated records. +--source include/wait_innodb_all_purged.inc + +SET DEBUG_SYNC= 'now SIGNAL purged'; + +disconnect con1; + +connection default; +--echo /* connection default */ ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; +--reap +SHOW CREATE TABLE t1; + +SELECT * FROM t1; + +DROP TABLE t0, t1; + +--source include/wait_until_count_sessions.inc + +set debug_sync=reset; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk.test b/mysql-test/suite/gcol/t/innodb_virtual_fk.test new file mode 100644 index 00000000000..bd8f3664839 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_fk.test @@ -0,0 +1,492 @@ +-- source include/have_innodb.inc + +set default_storage_engine=innodb; + +--echo # +--echo # Bug#22469130: FOREIGN KEY ON DELETE CASCADE NOT ALLOWED +--echo # WHEN A VIRTUAL INDEX EXISTS. + + +--echo # UPDATE CASCADE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # UPDATE SET NULL +CREATE TABLE t1(fld1 INT NOT NULL, fld2 INT NOT NULL PRIMARY KEY, + KEY(fld1)); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE SET NULL); +INSERT INTO t1 VALUES(1, 2); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DELETE CASCADE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +INSERT INTO t2 VALUES(1, DEFAULT); +INSERT INTO t2 VALUES(2, DEFAULT); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DELETE SET NULL +CREATE TABLE t1(fld1 INT NOT NULL, fld2 INT NOT NULL PRIMARY KEY, KEY(fld1)); +CREATE TABLE t2(fld1 INT, fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE SET NULL); +INSERT INTO t1 VALUES(1, 1); +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1, DEFAULT); +INSERT INTO t2 VALUES(2, DEFAULT); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # VIRTUAL INDEX CONTAINS FK CONSTRAINT COLUMN +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT, fld3 INT AS (fld2) VIRTUAL, + KEY(fld3, fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 3); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # Multiple level of VIRTUAL columns. + +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld3), KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT fld3 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # Drop the VIRTUAL INDEX using alter copy ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, KEY vk(fld2), + KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Drop the VIRTUAL INDEX using INPLACE alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY vk(fld2), KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Add the VIRTUAL INDEX using COPY alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Add the VIRTUAL INDEX using INPLACE alter ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL,fld2 INT AS (fld1) VIRTUAL, + KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1) VALUES(1); +UPDATE t1 SET fld1= 2; +SELECT fld2, fld1 FROM t2; +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM= INPLACE; +UPDATE t1 SET fld1= 3; +SELECT fld2, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Drop the VIRTUAL INDEX contains fk constraint column +--echo # using alter copy ALGORITHM +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY vk(fld3, fld1), + KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +ALTER TABLE t2 DROP INDEX vk, ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Drop the VIRTUAL INDEX which contains fk constraint column +--echo # using INPLACE alter operation +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY vk(fld3, fld1), + KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +alter TABLE t2 DROP INDEX vk, ALGORITHM= INPLACE; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Add the VIRTUAL INDEX contains fk constraint column +--echo # using copy alter operatiON +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM= COPY; +UPDATE t1 SET fld1= 3; +SELECT fld3, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # Cascading UPDATEs and DELETEs for the multiple +--echo # fk dependent TABLEs + +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY(fld1), KEY(fld2, fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY(fld2, fld1), + FOREIGN KEY(fld1) REFERENCES t2(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2(fld1) VALUES(1), (2); +INSERT INTO t3(fld1) VALUES(1), (2); +UPDATE t1 SET fld1= 4 WHERE fld1= 1; +SELECT fld2, fld1 FROM t2; +SELECT fld2, fld1 FROM t3; +DROP TABLE t3, t2, t1; + +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), KEY(fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), + FOREIGN KEY(fld1) REFERENCES t2(fld1) ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, 1, DEFAULT), (2, 2, default); +INSERT INTO t3 VALUES(1, 1, DEFAULT), (2, 2, default); +UPDATE t1 SET fld1= 4 WHERE fld1= 1; +SELECT fld3, fld1 FROM t2; +SELECT fld3, fld1 FROM t3; +DROP TABLE t3, t2, t1; + +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY(fld1), KEY(fld2, fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON DELETE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT AS (fld1) VIRTUAL, + KEY(fld2, fld1), FOREIGN KEY(fld1) REFERENCES t2(fld1) + ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2(fld1) VALUES(1), (2); +INSERT INTO t3(fld1) VALUES(1), (2); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2, fld1 FROM t2; +SELECT fld2, fld1 FROM t3; +DROP TABLE t3, t2, t1; + +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, + KEY(fld3, fld1), KEY(fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON DELETE CASCADE); +CREATE TABLE t3(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld3, fld1), + FOREIGN KEY(fld1) REFERENCES t2(fld1) + ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, 1, DEFAULT), (2, 2, default); +INSERT INTO t3 VALUES(1, 1, DEFAULT), (2, 2, default); +DELETE FROM t1 WHERE fld1= 1; +SELECT fld3, fld1 FROM t2; +SELECT fld3, fld1 FROM t3; +DROP TABLE t3, t2, t1; + +--echo # RENAME TABLE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY(fld2, fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON DELETE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +RENAME TABLE t2 to t3; +DELETE FROM t1 WHERE fld1= 1; +SELECT fld2, fld1 FROM t3; +DROP TABLE t3, t1; + +--echo # FOREIGN_KEY_CHECKS disabled DURING INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX vk(fld2), ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 3 WHERE fld1= 2; +SELECT fld2 FROM t2; +DROP TABLE t2, t1; + +--echo # GENERATED COLUMN COMPUTATION FAILS when SQL_MODE +--echo # is set to ERROR_FOR_DIVISION_BY_ZERO +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (100/fld1) VIRTUAL, + KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +#--error ER_DIVISION_BY_ZERO +UPDATE t1 SET fld1= 0 WHERE fld1= 2; +SELECT fld2 FROM t2; +DROP TABLE t2, t1; + +--echo # CHANGE SQL_MODE and try the ERROR_FOR_DIVISION_BY_ZERO +SET sql_mode = STRICT_ALL_TABLES; +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (100/fld1) VIRTUAL, + KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +UPDATE t1 SET fld1= 0 WHERE fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; +SET sql_mode = default; + +--echo # ADD FOREIGN CONSTRAINT USING COPY +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, KEY(fld2)); +ALTER TABLE t2 ADD FOREIGN KEY (fld1) + REFERENCES t1(fld1) ON UPDATE CASCADE, + ALGORITHM=copy; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # ADD FOREIGN CONSTRAINT USING INPLACE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, KEY(fld2)); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD FOREIGN KEY (fld1) + REFERENCES t1(fld1) ON UPDATE CASCADE, + ALGORITHM=inplace; +SET foreign_key_checks = 1; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP FOREIGN CONSTRAINT USING COPY +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + CONSTRAINT fidx FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP FOREIGN KEY fidx, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP FOREIGN CONSTRAINT USING INPLACE +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, KEY(fld2), + CONSTRAINT fidx FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP FOREIGN KEY fidx, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # ADD VC INDEX and ADD FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 ADD INDEX(fld2), ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE, ALGORITHM=copy; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # ADD VC INDEX and ADD FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX(fld2), ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE, ALGORITHM=inplace; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # ADD VC INDEX and DROP FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 ADD INDEX(fld2), DROP FOREIGN KEY fidx, ALGORITHM=copy; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # ADD VC INDEX and DROP FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 ADD INDEX(fld2), DROP FOREIGN KEY fidx, ALGORITHM=inplace; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP VC INDEX and ADD FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY idx(fld2)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP INDEX idx, ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP VC INDEX and ADD FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY idx(fld2)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP INDEX idx, ADD FOREIGN KEY (fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP VC INDEX and DROP FK IN SAME COPY ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY idx(fld2), + CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +ALTER TABLE t2 DROP KEY idx, DROP FOREIGN KEY fidx, ALGORITHM=COPY; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +--echo # DROP VC INDEX and DROP FK IN SAME INPLACE ALTER +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY); +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY idx(fld2), + CONSTRAINT fidx FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE); +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, DEFAULT); +SET foreign_key_checks = 0; +ALTER TABLE t2 DROP KEY idx, DROP FOREIGN KEY fidx, ALGORITHM=INPLACE; +SET foreign_key_checks = 1; +UPDATE t1 SET fld1= 2; +SELECT fld2 FROM t2; +SELECT * FROM t2; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test new file mode 100644 index 00000000000..61d330036ea --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test @@ -0,0 +1,42 @@ +-- source include/have_innodb.inc +-- source include/not_embedded.inc + +--echo # +--echo # Bug#22469130: FOREIGN KEY ON DELETE CASCADE NOT ALLOWED +--echo # WHEN A VIRTUAL INDEX EXISTS. + +--echo # Add the VIRTUAL INDEX contains fk constraINT column +--echo # using INPLACE alter operatiON +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, + fld3 INT AS (fld2) VIRTUAL, KEY(fld1), + FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +INSERT INTO t1(fld1) VALUES(1); +INSERT INTO t2(fld1, fld2) VALUES(1, 2); +--source include/restart_mysqld.inc +UPDATE t1 SET fld1= 2; +SELECT fld3, fld1 FROM t2; +alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE; +UPDATE t1 SET fld1=3; +SELECT fld3, fld1 FROM t2; +DROP TABLE t2, t1; + +--echo # TEMPORARY TABLE NAME and CHILD TABLE NAME are same +CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2(fld1 INT NOT NULL, + fld2 INT AS (fld1) VIRTUAL, + KEY(fld2), + FOREIGN KEY(fld1) REFERENCES t1(fld1) + ON UPDATE CASCADE) engine=innodb; +INSERT INTO t1 VALUES(1), (2); +INSERT INTO t2 VALUES(1, DEFAULT), (2, default); +--source include/restart_mysqld.inc +CREATE TEMPORARY TABLE t2 (fld1 INT NOT NULL)ENGINE=INNODB; +UPDATE t1 SET fld1= 3 WHERE fld1= 2; +--connect(con1,localhost,root,,test) +SELECT fld2 FROM t2; +CHECK TABLE t2; +connection default; +disconnect con1; +DROP TABLE t2; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test new file mode 100644 index 00000000000..4c4cb2a2d05 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test @@ -0,0 +1,220 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING +--echo # THE NUMBER OF VIRTUAL COLUMNS +--echo # + +CREATE TABLE t1 (a INT, a1 INT GENERATED ALWAYS AS (a) VIRTUAL, a2 INT +GENERATED ALWAYS AS (a) VIRTUAL, a3 INT GENERATED ALWAYS AS (a) VIRTUAL, a4 +INT GENERATED ALWAYS AS (a) VIRTUAL, a5 INT GENERATED ALWAYS AS (a) VIRTUAL, +a6 INT GENERATED ALWAYS AS (a) VIRTUAL, a7 INT GENERATED ALWAYS AS (a) +VIRTUAL, a8 INT GENERATED ALWAYS AS (a) VIRTUAL, a9 INT GENERATED ALWAYS AS +(a) VIRTUAL, INDEX(a1, a2, a3, a4, a5, a6, a7, a8, a9)) ; + +INSERT INTO t1(a) VALUES(10); + +SELECT * FROM t1 WHERE a1=10 AND a2 = 10 AND a3 =10 AND a4 = 10 AND a5=10 AND +a6=10 AND a7=10 AND a8=10 AND a9=10; + +DROP TABLE t1; + +--echo # +--echo # Bug 22572997 - GCOL:INNODB: FAILING ASSERTION: N < REC_OFFS_N_FIELDS( +--echo # OFFSETS) +--echo # +SET @@SESSION.sql_mode=0; + +CREATE TABLE t1( +c1 int(1)AUTO_INCREMENT, + c2 int(1), + c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, + c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, + c5 date, + c6 date GENERATED ALWAYS AS((c5 + interval 30 day)) VIRTUAL, + c7 DATE, + c8 time, + c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, + c10 time GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, + c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, + c12 CHAR(1), + c13 CHAR(1)GENERATED ALWAYS AS (concat(c12,c12)) VIRTUAL, + c14 CHAR(2)GENERATED ALWAYS AS (concat(c13,'x')) VIRTUAL, + PRIMARY KEY(c1), + KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE t2( + c1 int(1)AUTO_INCREMENT, + c2 int(1), + c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, + c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, + c5 date, + c6 date GENERATED ALWAYS AS((c5 + interval 30 day)) VIRTUAL, + c6a date GENERATED ALWAYS AS((c6 + interval 30 day)) VIRTUAL, + c7 DATE, + c8 time, + c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, + c10 time GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, + c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, + c11a time GENERATED ALWAYS AS(addtime(c7,c10)) VIRTUAL, + c12 CHAR(1), + c13 CHAR(2)GENERATED ALWAYS AS (concat(c12,c12)) VIRTUAL, + c14 CHAR(4)GENERATED ALWAYS AS (concat(c13,'x')) VIRTUAL, + PRIMARY KEY(c1), + KEY c13(c13), + KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2(c1,c2,c5,c7,c8,c12)VALUES (0,0,0,0,0,'v'); + +CREATE TABLE t3( + c1 int(1)AUTO_INCREMENT, + c2 int(1), + c3 int(1)GENERATED ALWAYS AS ((c2 + c2)) VIRTUAL, + c4 int(1)GENERATED ALWAYS AS ((c3 + c2)) VIRTUAL, + c5 date, + c7 DATE, + c8 time, + c9 DATE GENERATED ALWAYS AS(addtime(c7,c8)) VIRTUAL, + c11 DATE GENERATED ALWAYS AS(addtime(c9,c8)) VIRTUAL, + c12 CHAR(1), + PRIMARY KEY(c1), + KEY c4_6(c4,c11) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t3(c1,c2,c5,c7,c8,c12)VALUES +(0,0,0,0,0,'q'),(0,0,0,0,0,'g'),(0,0,0,0,0,'l'),(0,0,0,0,0,1),(0,0,0,0,0,'v'), +(0,1,0,0,0,'c'),(0,0,0,0,0,'x'); + +UPDATE +t2 AS O1,t3 AS O2 +SET O1.c12=1 +WHERE O1.c14 NOT IN +( +SELECT +DISTINCT I1.c14 AS y +FROM t1 AS I1 +ORDER BY I1.c14); + +SET @@SESSION.sql_mode=default; + +DROP TABLE t1, t2, t3; + +--echo # +--echo # Bug 22650296 - ASSERTION IN INNOBASE_BUILD_COL_MAP, ALTER +--echo # +CREATE TABLE `ibstd_08` ( + `nc00577` tinyint(4) DEFAULT NULL, + `nc07844` varchar(41) DEFAULT NULL, + `gc01908` point NOT NULL, + `nc04156` char(17) DEFAULT NULL, + `nc09536` longblob NOT NULL, + `nc09231` decimal(10,0) NOT NULL, + `a` int(11) NOT NULL, + `b` varchar(198) NOT NULL, + `nc04560` mediumtext, + `c` char(187) DEFAULT NULL, + `vbidxcol` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, + `gc00881` polygon NOT NULL, + `nc05121` int(11) NOT NULL DEFAULT '85941481', + KEY `a` (`a`), + KEY `b` (`b`(3),`a`), + KEY `c` (`c`(99),`b`(25)), + KEY `b_2` (`b`(5),`c`(10),`a`), + KEY `vbidxcol` (`vbidxcol`), + KEY `a_2` (`a`,`vbidxcol`), + KEY `vbidxcol_2` (`vbidxcol`), + FULLTEXT KEY `ftsic` (`c`,`b`) +) ENGINE=InnoDB; + + +ALTER TABLE ibstd_08 ADD COLUMN nc07006 BIGINT AUTO_INCREMENT NOT NULL , ADD KEY auto_nc07006(nc07006); + +DROP TABLE ibstd_08; + +--echo # +--echo # Bug 22899305 - GCOLS: FAILING ASSERTION: !(COL->PRTYPE & 256) +--echo # AND SEGFAULT +--echo # +set sql_mode=""; +create table t (a int) engine=innodb; +create table s ( +b int generated always as (1) virtual, +c int, +d int generated always as (1) virtual, +key (d) +) engine=innodb; + +insert into t(a) values ((select d from s for update)); +insert into s(c) values (''); + +SET sql_mode = default; +drop table if exists t,s; + +--echo # +--echo # Bug 23014521 - GCOL:INNODB: FAILING ASSERTION: !IS_V +--echo # +CREATE TABLE t1 ( + col1 int(11) NOT NULL, + col2 int(11) DEFAULT NULL, + col3 int(11) NOT NULL, + col4 int(11) DEFAULT NULL, + col5 int(11) GENERATED ALWAYS AS ((col1 % col4)) VIRTUAL, + col6 int(11) GENERATED ALWAYS AS ((col2 - col4)) VIRTUAL, + col5x int(11) GENERATED ALWAYS AS ((col3 / col2)) VIRTUAL, + col6b varchar(20) GENERATED ALWAYS AS (col2) VIRTUAL, + col6x int(11) GENERATED ALWAYS AS ((col2 % col1)) VIRTUAL, + col7 int(11) GENERATED ALWAYS AS ((col6x + col5x)) VIRTUAL, + col8 int(11) GENERATED ALWAYS AS ((col5x / col5)) VIRTUAL, + col7x int(11) GENERATED ALWAYS AS ((col5x + col5)) VIRTUAL, + col8x int(11) GENERATED ALWAYS AS ((col5 / col5x)) VIRTUAL, + col9 text, + col2b varchar(20) GENERATED ALWAYS AS (col4) VIRTUAL, + col8a int(11) GENERATED ALWAYS AS (col2) VIRTUAL, + col4b varchar(20) GENERATED ALWAYS AS (col4) VIRTUAL, + col1c int(11) GENERATED ALWAYS AS ((col2 * col1)) VIRTUAL, + extra int(11) DEFAULT NULL, + col5c int(11) GENERATED ALWAYS AS ((col1 / col1)) VIRTUAL, + col6a bigint(20) GENERATED ALWAYS AS ((col3 / col1)) VIRTUAL, + col1a varchar(20) GENERATED ALWAYS AS (col6) VIRTUAL, + col6c int(11) GENERATED ALWAYS AS ((col2 % col2)) VIRTUAL, + col7c bigint(20) GENERATED ALWAYS AS ((col2 / col1)) VIRTUAL, + col2c int(11) GENERATED ALWAYS AS ((col5 % col5)) VIRTUAL, + col1b int(11) GENERATED ALWAYS AS ((col1 / col2)) VIRTUAL, + col3b bigint(20) GENERATED ALWAYS AS ((col6x % col6)) VIRTUAL, + UNIQUE KEY idx7 (col1,col3,col2), + UNIQUE KEY uidx (col9(10)), + KEY idx15 (col9(10) DESC,col2 DESC), + KEY idx10 (col9(10) DESC,col1 DESC), + KEY idx11 (col6x DESC), + KEY idx6 (col9(10) DESC,col7 DESC), + KEY idx14 (col6 DESC) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +# Cannot add virtual column along with create FULLTEXT index with +# adding a hidden FTS_DOC_ID column (which require a table rebuild) +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x) +VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace; + +# This will add a hidden FTS_DOC_ID column +CREATE FULLTEXT INDEX idx ON t1(col9); + +# Since there is no table rebuild needed, now the alter would be sucessful +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col5x % col6x) +VIRTUAL, ADD FULLTEXT KEY ftidx ( col9 ), algorithm=inplace; + +DROP TABLE t1; + +CREATE TABLE t1 ( + col1 int(11) NOT NULL, + col2 int(11) DEFAULT NULL, + col3 int(11) NOT NULL, + col4 int(11) DEFAULT NULL) engine=innodb; + +# This secondary key idx will be coverted to a new Primary Key, thus a table +# rebuild. It is blocked since there is an adding of virtual columns +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2) +VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace; + +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_purge.test new file mode 100644 index 00000000000..f9fd02d970b --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_purge.test @@ -0,0 +1,138 @@ +--source include/have_innodb.inc +--source include/count_sessions.inc + +--echo # +--echo # Bug#21869656 UNDO LOG DOES NOT CONTAIN ENOUGH INFORMATION +--echo # ON INDEXED VIRTUAL COLUMNS +--echo # + +CREATE TABLE t1 (a INT, b INT, + a1 INT GENERATED ALWAYS AS (a) VIRTUAL, INDEX(a1) +) ENGINE=InnoDB; + +INSERT INTO t1 (a,b) VALUES(1,1); + +connect (con1,localhost,root,,); +# disable purge +CREATE TABLE t0 (a INT) ENGINE=InnoDB; +BEGIN; SELECT * FROM t0; + +connection default; +# write the problematic update_undo log record +UPDATE t1 SET a=0; + +ALTER TABLE t1 DROP COLUMN a1, ALGORITHM=INPLACE; +ALTER TABLE t1 ADD COLUMN b1 INT GENERATED ALWAYS AS (b) VIRTUAL, ADD +INDEX(b1), +ALGORITHM=INPLACE; + +connection con1; +# enable purge +COMMIT; +UPDATE t1 SET a=1; + +connection default; +# wait for purge to process the update_undo record. +--source include/wait_innodb_all_purged.inc + +CHECK TABLE t1; +SELECT b1 FROM t1; + + +# Create multi-virtual column, more ADD/DROP to test it +ALTER TABLE t1 +ADD COLUMN a1 INT GENERATED ALWAYS AS (a) VIRTUAL, +ADD COLUMN a2 INT GENERATED ALWAYS AS (a + b) VIRTUAL, +ADD COLUMN a3 INT GENERATED ALWAYS AS (a - b) VIRTUAL, +ADD COLUMN a4 INT GENERATED ALWAYS AS (a - b) VIRTUAL, +ADD INDEX(a1), ADD INDEX(a2), ADD INDEX(a3), ALGORITHM=INPLACE; + +CREATE TABLE t2 ( + a BLOB, + b BLOB, + c BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, + h VARCHAR(10) DEFAULT NULL +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES (REPEAT('g', 16000), REPEAT('x', 16000), DEFAULT, 'kk'); + +INSERT INTO t2 VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, 'mm'); + +CREATE INDEX idx ON t2(c(100)); + +INSERT INTO t1 (a, b) VALUES(1,1); + +connection con1; +# disable purge +BEGIN; SELECT * FROM t0; + +connection default; +--enable_info + +# write the problematic update_undo log record +UPDATE t1 SET a=0; +UPDATE t1 SET b=0; + +ALTER TABLE t1 DROP COLUMN a3, ALGORITHM=INPLACE; + +UPDATE t1 SET a=2; +ALTER TABLE t1 DROP COLUMN a2, ALGORITHM=INPLACE; +UPDATE t1 SET b=3; + +ALTER TABLE t1 ADD COLUMN b2 INT GENERATED ALWAYS AS (b) VIRTUAL, +ADD INDEX(b2), ALGORITHM=INPLACE; +UPDATE t1 SET b=9; + +ALTER TABLE t1 ADD COLUMN b3 INT GENERATED ALWAYS AS (a) VIRTUAL, +ADD INDEX(b3), ALGORITHM=INPLACE; + +UPDATE t1 SET b=10; + +ALTER TABLE t2 DROP COLUMN c; + +UPDATE t2 SET a = REPEAT('s', 6000) WHERE a like 'aaa%'; + +ALTER TABLE t2 ADD COLUMN x1 BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +ADD COLUMN x2 BLOB GENERATED ALWAYS AS (CONCAT(a,b)) VIRTUAL, +ADD INDEX(x1(100), x2(120)), ADD INDEX (x1(20)); + +UPDATE t1 SET a=5; + +UPDATE t2 SET a = REPEAT('m', 16000) WHERE a like 'sss%'; + +ALTER TABLE t1 DROP COLUMN b2, ALGORITHM=INPLACE; + +UPDATE t1 SET a=6; + +ALTER TABLE t2 DROP COLUMN x1, DROP COLUMN x2, ALGORITHM=INPLACE; + +UPDATE t2 SET a = REPEAT('x', 1000) WHERE a like 'mmm%'; + +ALTER TABLE t1 DROP INDEX b3; +UPDATE t1 SET a=100; +--disable_info + +connection con1; +# enable purge +COMMIT; +disconnect con1; + +connection default; +# wait for purge to process the update_undo record. +--source include/wait_innodb_all_purged.inc + +CHECK TABLE t1; +SELECT b1 FROM t1; + +SELECT * FROM t1; +CHECK TABLE t2; +DROP TABLE t2, t1, t0; + +CREATE TABLE t1 (a VARCHAR(30), b INT, a2 VARCHAR(30) GENERATED ALWAYS AS (a) VIRTUAL); + +--error ER_DUP_FIELDNAME +CREATE INDEX idx ON t1(a2(10), b, a2(20)); + +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/gcol/t/innodb_wl8114.test b/mysql-test/suite/gcol/t/innodb_wl8114.test new file mode 100644 index 00000000000..bed8375328c --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_wl8114.test @@ -0,0 +1,42 @@ +--source include/have_innodb.inc + +# Test alter table add column +CREATE TABLE t_8114 (a int) ENGINE = INNODB; + +ALTER TABLE t_8114 ADD b INT GENERATED ALWAYS AS (a) VIRTUAL; + +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; + +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); + +INSERT INTO t_8114 VALUES (9, default); +INSERT INTO t_8114 VALUES (3, default); +INSERT INTO t_8114 VALUES (1, default); +INSERT INTO t_8114 VALUES (5, default); + +SELECT * FROM t_8114; + +DROP TABLE t_8114; + +CREATE TABLE t_8114 (Column_1 CHAR(5) GENERATED ALWAYS AS (PI()+5), Column_2 CHAR(5)) engine=innodb; + +SELECT NAME, FLAG, N_COLS FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; + +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); + +INSERT INTO t_8114 VALUES (default, "aa"); +INSERT INTO t_8114 VALUES (default, "bb"); +INSERT INTO t_8114 VALUES (default, "ee"); +INSERT INTO t_8114 VALUES (default, "pp"); + +SELECT * FROM t_8114; + +ALTER TABLE t_8114 DROP Column_1; + +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"; + +SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114"); + +SELECT * FROM t_8114; + +DROP TABLE t_8114; diff --git a/mysql-test/suite/gcol/t/main_alter_table.test b/mysql-test/suite/gcol/t/main_alter_table.test new file mode 100644 index 00000000000..bbd87350cb1 --- /dev/null +++ b/mysql-test/suite/gcol/t/main_alter_table.test @@ -0,0 +1,50 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug#22017616: ASSERTION FAILED: TABLE_SHARE->IS_MISSING_PRIMARY_KEY() +--echo # == M_PREBUILT->CLUST_IND +--echo # +--echo # Ensure that adding indexes with virtual columns are not promoted to +--echo # primary keys +--echo # +--echo # Base line with normal column - should be promoted +CREATE TABLE t0(a INT NOT NULL) ENGINE=INNODB; +ALTER TABLE t0 ADD UNIQUE INDEX (a); + +--echo # Case a: Create table with virtual unique not null column +CREATE TABLE t1(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL UNIQUE) ENGINE=INNODB; +SELECT * FROM t1; + +--echo # Case b: Create table with index on virtual point column +CREATE TABLE t2(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL, UNIQUE INDEX no_pk(a(1))) ENGINE=INNODB; +SELECT * FROM t2; + +--echo # Case c: Add unique index on virtual point column +CREATE TABLE t3(a POINT GENERATED ALWAYS AS (POINT(1,1)) VIRTUAL) +ENGINE=INNODB; +ALTER TABLE t3 ADD UNIQUE INDEX (a(1)); +SELECT * FROM t3; + +--echo # Case d: Add unique index on virtual blob column +CREATE TABLE t4 (a BLOB, b BLOB GENERATED ALWAYS AS (a) VIRTUAL) ENGINE=INNODB; +ALTER TABLE t4 ADD UNIQUE INDEX (b(1)); +SELECT * FROM t4; + +--echo # Query I_S to verify that 'a' is promoted to pk only when it +--echo # isn't virtual +SELECT T.NAME AS TABLE_NAME, I.NAME AS INDEX_NAME, + CASE (I.TYPE & 3) + WHEN 3 THEN "yes" + ELSE "no" END AS IS_PRIMARY_KEY, + F.NAME AS FIELD_NAME, F.POS AS FIELD_POS FROM + INFORMATION_SCHEMA.INNODB_SYS_TABLES AS T JOIN + INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS I JOIN + INFORMATION_SCHEMA.INNODB_SYS_FIELDS AS F + ON I.INDEX_ID = F.INDEX_ID AND I.TABLE_ID = T.TABLE_ID + WHERE T.NAME LIKE 'test/%'; + +DROP TABLE t0; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/gcol/t/main_mysqldump.test b/mysql-test/suite/gcol/t/main_mysqldump.test new file mode 100644 index 00000000000..c2b4efd09c3 --- /dev/null +++ b/mysql-test/suite/gcol/t/main_mysqldump.test @@ -0,0 +1,44 @@ +--source include/have_innodb.inc +--source include/not_embedded.inc + +CREATE DATABASE dump_generated; +USE dump_generated; +CREATE TABLE t1 (pk INTEGER, a INTEGER, b INTEGER, c VARCHAR(16), + sum INTEGER GENERATED ALWAYS AS (a+b), + sub VARCHAR(4) GENERATED ALWAYS AS (SUBSTRING(c, 1, 4)), + key k1(sum), + key k2(sub) +) engine=innodb; +INSERT INTO t1(pk, a, b, c) VALUES (1, 11, 12, 'oneone'), (2, 21, 22, 'twotwo'); +SELECT * FROM t1; +--exec $MYSQL_DUMP dump_generated t1 > $MYSQLTEST_VARDIR/tmp/t1.sql +DELETE FROM t1; +--exec $MYSQL dump_generated < $MYSQLTEST_VARDIR/tmp/t1.sql +SELECT * FROM t1; +--exec $MYSQL_DUMP dump_generated t1 --tab=$MYSQLTEST_VARDIR/tmp/ +DELETE FROM t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t1 +SELECT * FROM t1; +DROP TABLE t1; + +--echo # A table with regular columns after generated +CREATE TABLE t2 (pk INTEGER, a INTEGER, b INTEGER, + sum INTEGER GENERATED ALWAYS AS (a+b), + c VARCHAR(16), + key k1(sum) +) engine=innodb; +INSERT INTO t2(pk, a, b, c) VALUES (1, 11, 12, 'oneone'), (2, 21, 22, 'twotwo'); +SELECT * FROM t2; +--exec $MYSQL_DUMP dump_generated t2 > $MYSQLTEST_VARDIR/tmp/t2.sql +DELETE FROM t2; +--exec $MYSQL dump_generated < $MYSQLTEST_VARDIR/tmp/t2.sql +SELECT * FROM t2; +--exec $MYSQL_DUMP dump_generated t2 --tab=$MYSQLTEST_VARDIR/tmp/ +DELETE FROM t2; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t2.txt' INTO TABLE t2 +SELECT * FROM t2; +DROP TABLE t2; + +DROP DATABASE dump_generated; diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result index 3bb786c4654..b402af84231 100644 --- a/mysql-test/suite/innodb/r/innodb_bug12400341.result +++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result @@ -14,17 +14,17 @@ innodb_file_per_table ON drop database if exists mysqltest; create database mysqltest; CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; count(*) 33 connection default; CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; ERROR HY000: Can't create table `mysqltest`.`testtable` (errno: 177 "Too many active concurrent transactions") -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; count(*) 33 connection default; -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; count(*) 33 drop database mysqltest; diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index 9a96f29fc3b..2cacefc6595 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -59,7 +59,7 @@ while ($c) } --enable_query_log -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; # # fill the all undo slots @@ -80,7 +80,7 @@ connection default; --error ER_CANT_CREATE_TABLE CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; --disable_query_log let $c = 32; @@ -93,7 +93,7 @@ while ($c) --enable_query_log connection default; -select count(*) from information_schema.processlist; +select count(*) from information_schema.processlist where command != 'Daemon'; --disable_query_log let $c = 32; diff --git a/mysql-test/suite/perfschema/r/threads_innodb.result b/mysql-test/suite/perfschema/r/threads_innodb.result index 3fb469ad00b..2229d972038 100644 --- a/mysql-test/suite/perfschema/r/threads_innodb.result +++ b/mysql-test/suite/perfschema/r/threads_innodb.result @@ -15,3 +15,4 @@ thread/innodb/srv_lock_timeout_thread BACKGROUND NULL NULL NULL NULL NULL NULL N thread/innodb/srv_master_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES thread/innodb/srv_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES thread/innodb/srv_purge_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES +thread/innodb/thd_destructor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL 1 NULL YES diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 6c7429b2a03..79450d41684 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -7,7 +7,7 @@ SET @@session.storage_engine = 'InnoDB'; # - CHECK (allowed but not used) # UNIQUE create table t1 (a int, b int as (a*2) unique); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent unique); show create table t1; Table Create Table @@ -22,7 +22,7 @@ a int(11) YES NULL b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent, unique (b)); show create table t1; Table Create Table @@ -38,7 +38,6 @@ b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1; create table t1 (a int, b int as (a*2) persistent); alter table t1 add unique key (b); @@ -50,9 +49,9 @@ drop table t1; # # INDEX create table t1 (a int, b int as (a*2), index (b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2), index (a,b)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +drop table t1; create table t1 (a int, b int as (a*2) persistent, index (b)); show create table t1; Table Create Table @@ -81,9 +80,7 @@ b int(11) YES NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column alter table t1 add index (a,b); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1; create table t1 (a int, b int as (a*2) persistent); alter table t1 add index (b); @@ -125,12 +122,11 @@ ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a comput alter table t1 add foreign key (b) references t2(a) on delete set null; ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column drop table t1; -create table t1 (a int, b int as (a+1), -foreign key (b) references t2(a)); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +create table t1 (a int, b int as (a+1), foreign key (b) references t2(a)); +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") create table t1 (a int, b int as (a+1)); alter table t1 add foreign key (b) references t2(a); -ERROR HY000: Key/Index cannot be defined on a non-stored computed column +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") drop table t1; # Allowed FK options. create table t2 (a int primary key, b char(5)); diff --git a/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test index 34efc6e1f30..8eeef96b43f 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test +++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test @@ -41,6 +41,7 @@ SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines +let $with_foreign_keys = 1; --source suite/vcol/inc/vcol_keys.inc #------------------------------------------------------------------------------# diff --git a/sql/handler.cc b/sql/handler.cc index 4155057ebe8..37e60f5c9bd 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4242,6 +4242,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info::ALTER_COLUMN_OPTION | Alter_inplace_info::CHANGE_CREATE_OPTION | Alter_inplace_info::ALTER_PARTITIONED | + Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR | Alter_inplace_info::ALTER_RENAME; /* Is there at least one operation that requires copy algorithm? */ diff --git a/sql/handler.h b/sql/handler.h index 112b9212e93..d7fa5061e87 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1838,34 +1838,50 @@ public: typedef ulonglong HA_ALTER_FLAGS; // Add non-unique, non-primary index - static const HA_ALTER_FLAGS ADD_INDEX = 1L << 0; + static const HA_ALTER_FLAGS ADD_INDEX = 1ULL << 0; + // + // Adds a spatial index. At the moment all engines treat it + // identically to the ADD_INDEX, so it gets the same code + static const HA_ALTER_FLAGS ADD_SPATIAL_INDEX = ADD_INDEX; // Drop non-unique, non-primary index - static const HA_ALTER_FLAGS DROP_INDEX = 1L << 1; + static const HA_ALTER_FLAGS DROP_INDEX = 1ULL << 1; // Add unique, non-primary index - static const HA_ALTER_FLAGS ADD_UNIQUE_INDEX = 1L << 2; + static const HA_ALTER_FLAGS ADD_UNIQUE_INDEX = 1ULL << 2; // Drop unique, non-primary index - static const HA_ALTER_FLAGS DROP_UNIQUE_INDEX = 1L << 3; + static const HA_ALTER_FLAGS DROP_UNIQUE_INDEX = 1ULL << 3; // Add primary index - static const HA_ALTER_FLAGS ADD_PK_INDEX = 1L << 4; + static const HA_ALTER_FLAGS ADD_PK_INDEX = 1ULL << 4; // Drop primary index - static const HA_ALTER_FLAGS DROP_PK_INDEX = 1L << 5; + static const HA_ALTER_FLAGS DROP_PK_INDEX = 1ULL << 5; - // Add column - static const HA_ALTER_FLAGS ADD_COLUMN = 1L << 6; + // Virtual generated column + static const HA_ALTER_FLAGS ADD_VIRTUAL_COLUMN = 1ULL << 6; + // Stored base (non-generated) column + static const HA_ALTER_FLAGS ADD_STORED_BASE_COLUMN = 1ULL << 7; + // Stored generated column + static const HA_ALTER_FLAGS ADD_STORED_GENERATED_COLUMN= 1ULL << 8; + // Add generic column (convience constant). + static const HA_ALTER_FLAGS ADD_COLUMN= ADD_VIRTUAL_COLUMN | + ADD_STORED_BASE_COLUMN | + ADD_STORED_GENERATED_COLUMN; // Drop column - static const HA_ALTER_FLAGS DROP_COLUMN = 1L << 7; + static const HA_ALTER_FLAGS DROP_VIRTUAL_COLUMN = 1ULL << 9; + static const HA_ALTER_FLAGS DROP_STORED_COLUMN = 1ULL << 10; + static const HA_ALTER_FLAGS DROP_COLUMN= DROP_VIRTUAL_COLUMN | + DROP_STORED_COLUMN; // Rename column - static const HA_ALTER_FLAGS ALTER_COLUMN_NAME = 1L << 8; + static const HA_ALTER_FLAGS ALTER_COLUMN_NAME = 1ULL << 11; // Change column datatype - static const HA_ALTER_FLAGS ALTER_COLUMN_TYPE = 1L << 9; + static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_TYPE = 1ULL << 12; + static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_TYPE = 1ULL << 13; /** Change column datatype in such way that new type has compatible @@ -1873,83 +1889,94 @@ public: possible to perform change by only updating data dictionary without changing table rows. */ - static const HA_ALTER_FLAGS ALTER_COLUMN_EQUAL_PACK_LENGTH = 1L << 10; + static const HA_ALTER_FLAGS ALTER_COLUMN_EQUAL_PACK_LENGTH = 1ULL << 14; // Reorder column - static const HA_ALTER_FLAGS ALTER_COLUMN_ORDER = 1L << 11; + static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_ORDER = 1ULL << 15; + + // Reorder column + static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_ORDER = 1ULL << 16; // Change column from NOT NULL to NULL - static const HA_ALTER_FLAGS ALTER_COLUMN_NULLABLE = 1L << 12; + static const HA_ALTER_FLAGS ALTER_COLUMN_NULLABLE = 1ULL << 17; // Change column from NULL to NOT NULL - static const HA_ALTER_FLAGS ALTER_COLUMN_NOT_NULLABLE = 1L << 13; + static const HA_ALTER_FLAGS ALTER_COLUMN_NOT_NULLABLE = 1ULL << 18; // Set or remove default column value - static const HA_ALTER_FLAGS ALTER_COLUMN_DEFAULT = 1L << 14; + static const HA_ALTER_FLAGS ALTER_COLUMN_DEFAULT = 1ULL << 19; + // Change column generation expression + static const HA_ALTER_FLAGS ALTER_VIRTUAL_GCOL_EXPR = 1ULL << 20; + static const HA_ALTER_FLAGS ALTER_STORED_GCOL_EXPR = 1ULL << 21; + // // Add foreign key - static const HA_ALTER_FLAGS ADD_FOREIGN_KEY = 1L << 15; + static const HA_ALTER_FLAGS ADD_FOREIGN_KEY = 1ULL << 22; // Drop foreign key - static const HA_ALTER_FLAGS DROP_FOREIGN_KEY = 1L << 16; + static const HA_ALTER_FLAGS DROP_FOREIGN_KEY = 1ULL << 23; // table_options changed, see HA_CREATE_INFO::used_fields for details. - static const HA_ALTER_FLAGS CHANGE_CREATE_OPTION = 1L << 17; + static const HA_ALTER_FLAGS CHANGE_CREATE_OPTION = 1ULL << 24; // Table is renamed - static const HA_ALTER_FLAGS ALTER_RENAME = 1L << 18; + static const HA_ALTER_FLAGS ALTER_RENAME = 1ULL << 25; // column's engine options changed, something in field->option_struct - static const HA_ALTER_FLAGS ALTER_COLUMN_OPTION = 1L << 19; + static const HA_ALTER_FLAGS ALTER_COLUMN_OPTION = 1ULL << 26; // MySQL alias for the same thing: - static const HA_ALTER_FLAGS ALTER_COLUMN_STORAGE_TYPE = 1L << 19; + static const HA_ALTER_FLAGS ALTER_COLUMN_STORAGE_TYPE = 1ULL << 26; // Change the column format of column - static const HA_ALTER_FLAGS ALTER_COLUMN_COLUMN_FORMAT = 1L << 20; + static const HA_ALTER_FLAGS ALTER_COLUMN_COLUMN_FORMAT = 1ULL << 27; // Add partition - static const HA_ALTER_FLAGS ADD_PARTITION = 1L << 21; + static const HA_ALTER_FLAGS ADD_PARTITION = 1ULL << 28; // Drop partition - static const HA_ALTER_FLAGS DROP_PARTITION = 1L << 22; + static const HA_ALTER_FLAGS DROP_PARTITION = 1ULL << 29; // Changing partition options - static const HA_ALTER_FLAGS ALTER_PARTITION = 1L << 23; + static const HA_ALTER_FLAGS ALTER_PARTITION = 1ULL << 30; // Coalesce partition - static const HA_ALTER_FLAGS COALESCE_PARTITION = 1L << 24; + static const HA_ALTER_FLAGS COALESCE_PARTITION = 1ULL << 31; // Reorganize partition ... into - static const HA_ALTER_FLAGS REORGANIZE_PARTITION = 1L << 25; + static const HA_ALTER_FLAGS REORGANIZE_PARTITION = 1ULL << 32; // Reorganize partition - static const HA_ALTER_FLAGS ALTER_TABLE_REORG = 1L << 26; + static const HA_ALTER_FLAGS ALTER_TABLE_REORG = 1ULL << 33; // Remove partitioning - static const HA_ALTER_FLAGS ALTER_REMOVE_PARTITIONING = 1L << 27; + static const HA_ALTER_FLAGS ALTER_REMOVE_PARTITIONING = 1ULL << 34; // Partition operation with ALL keyword - static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1L << 28; + static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1ULL << 35; /** Recreate the table for ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE operations. */ - static const HA_ALTER_FLAGS RECREATE_TABLE = 1L << 29; + static const HA_ALTER_FLAGS RECREATE_TABLE = 1ULL << 36; - // Virtual columns changed - static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1L << 30; + /** + Changes in generated columns that affect storage, + for example, when a vcol type or expression changes + and this vcol is indexed or used in a partitioning expression + */ + static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1ULL << 37; /** ALTER TABLE for a partitioned table. The engine needs to commit online alter of all partitions atomically (using group_commit_ctx) */ - static const HA_ALTER_FLAGS ALTER_PARTITIONED = 1L << 31; + static const HA_ALTER_FLAGS ALTER_PARTITIONED = 1ULL << 38; - static const HA_ALTER_FLAGS ALTER_ADD_CHECK_CONSTRAINT = 1LL << 32; + static const HA_ALTER_FLAGS ALTER_ADD_CHECK_CONSTRAINT = 1ULL << 39; - static const HA_ALTER_FLAGS ALTER_DROP_CHECK_CONSTRAINT= 1LL << 33; + static const HA_ALTER_FLAGS ALTER_DROP_CHECK_CONSTRAINT= 1ULL << 40; /** Create options (like MAX_ROWS) for the new version of table. diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ac337afb65d..343511d665c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4383,6 +4383,93 @@ extern "C" int thd_is_connected(MYSQL_THD thd) #ifdef INNODB_COMPATIBILITY_HOOKS + +/** open a table and add it to thd->open_tables + + @note At the moment this is used in innodb background purge threads + *only*.There should be no table locks, because the background purge does not + change the table as far as LOCK TABLES is concerned. MDL locks are + still needed, though. + + To make sure no table stays open for long, this helper allows the thread to + have only one table open at any given time. +*/ +TABLE *open_purge_table(THD *thd, const char *db, size_t dblen, + const char *tb, size_t tblen) +{ + DBUG_ENTER("open_purge_table"); + DBUG_ASSERT(thd->open_tables == NULL); + DBUG_ASSERT(thd->locked_tables_mode < LTM_PRELOCKED); + + Open_table_context ot_ctx(thd, 0); + TABLE_LIST *tl= (TABLE_LIST*)thd->alloc(sizeof(TABLE_LIST)); + + tl->init_one_table(db, dblen, tb, tblen, tb, TL_READ); + tl->i_s_requested_object= OPEN_TABLE_ONLY; + + bool error= open_table(thd, tl, &ot_ctx); + + /* we don't recover here */ + DBUG_ASSERT(!error || !ot_ctx.can_recover_from_failed_open()); + + if (error) + close_thread_tables(thd); + + DBUG_RETURN(error ? NULL : tl->table); +} + +/** Find an open table in the list of prelocked tabled + + Used for foreign key actions, for example, in UPDATE t1 SET a=1; + where a child table t2 has a KB on t1.a. + + But only when virtual columns are involved, otherwise InnoDB + does not need an open TABLE. +*/ +TABLE *find_fk_open_table(THD *thd, const char *db, size_t db_len, + const char *table, size_t table_len) +{ + for (TABLE *t= thd->open_tables; t; t= t->next) + { + if (t->s->db.length == db_len && t->s->table_name.length == table_len && + !strcmp(t->s->db.str, db) && !strcmp(t->s->table_name.str, table) && + t->pos_in_table_list->prelocking_placeholder == TABLE_LIST::FK) + return t; + } + return NULL; +} + +/* the following three functions are used in background purge threads */ + +MYSQL_THD create_thd() +{ + THD *thd= new THD(next_thread_id()); + thd->thread_stack= (char*) &thd; + thd->store_globals(); + thd->set_command(COM_DAEMON); + thd->system_thread= SYSTEM_THREAD_GENERIC; + add_to_active_threads(thd); + return thd; +} + +void destroy_thd(MYSQL_THD thd) +{ + delete_running_thd(thd); +} + +void reset_thd(MYSQL_THD thd) +{ + close_thread_tables(thd); + thd->mdl_context.release_transactional_locks(); + thd->free_items(); + free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC)); +} + +unsigned long long thd_get_query_id(const MYSQL_THD thd) +{ + return((unsigned long long)thd->query_id); +} + extern "C" const struct charset_info_st *thd_charset(MYSQL_THD thd) { return(thd->charset()); diff --git a/sql/sql_class.h b/sql/sql_class.h index 9beee19eae0..f2e6f131f5f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1622,7 +1622,8 @@ enum enum_thread_type SYSTEM_THREAD_EVENT_SCHEDULER= 8, SYSTEM_THREAD_EVENT_WORKER= 16, SYSTEM_THREAD_BINLOG_BACKGROUND= 32, - SYSTEM_THREAD_SLAVE_BACKGROUND= 64 + SYSTEM_THREAD_SLAVE_BACKGROUND= 64, + SYSTEM_THREAD_GENERIC= 128 }; inline char const * diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d80706e6796..6dc91928ded 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1085,20 +1085,11 @@ void do_handle_bootstrap(THD *thd) end: in_bootstrap= FALSE; delete thd; - if (!opt_bootstrap) - { - /* - We need to wake up main thread in case of read_init_file(). - This is not done by THD::~THD() when there are other threads running - (binlog background thread, for example). So do it here again. - */ - mysql_mutex_lock(&LOCK_thread_count); - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); - } + mysql_mutex_lock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); #ifndef EMBEDDED_LIBRARY - DBUG_ASSERT(!opt_bootstrap || thread_count == 0); my_thread_end(); pthread_exit(0); #endif diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 16c8214438b..5e93fac1ddd 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6216,17 +6216,6 @@ static int compare_uint(const uint *s, const uint *t) } -/* - Check if the column is computed and either - is stored or is used in the partitioning expression. -*/ -static bool vcol_affecting_storage(const Virtual_column_info* vcol, - bool indexed) -{ - return vcol && - (vcol->is_stored() || vcol->is_in_partitioning_expr() || indexed); -} - /** Compare original and new versions of a table and fill Alter_inplace_info describing differences between those versions. @@ -6291,11 +6280,6 @@ static bool fill_alter_inplace_info(THD *thd, alter_info->key_list.elements))) DBUG_RETURN(true); - /* First we setup ha_alter_flags based on what was detected by parser. */ - if (alter_info->flags & Alter_info::ALTER_ADD_COLUMN) - ha_alter_info->handler_flags|= Alter_inplace_info::ADD_COLUMN; - if (alter_info->flags & Alter_info::ALTER_DROP_COLUMN) - ha_alter_info->handler_flags|= Alter_inplace_info::DROP_COLUMN; /* Comparing new and old default values of column is cumbersome. So instead of using such a comparison for detecting if default @@ -6343,7 +6327,7 @@ static bool fill_alter_inplace_info(THD *thd, upgrading VARCHAR column types. */ if (table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar) - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; + ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; /* Go through fields in old version of table and detect changes to them. @@ -6357,20 +6341,23 @@ static bool fill_alter_inplace_info(THD *thd, about nature of changes than those provided from parser. */ bool maybe_alter_vcol= false; - for (f_ptr= table->field; (field= *f_ptr); f_ptr++) + uint field_stored_index= 0; + for (f_ptr= table->field; (field= *f_ptr); f_ptr++, + field_stored_index+= field->stored_in_db()) { /* Clear marker for renamed or dropped field which we are going to set later. */ field->flags&= ~(FIELD_IS_RENAMED | FIELD_IS_DROPPED); /* Use transformed info to evaluate flags for storage engine. */ - uint new_field_index= 0; + uint new_field_index= 0, new_field_stored_index= 0; new_field_it.init(alter_info->create_list); while ((new_field= new_field_it++)) { if (new_field->field == field) break; new_field_index++; + new_field_stored_index+= new_field->stored_in_db(); } if (new_field) @@ -6385,7 +6372,12 @@ static bool fill_alter_inplace_info(THD *thd, { case IS_EQUAL_NO: /* New column type is incompatible with old one. */ - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; + if (field->stored_in_db()) + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; + else + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE; if (table->s->tmp_table == NO_TMP_TABLE) { delete_statistics_for_column(thd, table, field); @@ -6430,31 +6422,57 @@ static bool fill_alter_inplace_info(THD *thd, default: DBUG_ASSERT(0); /* Safety. */ - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; } - if (vcol_affecting_storage(field->vcol_info, - field->flags & PART_KEY_FLAG) || - vcol_affecting_storage(new_field->vcol_info, false)) + if (field->vcol_info || new_field->vcol_info) { - if (is_equal == IS_EQUAL_NO || - !field->vcol_info || !new_field->vcol_info || - !field->vcol_info->is_equal(new_field->vcol_info)) - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; - else + /* base <-> virtual or stored <-> virtual */ + if (field->stored_in_db() != new_field->stored_in_db()) + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE | + Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE; + if (field->vcol_info && new_field->vcol_info) { - if (!(ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_VCOL) && - (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_DEFAULT)) + bool value_changes= is_equal == IS_EQUAL_NO; + Alter_inplace_info::HA_ALTER_FLAGS alter_expr= field->stored_in_db() + ? Alter_inplace_info::ALTER_STORED_GCOL_EXPR + : Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR; + if (!field->vcol_info->is_equal(new_field->vcol_info)) + { + ha_alter_info->handler_flags|= alter_expr; + value_changes= true; + } + + if ((ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_DEFAULT) + && !(ha_alter_info->handler_flags & alter_expr)) { /* - a DEFAULT value of a some column was changed. - see if this vcol uses DEFAULT() function + a DEFAULT value of a some column was changed. see if this vcol + uses DEFAULT() function. The check is kind of expensive, so don't + do it if ALTER_COLUMN_VCOL is already set. */ if (field->vcol_info->expr_item->walk( &Item::check_func_default_processor, 0, 0)) - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; + { + ha_alter_info->handler_flags|= alter_expr; + value_changes= true; + } + } + + if (field->vcol_info->is_in_partitioning_expr() || + field->flags & PART_KEY_FLAG) + { + if (value_changes) + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_COLUMN_VCOL; + else + maybe_alter_vcol= true; } } - maybe_alter_vcol= true; + else /* base <-> stored */ + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; } /* Check if field was renamed */ @@ -6487,8 +6505,18 @@ static bool fill_alter_inplace_info(THD *thd, /* Detect changes in column order. */ - if (field->field_index != new_field_index) - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_ORDER; + if (field->stored_in_db()) + { + if (field_stored_index != new_field_stored_index) + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER; + } + else + { + if (field->field_index != new_field_index) + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER; + } /* Detect changes in storage type of column */ if (new_field->field_storage_type() != field->field_storage_type()) @@ -6511,12 +6539,12 @@ static bool fill_alter_inplace_info(THD *thd, } else { - /* - Field is not present in new version of table and therefore was dropped. - Corresponding storage engine flag should be already set. - */ - DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::DROP_COLUMN); + // Field is not present in new version of table and therefore was dropped. field->flags|= FIELD_IS_DROPPED; + if (field->stored_in_db()) + ha_alter_info->handler_flags|= Alter_inplace_info::DROP_STORED_COLUMN; + else + ha_alter_info->handler_flags|= Alter_inplace_info::DROP_VIRTUAL_COLUMN; } } @@ -6529,9 +6557,10 @@ static bool fill_alter_inplace_info(THD *thd, column was altered. */ if (ha_alter_info->handler_flags & - ( Alter_inplace_info::ALTER_COLUMN_TYPE - | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE - | Alter_inplace_info::ALTER_COLUMN_OPTION )) + ( Alter_inplace_info::ALTER_STORED_COLUMN_TYPE + | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE + | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE + | Alter_inplace_info::ALTER_COLUMN_OPTION )) ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; } @@ -6540,17 +6569,17 @@ static bool fill_alter_inplace_info(THD *thd, { if (! new_field->field) { - /* - Field is not present in old version of table and therefore was added. - Again corresponding storage engine flag should be already set. - */ - DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN); - - if (new_field->vcol_info && - (new_field->stored_in_db() || new_field->vcol_info->is_in_partitioning_expr())) - { - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; - } + // Field is not present in old version of table and therefore was added. + if (new_field->vcol_info) + if (new_field->stored_in_db()) + ha_alter_info->handler_flags|= + Alter_inplace_info::ADD_STORED_GENERATED_COLUMN; + else + ha_alter_info->handler_flags|= + Alter_inplace_info::ADD_VIRTUAL_COLUMN; + else + ha_alter_info->handler_flags|= + Alter_inplace_info::ADD_STORED_BASE_COLUMN; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 598047e31d6..a235195ae91 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -126,6 +126,14 @@ this program; if not, write to the Free Software Foundation, Inc., #define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X)) extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all); +unsigned long long thd_get_query_id(const MYSQL_THD thd); +TABLE *find_fk_open_table(THD *thd, const char *db, size_t db_len, + const char *table, size_t table_len); +MYSQL_THD create_thd(); +void destroy_thd(MYSQL_THD thd); +void reset_thd(MYSQL_THD thd); +TABLE *open_purge_table(THD *thd, const char *db, size_t dblen, + const char *tb, size_t tblen); #ifdef MYSQL_DYNAMIC_PLUGIN #define tc_size 400 @@ -300,6 +308,45 @@ is_partition( #endif /* _WIN32 */ } +/** Service thread that waits for the server shutdown and stops purge threads. +Purge workers have THDs that are needed to calculate virtual columns. +This THDs must be destroyed rather early in the server shutdown sequence. +This service thread creates a THD and idly waits for it to get a signal to +die. Then it notifies all purge workers to shutdown. +*/ +st_my_thread_var *thd_destructor_myvar= NULL; +mysql_cond_t thd_destructor_cond; +pthread_t thd_destructor_thread; + +pthread_handler_t +thd_destructor_proxy(void *) +{ + mysql_mutex_t thd_destructor_mutex; + + my_thread_init(); + mysql_mutex_init(PSI_NOT_INSTRUMENTED, &thd_destructor_mutex, 0); + mysql_cond_init(PSI_NOT_INSTRUMENTED, &thd_destructor_cond, 0); + + thd_destructor_myvar = _my_thread_var(); + THD *thd= create_thd(); + + mysql_mutex_lock(&thd_destructor_mutex); + thd_destructor_myvar->current_mutex = &thd_destructor_mutex; + thd_destructor_myvar->current_cond = &thd_destructor_cond; + /* wait until the server wakes the THD to abort and die */ + while (!thd_destructor_myvar->abort) + mysql_cond_wait(&thd_destructor_cond, &thd_destructor_mutex); + mysql_mutex_unlock(&thd_destructor_mutex); + thd_destructor_myvar = NULL; + + srv_purge_wakeup(); + + destroy_thd(thd); + mysql_cond_destroy(&thd_destructor_cond); + mysql_mutex_destroy(&thd_destructor_mutex); + my_thread_end(); + return 0; +} /** Return the InnoDB ROW_FORMAT enum value @param[in] row_format row_format from "innodb_default_row_format" @@ -473,6 +520,7 @@ static mysql_pfs_key_t innobase_share_mutex_key; static mysql_pfs_key_t commit_cond_mutex_key; static mysql_pfs_key_t commit_cond_key; static mysql_pfs_key_t pending_checkpoint_mutex_key; +static mysql_pfs_key_t thd_destructor_thread_key; static PSI_mutex_info all_pthread_mutexes[] = { PSI_KEY(commit_cond_mutex), @@ -601,6 +649,7 @@ static PSI_thread_info all_innodb_threads[] = { PSI_KEY(srv_purge_thread), PSI_KEY(srv_worker_thread), PSI_KEY(trx_rollback_clean_thread), + PSI_KEY(thd_destructor_thread), }; # endif /* UNIV_PFS_THREAD */ @@ -1718,6 +1767,55 @@ thd_trx_is_read_only( return(thd != 0 && thd_tx_is_read_only(thd)); } +static MYSQL_THDVAR_BOOL(background_thread, + PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOSYSVAR, + "Internal (not user visible) flag to mark " + "background purge threads", NULL, NULL, 0); + +/** Create a MYSQL_THD for background purge threads and mark it as such. +@returns new MYSQL_THD */ +MYSQL_THD +innobase_create_background_thd() +/*============================*/ +{ + MYSQL_THD thd= create_thd(); + THDVAR(thd, background_thread) = true; + return thd; +} + + +/** Destroy a background purge thread THD. +@param[in] thd MYSQL_THD to destroy */ +void +innobase_destroy_background_thd( +/*============================*/ + MYSQL_THD thd) +{ + /* need to close the connection explicitly, the server won't do it + if innodb is in the PLUGIN_IS_DYING state */ + innobase_close_connection(innodb_hton_ptr, thd); + thd_set_ha_data(thd, innodb_hton_ptr, NULL); + destroy_thd(thd); +} + +/** Close opened tables, free memory, delete items for a MYSQL_THD. +@param[in] thd MYSQL_THD to reset */ +void +innobase_reset_background_thd(MYSQL_THD thd) +{ + if (!thd) { + thd = current_thd; + } + + ut_ad(thd); + ut_ad(THDVAR(thd, background_thread)); + + /* background purge thread */ + reset_thd(thd); + thd_proc_info(thd, ""); +} + + #if 0 /** Check if the transaction can be rolled back @@ -3252,6 +3350,7 @@ ha_innobase::ha_innobase( | HA_CAN_VIRTUAL_COLUMNS | HA_CAN_INDEX_BLOBS | HA_CAN_SQL_HANDLER + | HA_REQUIRES_KEY_COLUMNS_FOR_DELETE | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_PRIMARY_KEY_IN_READ_INDEX | HA_BINLOG_ROW_CAPABLE @@ -4582,6 +4681,12 @@ innobase_change_buffering_inited_ok: } */ + if (!srv_read_only_mode) { + mysql_thread_create(thd_destructor_thread_key, + &thd_destructor_thread, + NULL, thd_destructor_proxy, NULL); + } + /* Since we in this module access directly the fields of a trx struct, and due to different headers and flags it might happen that ib_mutex_t has a different size in this module and in InnoDB @@ -4716,6 +4821,13 @@ innobase_end( #ifdef MYSQL_ENCRYPTION mutex_free(&master_key_id_mutex); #endif + + if (!abort_loop && thd_destructor_myvar) { + // may be UNINSTALL PLUGIN statement + thd_destructor_myvar->abort = 1; + mysql_cond_broadcast(thd_destructor_myvar->current_cond); + } + if (innobase_shutdown_for_mysql() != DB_SUCCESS) { err = 1; } @@ -5838,6 +5950,36 @@ ha_innobase::keys_to_use_for_scanning() return(&key_map_full); } +/****************************************************************//** +Ensures that if there's a concurrent inplace ADD INDEX, being-indexed virtual +columns are computed. They are not marked as indexed in the old table, so the +server won't add them to the vcol_set automatically */ +void +ha_innobase::column_bitmaps_signal() +/*================================*/ +{ + if (!table->vfield || table->current_lock != F_WRLCK) { + return; + } + + dict_index_t* clust_index = dict_table_get_first_index(m_prebuilt->table); + uint num_v = 0; + for (uint j = 0; j < table->s->virtual_fields; j++) { + if (table->vfield[j]->stored_in_db()) { + continue; + } + + dict_col_t* col = &m_prebuilt->table->v_cols[num_v].m_col; + if (col->ord_part || + (dict_index_is_online_ddl(clust_index) && + row_log_col_is_indexed(clust_index, num_v))) { + table->mark_virtual_col(table->vfield[j]); + } + num_v++; + } +} + + /****************************************************************//** Determines if table caching is supported. @return HA_CACHE_TBL_ASKTRANSACT */ @@ -6168,7 +6310,6 @@ innobase_match_index_columns( DBUG_RETURN(TRUE); } -#ifdef MYSQL_VIRTUAL_COLUMNS /** Build a template for a base column for a virtual column @param[in] table MySQL TABLE @param[in] clust_index InnoDB clustered index @@ -6228,21 +6369,6 @@ innobase_vcol_build_templ( templ->is_unsigned = col->prtype & DATA_UNSIGNED; } -/** callback used by MySQL server layer to initialize -the table virtual columns' template -@param[in] table MySQL TABLE -@param[in,out] ib_table InnoDB table */ -void -innobase_build_v_templ_callback( - const TABLE* table, - void* ib_table) -{ - const dict_table_t* t_table = static_cast(ib_table); - - innobase_build_v_templ(table, t_table, t_table->vc_templ, NULL, - true, NULL); -} - /** Build template for the virtual columns and their base columns. This is done when the table first opened. @param[in] table MySQL TABLE @@ -6250,16 +6376,14 @@ is done when the table first opened. @param[in,out] s_templ InnoDB template structure @param[in] add_v new virtual columns added along with add index call -@param[in] locked true if dict_sys mutex is held -@param[in] share_tbl_name original MySQL table name */ +@param[in] locked true if dict_sys mutex is held */ void innobase_build_v_templ( const TABLE* table, const dict_table_t* ib_table, dict_vcol_templ_t* s_templ, const dict_add_v_col_t* add_v, - bool locked, - const char* share_tbl_name) + bool locked) { ulint ncol = ib_table->n_cols - DATA_N_SYS_COLS; ulint n_v_col = ib_table->n_v_cols; @@ -6291,15 +6415,8 @@ innobase_build_v_templ( * sizeof *s_templ->vtempl)); s_templ->n_col = ncol; s_templ->n_v_col = n_v_col; - s_templ->rec_len = table->s->stored_rec_length; - // JAN: MySQL 5.6 - // s_templ->default_rec = table->s->default_values; - - s_templ->default_rec = static_cast( - ut_malloc_nokey(table->s->stored_rec_length)); - memcpy(s_templ->default_rec, table->s->default_values, - table->s->stored_rec_length); - + s_templ->rec_len = table->s->reclength; + s_templ->default_rec = table->s->default_values; /* Mark those columns could be base columns */ for (ulint i = 0; i < ib_table->n_v_cols; i++) { @@ -6399,12 +6516,7 @@ innobase_build_v_templ( s_templ->db_name = table->s->db.str; s_templ->tb_name = table->s->table_name.str; - - if (share_tbl_name) { - s_templ->share_name = share_tbl_name; - } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /*******************************************************************//** This function builds a translation table in INNOBASE_SHARE @@ -6774,14 +6886,14 @@ ha_innobase::open( if (ib_table != NULL && ((!DICT_TF2_FLAG_IS_SET(ib_table, DICT_TF2_FTS_HAS_DOC_ID) - && table->s->stored_fields != dict_table_get_n_tot_u_cols(ib_table)) + && table->s->fields != dict_table_get_n_tot_u_cols(ib_table)) || (DICT_TF2_FLAG_IS_SET(ib_table, DICT_TF2_FTS_HAS_DOC_ID) - && (table->s->stored_fields + && (table->s->fields != dict_table_get_n_tot_u_cols(ib_table) - 1)))) { ib::warn() << "Table " << norm_name << " contains " << dict_table_get_n_user_cols(ib_table) << " user" - " defined columns in InnoDB, but " << table->s->stored_fields + " defined columns in InnoDB, but " << table->s->fields << " columns in MariaDB. Please check" " INFORMATION_SCHEMA.INNODB_SYS_COLUMNS and " REFMAN "innodb-troubleshooting.html for how to resolve the" @@ -6927,7 +7039,7 @@ ha_innobase::open( DBUG_RETURN(ret_err); } - m_prebuilt = row_create_prebuilt(ib_table, table->s->stored_rec_length); + m_prebuilt = row_create_prebuilt(ib_table, table->s->reclength); m_prebuilt->default_rec = table->s->default_values; ut_ad(m_prebuilt->default_rec); @@ -6939,12 +7051,10 @@ ha_innobase::open( key_used_on_scan = m_primary_key; -#ifdef MYSQL_VIRTUAL_COLUMNS if (ib_table->n_v_cols) { mutex_enter(&dict_sys->mutex); if (ib_table->vc_templ == NULL) { ib_table->vc_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); - ib_table->vc_templ->vtempl = NULL; } else if (ib_table->get_ref_count() == 1) { /* Clean and refresh the template if no one else get hold on it */ @@ -6955,12 +7065,11 @@ ha_innobase::open( if (ib_table->vc_templ->vtempl == NULL) { innobase_build_v_templ( table, ib_table, ib_table->vc_templ, NULL, - true, m_share->table_name); + true); } mutex_exit(&dict_sys->mutex); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ if (!innobase_build_index_translation(table, ib_table, m_share)) { sql_print_error("Build InnoDB index translation table for" @@ -8058,10 +8167,9 @@ build_template_needs_field( dict_index_t* index, /*!< in: InnoDB index to use */ const TABLE* table, /*!< in: MySQL table object */ ulint i, /*!< in: field index in InnoDB table */ - ulint sql_idx, /*!< in: field index in SQL table */ ulint num_v) /*!< in: num virtual column so far */ { - const Field* field = table->field[sql_idx]; + const Field* field = table->field[i]; if (!index_contains) { if (read_just_key) { @@ -8076,8 +8184,8 @@ build_template_needs_field( return(field); } - if (bitmap_is_set(table->read_set, static_cast(sql_idx)) - || bitmap_is_set(table->write_set, static_cast(sql_idx))) { + if (bitmap_is_set(table->read_set, static_cast(i)) + || bitmap_is_set(table->write_set, static_cast(i))) { /* This field is needed in the query */ return(field); @@ -8259,10 +8367,10 @@ ha_innobase::build_template( { dict_index_t* index; dict_index_t* clust_index; - ulint n_stored_fields; + ulint n_fields; ibool fetch_all_in_key = FALSE; ibool fetch_primary_key_cols = FALSE; - ulint i, sql_idx; + ulint i; if (m_prebuilt->select_lock_type == LOCK_X) { /* We always retrieve the whole clustered index record if we @@ -8315,12 +8423,11 @@ ha_innobase::build_template( /* Below we check column by column if we need to access the clustered index. */ - /* number of stored columns */ - n_stored_fields= (ulint)table->s->stored_fields; + n_fields = (ulint) table->s->fields; /* number of columns */ if (!m_prebuilt->mysql_template) { m_prebuilt->mysql_template = (mysql_row_templ_t*) - ut_malloc_nokey(n_stored_fields * sizeof(mysql_row_templ_t)); + ut_malloc_nokey(n_fields * sizeof(mysql_row_templ_t)); } m_prebuilt->template_type = whole_row @@ -8342,14 +8449,10 @@ ha_innobase::build_template( ulint num_v = 0; /* Push down an index condition or an end_range check. */ - for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { + for (i = 0; i < n_fields; i++) { ibool index_contains; - while (!table->field[sql_idx]->stored_in_db()) { - sql_idx++; - } - - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { index_contains = dict_index_contains_col_or_prefix( index, num_v, true); } else { @@ -8372,8 +8475,7 @@ ha_innobase::build_template( the subset field->part_of_key.is_set(active_index) which would be acceptable if end_range==NULL. */ - bool is_v = innobase_is_v_fld(table->field[sql_idx]); - + bool is_v = innobase_is_v_fld(table->field[i]); if (build_template_needs_field_in_icp( index, m_prebuilt, index_contains, is_v ? num_v : i - num_v, is_v)) { @@ -8382,17 +8484,17 @@ ha_innobase::build_template( mysql_row_templ_t* templ; if (whole_row) { - field = table->field[sql_idx]; + field = table->field[i]; } else { field = build_template_needs_field( index_contains, m_prebuilt->read_just_key, fetch_all_in_key, fetch_primary_key_cols, - index, table, i, sql_idx, num_v); + index, table, i, num_v); if (!field) { if (innobase_is_v_fld( - table->field[sql_idx])) { + table->field[i])) { num_v++; } continue; @@ -8474,7 +8576,7 @@ ha_innobase::build_template( < m_prebuilt->index->n_uniq); */ } - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { num_v++; } } @@ -8486,15 +8588,11 @@ ha_innobase::build_template( /* Include the fields that are not needed in index condition pushdown. */ - for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { + for (i = 0; i < n_fields; i++) { mysql_row_templ_t* templ; ibool index_contains; - while (!table->field[sql_idx]->stored_in_db()) { - sql_idx++; - } - - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { index_contains = dict_index_contains_col_or_prefix( index, num_v, true); } else { @@ -8502,7 +8600,7 @@ ha_innobase::build_template( index, i - num_v, false); } - bool is_v = innobase_is_v_fld(table->field[sql_idx]); + bool is_v = innobase_is_v_fld(table->field[i]); if (!build_template_needs_field_in_icp( index, m_prebuilt, index_contains, @@ -8511,16 +8609,16 @@ ha_innobase::build_template( const Field* field; if (whole_row) { - field = table->field[sql_idx]; + field = table->field[i]; } else { field = build_template_needs_field( index_contains, m_prebuilt->read_just_key, fetch_all_in_key, fetch_primary_key_cols, - index, table, i, sql_idx, num_v); + index, table, i, num_v); if (!field) { - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { num_v++; } continue; @@ -8544,13 +8642,9 @@ ha_innobase::build_template( /* No index condition pushdown */ m_prebuilt->idx_cond = NULL; - for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { + for (i = 0; i < n_fields; i++) { const Field* field; - while (!table->field[sql_idx]->stored_in_db()) { - sql_idx++; - } - if (whole_row) { /* Even this is whole_row, if the seach is on a virtual column, and read_just_key is @@ -8558,7 +8652,7 @@ ha_innobase::build_template( will not try to fill the value since they are not stored in such index nor in the cluster index. */ - if (innobase_is_v_fld(table->field[sql_idx]) + if (innobase_is_v_fld(table->field[i]) && m_prebuilt->read_just_key && !dict_index_contains_col_or_prefix( m_prebuilt->index, num_v, true)) @@ -8570,11 +8664,11 @@ ha_innobase::build_template( continue; } - field = table->field[sql_idx]; + field = table->field[i]; } else { ibool contain; - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { contain = dict_index_contains_col_or_prefix( index, num_v, true); } else { @@ -8583,16 +8677,14 @@ ha_innobase::build_template( false); } - field = build_template_needs_field( contain, m_prebuilt->read_just_key, fetch_all_in_key, fetch_primary_key_cols, - index, table, i, sql_idx, num_v); - + index, table, i, num_v); if (!field) { - if (innobase_is_v_fld(table->field[sql_idx])) { + if (innobase_is_v_fld(table->field[i])) { num_v++; } continue; @@ -9177,7 +9269,7 @@ calc_row_difference( ulint n_changed = 0; dfield_t dfield; dict_index_t* clust_index; - uint sql_idx,i, innodb_idx= 0; + uint i; ibool changes_fts_column = FALSE; ibool changes_fts_doc_col = FALSE; trx_t* trx = thd_to_trx(thd); @@ -9192,19 +9284,15 @@ calc_row_difference( /* We use upd_buff to convert changed fields */ buf = (byte*) upd_buff; - for (sql_idx = 0,i=0; i < n_fields; i++, sql_idx++) { - field = table->field[sql_idx]; + for (i = 0; i < n_fields; i++) { + field = table->field[i]; bool is_virtual = innobase_is_v_fld(field); dict_col_t* col; - if (!field->stored_in_db()) { - continue; - } - if (is_virtual) { col = &prebuilt->table->v_cols[num_v].m_col; } else { - col = &prebuilt->table->cols[innodb_idx - num_v]; + col = &prebuilt->table->cols[i - num_v]; } o_ptr = (const byte*) old_row + get_field_offset(table, field); @@ -9419,7 +9507,7 @@ calc_row_difference( num_v++; } else { ufield->field_no = dict_col_get_clust_pos( - &prebuilt->table->cols[innodb_idx - num_v], + &prebuilt->table->cols[i - num_v], clust_index); ufield->old_v_val = NULL; } @@ -9465,10 +9553,6 @@ calc_row_difference( ut_ad(col->ord_part || online_ord_part); num_v++; } - - if (field->stored_in_db()) { - innodb_idx++; - } } /* If the update changes a column with an FTS index on it, we @@ -9669,12 +9753,11 @@ ha_innobase::update_row( ut_ad(m_upd_buf_size == 0); /* Create a buffer for packing the fields of a record. Why - table->stored_rec_length did not work here? Obviously, - because char fields when packed actually became 1 byte - longer, when we also stored the string length as the first - byte. */ + table->reclength did not work here? Obviously, because char + fields when packed actually became 1 byte longer, when we also + stored the string length as the first byte. */ - m_upd_buf_size = table->s->stored_rec_length + table->s->max_key_length + m_upd_buf_size = table->s->reclength + table->s->max_key_length + MAX_REF_PARTS * 3; m_upd_buf = reinterpret_cast( @@ -11704,7 +11787,43 @@ create_table_check_doc_id_col( return(false); } -#ifdef MYSQL_VIRTUAL_COLUMNS + +/** Finds all base columns needed to compute a given generated column. +This is returned as a bitmap, in field->table->tmp_set. +Works for both dict_v_col_t and dict_s_col_t columns. +@param[in] table InnoDB table +@param[in] field MySQL field +@param[in,out] col virtual or stored column */ +template +void +prepare_vcol_for_base_setup( +/*========================*/ + const dict_table_t* table, + const Field* field, + T* col) +{ + ut_ad(col->num_base == 0); + ut_ad(col->base_col == NULL); + + MY_BITMAP *old_read_set = field->table->read_set; + MY_BITMAP *old_vcol_set = field->table->vcol_set; + + field->table->read_set = field->table->vcol_set = &field->table->tmp_set; + + bitmap_clear_all(&field->table->tmp_set); + field->vcol_info->expr_item->walk( + &Item::register_field_in_read_map, 1, field->table); + col->num_base= bitmap_bits_set(&field->table->tmp_set); + if (col->num_base != 0) { + col->base_col = static_cast(mem_heap_zalloc( + table->heap, col->num_base * sizeof( + * col->base_col))); + } + field->table->read_set= old_read_set; + field->table->vcol_set= old_vcol_set; +} + + /** Set up base columns for virtual column @param[in] table InnoDB table @param[in] field MySQL field @@ -11717,10 +11836,12 @@ innodb_base_col_setup( { int n = 0; + prepare_vcol_for_base_setup(table, field, v_col); + for (uint i= 0; i < field->table->s->fields; ++i) { const Field* base_field = field->table->field[i]; - if (!base_field->is_virtual_gcol() - && bitmap_is_set(&field->gcol_info->base_columns_map, i)) { + if (base_field->stored_in_db() + && bitmap_is_set(&field->table->tmp_set, i)) { ulint z; for (z = 0; z < table->n_cols; z++) { @@ -11738,10 +11859,9 @@ innodb_base_col_setup( n++; } } + v_col->num_base= n; } -#endif /* MYSQL_VIRTUAL_COLUMNS */ -#ifdef MYSQL_VIRTUAL_COLUMNS /** Set up base columns for stored column @param[in] table InnoDB table @param[in] field MySQL field @@ -11754,12 +11874,14 @@ innodb_base_col_setup_for_stored( { ulint n = 0; + prepare_vcol_for_base_setup(table, field, s_col); + for (uint i= 0; i < field->table->s->fields; ++i) { const Field* base_field = field->table->field[i]; if (!innobase_is_s_fld(base_field) && !innobase_is_v_fld(base_field) - && bitmap_is_set(&field->gcol_info->base_columns_map, + && bitmap_is_set(&field->table->tmp_set, i)) { ulint z; for (z = 0; z < table->n_cols; z++) { @@ -11781,8 +11903,8 @@ innodb_base_col_setup_for_stored( } } } + s_col->num_base= n; } -#endif /** Create a table definition to an InnoDB database. @return ER_* level error */ @@ -11792,7 +11914,6 @@ create_table_info_t::create_table_def() { dict_table_t* table; ulint n_cols; - ulint s_cols; ulint col_type; ulint col_len; ulint nulls_allowed; @@ -11801,6 +11922,7 @@ create_table_info_t::create_table_def() ulint long_true_varchar; ulint charset_no; ulint i; + ulint j = 0; ulint doc_id_col = 0; ibool has_doc_id_col = FALSE; mem_heap_t* heap; @@ -11837,9 +11959,7 @@ create_table_info_t::create_table_def() } n_cols = m_form->s->fields; - s_cols = m_form->s->stored_fields; -#ifdef MYSQL_VIRTUAL_COLUMNS /* Find out any virtual column */ for (i = 0; i < n_cols; i++) { Field* field = m_form->field[i]; @@ -11848,7 +11968,6 @@ create_table_info_t::create_table_def() num_v++; } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ ut_ad(trx_state_eq(m_trx, TRX_STATE_NOT_STARTED)); @@ -11874,8 +11993,7 @@ create_table_info_t::create_table_def() } /* Adjust the number of columns for the FTS hidden field */ - actual_n_cols = m_form->s->stored_fields; - + actual_n_cols = n_cols; if (m_flags2 & DICT_TF2_FTS && !has_doc_id_col) { actual_n_cols += 1; } @@ -11886,7 +12004,7 @@ create_table_info_t::create_table_def() /* Set the hidden doc_id column. */ if (m_flags2 & DICT_TF2_FTS) { table->fts->doc_col = has_doc_id_col - ? doc_id_col : s_cols; + ? doc_id_col : n_cols - num_v; } if (strlen(m_temp_path) != 0) { @@ -11915,12 +12033,9 @@ create_table_info_t::create_table_def() for (i = 0; i < n_cols; i++) { ulint is_virtual; - bool is_stored MY_ATTRIBUTE((unused)); - Field* field = m_form->field[i]; + bool is_stored = false; - if (!field->stored_in_db()) { - continue; - } + Field* field = m_form->field[i]; col_type = get_innobase_type_from_mysql_type( &unsigned_type, field); @@ -12019,7 +12134,6 @@ err_col: charset_no), col_len); } else { -#ifdef MYSQL_VIRTUAL_COLUMNS dict_mem_table_add_v_col(table, heap, field->field_name, col_type, dtype_form_prtype( @@ -12028,26 +12142,18 @@ err_col: | binary_type | long_true_varchar | is_virtual, charset_no), - col_len, i, - 0); + col_len, i, 0); + } - field->gcol_info->non_virtual_base_columns()); -#endif - } - -#ifdef MYSQL_VIRTUAL_COLUMNS if (is_stored) { ut_ad(!is_virtual); /* Added stored column in m_s_cols list. */ dict_mem_table_add_s_col( - table, - field->gcol_info->non_virtual_base_columns()); + table, 0); } -#endif } -#ifdef MYSQL_VIRTUAL_COLUMNS + if (num_v) { - ulint j = 0; for (i = 0; i < n_cols; i++) { dict_v_col_t* v_col; @@ -12088,7 +12194,6 @@ err_col: } } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* Add the FTS doc_id hidden column. */ if (m_flags2 & DICT_TF2_FTS && !has_doc_id_col) { @@ -12121,7 +12226,6 @@ err_col: my_error(ER_TABLESPACE_CANNOT_ENCRYPT, MYF(0)); err = DB_UNSUPPORTED; dict_mem_table_free(table); - */ } else { #endif /* MYSQL_COMPRESSION */ /* Get a new table ID */ @@ -13833,6 +13937,30 @@ create_table_info_t::initialize() } +/** Check if a virtual column is part of a fulltext or spatial index. */ +bool +create_table_info_t::gcols_in_fulltext_or_spatial() +{ + for (ulint i = 0; i < m_form->s->keys; i++) { + const KEY* key = m_form->key_info + i; + if (key->flags & (HA_SPATIAL | HA_FULLTEXT)) { + for (ulint j = 0; j < key->user_defined_key_parts; j++) { + const KEY_PART_INFO* key_part = key->key_part + j; + + /* We do not support special (Fulltext or + Spatial) index on virtual columns */ + if (innobase_is_v_fld(key_part->field)) { + my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN, MYF(0)); + return true; + } + } + } + + } + return false; +} + + /** Prepare to create a new table to an InnoDB database. @param[in] name Table name @return error number */ @@ -13874,6 +14002,10 @@ create_table_info_t::prepare_create_table( DBUG_RETURN(HA_ERR_TABLE_READONLY); } + if (gcols_in_fulltext_or_spatial()) { + DBUG_RETURN(HA_ERR_UNSUPPORTED); + } + DBUG_RETURN(parse_table_name(name)); } @@ -14040,19 +14172,15 @@ create_table_info_t::create_table() " table where referencing columns appear" " as the first columns.\n", m_table_name); break; -#ifdef MYSQL_VIRTUAL_COLUMNS - case DB_NO_FK_ON_V_BASE_COL: + case DB_NO_FK_ON_S_BASE_COL: push_warning_printf( m_thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_CANNOT_ADD_FOREIGN, "Create table '%s' with foreign key constraint" " failed. Cannot add foreign key constraint" - " placed on the base column of indexed" - " virtual column, or constraint placed" - " on columns being part of virtual index.\n", + " placed on the base column of stored" + " column. \n", m_table_name); - break; -#endif default: break; } @@ -14647,8 +14775,7 @@ validate_create_tablespace_info( THD* thd, st_alter_tablespace* alter_info) { - - int error = 0; + ulint space_id; /* The parser ensures that these fields are provided. */ ut_a(alter_info->tablespace_name); @@ -15427,6 +15554,7 @@ ha_innobase::records( DBUG_RETURN(HA_ERR_QUERY_INTERRUPTED); } + *num_rows= n_rows; DBUG_RETURN(0); } #endif /* MYSQL_57_SELECT_COUNT_OPTIMIZATION */ @@ -23203,6 +23331,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { #endif MYSQL_SYSVAR(instrument_semaphores), MYSQL_SYSVAR(buf_dump_status_frequency), + MYSQL_SYSVAR(background_thread), NULL }; @@ -23377,29 +23506,29 @@ innobase_index_cond( return handler_index_cond_check(file); } -#ifdef MYSQL_VIRTUAL_COLUMNS -/** Get the computed value by supplying the base column values. -@param[in,out] table the table whose virtual column template to be built */ -void -innobase_init_vc_templ( + +/** Find or open a mysql table for the virtual column template +@param[in] thd mysql thread handle +@param[in,out] table InnoDB table whose virtual column template is to be updated +@return TABLE if successful or NULL */ +static TABLE * +innobase_find_mysql_table_for_vc( +/*=============================*/ + THD* thd, dict_table_t* table) { - char dbname[MAX_DATABASE_NAME_LEN + 1]; - char tbname[MAX_TABLE_NAME_LEN + 1]; - char* name = table->name.m_name; - ulint dbnamelen = dict_get_db_name_len(name); - ulint tbnamelen = strlen(name) - dbnamelen - 1; - char t_dbname[MAX_DATABASE_NAME_LEN + 1]; - char t_tbname[MAX_TABLE_NAME_LEN + 1]; - - mutex_enter(&dict_sys->mutex); - - if (table->vc_templ != NULL) { - mutex_exit(&dict_sys->mutex); - - return; + if (table->vc_templ->mysql_table_query_id == thd_get_query_id(thd)) { + return table->vc_templ->mysql_table; } + char dbname[MAX_DATABASE_NAME_LEN + 1]; + char tbname[MAX_TABLE_NAME_LEN + 1]; + char* name = table->name.m_name; + uint dbnamelen = dict_get_db_name_len(name); + uint tbnamelen = strlen(name) - dbnamelen - 1; + char t_dbname[MAX_DATABASE_NAME_LEN + 1]; + char t_tbname[MAX_TABLE_NAME_LEN + 1]; + strncpy(dbname, name, dbnamelen); dbname[dbnamelen] = 0; strncpy(tbname, name + dbnamelen + 1, tbnamelen); @@ -23407,32 +23536,53 @@ innobase_init_vc_templ( /* For partition table, remove the partition name and use the "main" table name to build the template */ - char* is_part = is_partition(tbname); + char* is_part = is_partition(tbname); if (is_part != NULL) { *is_part = '\0'; tbnamelen = is_part - tbname; } - table->vc_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); - table->vc_templ->vtempl = NULL; - dbnamelen = filename_to_tablename(dbname, t_dbname, MAX_DATABASE_NAME_LEN + 1); tbnamelen = filename_to_tablename(tbname, t_tbname, MAX_TABLE_NAME_LEN + 1); -#ifdef UNIV_DEBUG - // bool ret = -#endif /* UNIV_DEBUG */ + TABLE *mysql_table = find_fk_open_table(thd, t_dbname, dbnamelen, + t_tbname, tbnamelen); - /* JAN: TODO: MySQL: 5.7 virtual columsn - handler::my_prepare_gcolumn_template( - thd, t_dbname, t_tbname, - &innobase_build_v_templ_callback, - static_cast(table)); - ut_ad(!ret); - */ + if (!mysql_table && THDVAR(thd, background_thread)) { + /* only open the table in background purge threads */ + mysql_table = open_purge_table(thd, t_dbname, dbnamelen, + t_tbname, tbnamelen); + } + + table->vc_templ->mysql_table = mysql_table; + table->vc_templ->mysql_table_query_id = thd_get_query_id(thd); + return mysql_table; +} + +/** Get the computed value by supplying the base column values. +@param[in,out] table table whose virtual column template to be built */ +void +innobase_init_vc_templ( + dict_table_t* table) +{ + if (table->vc_templ != NULL) { + return; + } + + table->vc_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); + + TABLE *mysql_table= innobase_find_mysql_table_for_vc(current_thd, table); + + ut_ad(mysql_table); + if (!mysql_table) { + return; + } + + mutex_enter(&dict_sys->mutex); + innobase_build_v_templ(mysql_table, table, table->vc_templ, NULL, true); mutex_exit(&dict_sys->mutex); } @@ -23542,7 +23692,6 @@ innobase_get_computed_value( upd_t* parent_update, dict_foreign_t* foreign) { - byte rec_buf1[REC_VERSION_56_MAX_INDEX_COL_LEN]; byte rec_buf2[REC_VERSION_56_MAX_INDEX_COL_LEN]; byte* mysql_rec; byte* buf; @@ -23568,15 +23717,20 @@ innobase_get_computed_value( *local_heap = mem_heap_create(UNIV_PAGE_SIZE); } - mysql_rec = static_cast(mem_heap_alloc( - *local_heap, index->table->vc_templ->rec_len)); buf = static_cast(mem_heap_alloc( *local_heap, index->table->vc_templ->rec_len)); } else { - mysql_rec = rec_buf1; buf = rec_buf2; } + if (!mysql_table) { + mysql_table = innobase_find_mysql_table_for_vc(thd, index->table); + } + + ut_ad(mysql_table); + + mysql_rec = mysql_table->record[0]; + for (ulint i = 0; i < col->num_base; i++) { dict_col_t* base_col = col->base_col[i]; const dfield_t* row_field = NULL; @@ -23635,46 +23789,11 @@ innobase_get_computed_value( field = dtuple_get_nth_v_field(row, col->v_pos); - /* Bitmap for specifying which virtual columns the server - should evaluate */ - MY_BITMAP column_map; - my_bitmap_map col_map_storage[bitmap_buffer_size(REC_MAX_N_FIELDS)]; - - bitmap_init(&column_map, col_map_storage, REC_MAX_N_FIELDS, false); - - /* Specify the column the server should evaluate */ - bitmap_set_bit(&column_map, col->m_col.ind); - - if (mysql_table == NULL) { - if (vctempl->type == DATA_BLOB) { - ulint max_len; - - if (vctempl->mysql_col_len - 8 == 1) { - /* This is for TINYBLOB only, which needs - only 1 byte, other BLOBs won't be affected */ - max_len = 255; - } else { - max_len = DICT_MAX_FIELD_LEN_BY_FORMAT( - index->table) + 1; - } - - byte* blob_mem = static_cast( - mem_heap_alloc(heap, max_len)); - - row_mysql_store_blob_ref( - mysql_rec + vctempl->mysql_col_offset, - vctempl->mysql_col_len, blob_mem, max_len); - } - - ret = handler::my_eval_gcolumn_expr_with_open( - thd, index->table->vc_templ->db_name.c_str(), - index->table->vc_templ->tb_name.c_str(), &column_map, - (uchar *)mysql_rec); - } else { - ret = handler::my_eval_gcolumn_expr( - thd, mysql_table, &column_map, - (uchar *)mysql_rec); - } + my_bitmap_map* old_write_set = dbug_tmp_use_all_columns(mysql_table, mysql_table->write_set); + my_bitmap_map* old_read_set = dbug_tmp_use_all_columns(mysql_table, mysql_table->read_set); + ret = mysql_table->update_virtual_field(mysql_table->field[col->m_col.ind]); + dbug_tmp_restore_column_map(mysql_table->read_set, old_read_set); + dbug_tmp_restore_column_map(mysql_table->write_set, old_write_set); if (ret != 0) { #ifdef INNODB_VIRTUAL_DEBUG @@ -23725,7 +23844,7 @@ innobase_get_computed_value( return(field); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ + /** Attempt to push down an index condition. @param[in] keyno MySQL key number diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index a78925d94e1..99d50d82fd1 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -119,6 +119,8 @@ public: const key_map* keys_to_use_for_scanning(); + void column_bitmaps_signal(); + /** Opens dictionary table object using table name. For partition, we need to try alternative lower/upper case names to support moving data files across platforms. @@ -781,6 +783,8 @@ public: @return NULL if valid, string name of bad option if not. */ const char* create_options_are_invalid(); + bool gcols_in_fulltext_or_spatial(); + /** Validates engine specific table options not handled by SQL-parser. @return NULL if valid, string name of bad option if not. */ @@ -1037,13 +1041,9 @@ innodb_base_col_setup_for_stored( dict_s_col_t* s_col); /** whether this is a stored column */ -// JAN: TODO: MySQL 5.7 virtual fields -//#define innobase_is_s_fld(field) ((field)->gcol_info && (field)->stored_in_db) -#define innobase_is_s_fld(field) (field == NULL) -// JAN: TODO: MySQL 5.7 virtual fields +#define innobase_is_s_fld(field) ((field)->vcol_info && (field)->stored_in_db()) /** whether this is a computed virtual column */ -//#define innobase_is_v_fld(field) ((field)->gcol_info && !(field)->stored_in_db) -#define innobase_is_v_fld(field) (field == NULL) +#define innobase_is_v_fld(field) ((field)->vcol_info && !(field)->stored_in_db()) /** Release temporary latches. Call this function when mysqld passes control to the client. That is to @@ -1120,16 +1120,14 @@ innodb_rec_per_key( @param[in,out] s_templ InnoDB template structure @param[in] add_v new virtual columns added along with add index call -@param[in] locked true if innobase_share_mutex is held -@param[in] share_tbl_name original MySQL table name */ +@param[in] locked true if innobase_share_mutex is held */ void innobase_build_v_templ( const TABLE* table, const dict_table_t* ib_table, dict_vcol_templ_t* s_templ, const dict_add_v_col_t* add_v, - bool locked, - const char* share_tbl_name); + bool locked); /** callback used by MySQL server layer to initialized the table virtual columns' template diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 3da543d246e..51aef715ee2 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -59,6 +59,10 @@ Smart ALTER TABLE #include // PROCESS_ACL #endif +static const char *MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN= + "INPLACE ADD or DROP of virtual columns cannot be " + "combined with other ALTER TABLE actions"; + /* For supporting Native InnoDB Partitioning. */ /* JAN: TODO: MySQL 5.7 #include "partition_info.h" @@ -67,7 +71,8 @@ Smart ALTER TABLE /** Operations for creating secondary indexes (no rebuild needed) */ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ONLINE_CREATE = Alter_inplace_info::ADD_INDEX - | Alter_inplace_info::ADD_UNIQUE_INDEX; + | Alter_inplace_info::ADD_UNIQUE_INDEX + | Alter_inplace_info::ADD_SPATIAL_INDEX; /** Operations for rebuilding a table in place */ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD @@ -77,17 +82,12 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD /* CHANGE_CREATE_OPTION needs to check innobase_need_rebuild() */ | Alter_inplace_info::ALTER_COLUMN_NULLABLE | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE - | Alter_inplace_info::ALTER_COLUMN_ORDER - | Alter_inplace_info::DROP_COLUMN - | Alter_inplace_info::ADD_COLUMN -#ifdef MYSQL_VIRTUAL_COLUMNS | Alter_inplace_info::ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::DROP_STORED_COLUMN | Alter_inplace_info::ADD_STORED_BASE_COLUMN - | Alter_inplace_info::ALTER_STORED_COLUMN_TYPE -#endif | Alter_inplace_info::RECREATE_TABLE /* + | Alter_inplace_info::ALTER_STORED_COLUMN_TYPE */ ; @@ -101,9 +101,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE | Alter_inplace_info::ALTER_PARTITIONED | Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT | Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE -#ifdef MYSQL_VIRTUAL_COLUMNS | Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR -#endif | Alter_inplace_info::ALTER_RENAME; /** Operations on foreign key definitions (changing the schema only) */ @@ -121,15 +119,12 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_NOREBUILD | Alter_inplace_info::RENAME_INDEX #endif | Alter_inplace_info::ALTER_COLUMN_NAME - | Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH; -#ifdef MYSQL_VIRTUAL_COLUMNS - | Alter_inplace_info::ALTER_INDEX_COMMENT + | Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH + //| Alter_inplace_info::ALTER_INDEX_COMMENT | Alter_inplace_info::ADD_VIRTUAL_COLUMN | Alter_inplace_info::DROP_VIRTUAL_COLUMN - | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER - | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE -#endif - ; + | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER; + struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx { /** Dummy query graph */ @@ -453,7 +448,6 @@ innobase_need_rebuild( return(!!(ha_alter_info->handler_flags & INNOBASE_ALTER_REBUILD)); } -#ifdef MYSQL_VIRTUAL_COLUMNS /** Check if virtual column in old and new table are in order, excluding those dropped column. This is needed because when we drop a virtual column, ALTER_VIRTUAL_COLUMN_ORDER is also turned on, so we can't decide if this @@ -484,7 +478,7 @@ check_v_col_in_order( cf_it.rewind(); while (const Create_field* new_field = cf_it++) { - if (!new_field->is_virtual_gcol()) { + if (!innobase_is_v_fld(new_field)) { continue; } @@ -510,11 +504,9 @@ check_v_col_in_order( } for (ulint i = 0; i < table->s->fields; i++) { - Field* field = table->s->field[i]; - bool dropped = false; - Alter_drop* drop; + Field* field = table->field[i]; - if (field->stored_in_db) { + if (field->stored_in_db()) { continue; } @@ -529,7 +521,7 @@ check_v_col_in_order( while (j < altered_table->s->fields) { Field* new_field = altered_table->s->field[j]; - if (new_field->stored_in_db) { + if (new_field->stored_in_db()) { j++; continue; } @@ -555,7 +547,6 @@ check_v_col_in_order( return(true); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /** Check if InnoDB supports a particular alter table in-place @param altered_table TABLE object for new version of table. @@ -590,7 +581,7 @@ ha_innobase::check_if_supported_inplace_alter( DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } - if (altered_table->s->stored_fields > REC_MAX_N_USER_FIELDS) { + if (altered_table->s->fields > REC_MAX_N_USER_FIELDS) { /* Deny the inplace ALTER TABLE. MySQL will try to re-create the table and ha_innobase::create() will return an error too. This is how we effectively @@ -646,14 +637,11 @@ ha_innobase::check_if_supported_inplace_alter( | INNOBASE_ALTER_NOREBUILD | INNOBASE_ALTER_REBUILD)) { -#ifdef MYSQL_VIRTUAL_COLUMNS if (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_STORED_COLUMN_TYPE) { ha_alter_info->unsupported_reason = innobase_get_err_msg( ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE); } -#endif - DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } @@ -794,8 +782,8 @@ ha_innobase::check_if_supported_inplace_alter( DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } -#ifdef MYSQL_VIRTUAL_COLUMNS - // JAN: TODO: MySQL 5.7 Virtual columns + bool add_drop_v_cols = false; + /* If there is add or drop virtual columns, we will support operations with these 2 options alone with inplace interface for now */ @@ -812,8 +800,8 @@ ha_innobase::check_if_supported_inplace_alter( | Alter_inplace_info::DROP_VIRTUAL_COLUMN | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER | Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR + | Alter_inplace_info::ALTER_COLUMN_VCOL /* - | Alter_inplace_info::ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::ADD_STORED_BASE_COLUMN | Alter_inplace_info::DROP_STORED_COLUMN | Alter_inplace_info::ALTER_STORED_COLUMN_ORDER @@ -828,14 +816,12 @@ ha_innobase::check_if_supported_inplace_alter( || (!check_v_col_in_order( this->table, altered_table, ha_alter_info))) { ha_alter_info->unsupported_reason = - innobase_get_err_msg( - ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN); + MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN; DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } add_drop_v_cols = true; } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* We should be able to do the operation in-place. See if we can do it online (LOCK=NONE). */ @@ -850,18 +836,15 @@ ha_innobase::check_if_supported_inplace_alter( + ha_alter_info->key_count; new_key++) { -#ifdef MYSQL_VIRTUAL_COLUMNS /* Do not support adding/droping a virtual column, while there is a table rebuild caused by adding a new FTS_DOC_ID */ if ((new_key->flags & HA_FULLTEXT) && add_drop_v_cols && !DICT_TF2_FLAG_IS_SET(m_prebuilt->table, DICT_TF2_FTS_HAS_DOC_ID)) { ha_alter_info->unsupported_reason = - innobase_get_err_msg( - ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN); + MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN; DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ for (KEY_PART_INFO* key_part = new_key->key_part; key_part < new_key->key_part + new_key->user_defined_key_parts; @@ -928,31 +911,27 @@ ha_innobase::check_if_supported_inplace_alter( online = false; } -#ifdef MYSQL_VIRTUAL_COLUMNS - if (key_part->field->is_virtual_gcol()) { + if (innobase_is_v_fld(key_part->field)) { /* Do not support adding index on newly added virtual column, while there is also a drop virtual column in the same clause */ if (ha_alter_info->handler_flags & Alter_inplace_info::DROP_VIRTUAL_COLUMN) { ha_alter_info->unsupported_reason = - innobase_get_err_msg( - ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN); + MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN; DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } ha_alter_info->unsupported_reason = - innobase_get_err_msg( - ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN); + MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN; online = false; } -#endif /* MYSQL_VIRTUAL_COLUMNS */ } } DBUG_ASSERT(!m_prebuilt->table->fts || m_prebuilt->table->fts->doc_col - <= table->s->stored_fields); + <= table->s->fields); DBUG_ASSERT(!m_prebuilt->table->fts || m_prebuilt->table->fts->doc_col < dict_table_get_n_user_cols(m_prebuilt->table)); @@ -1356,8 +1335,6 @@ next_rec: return(NULL); } -#ifdef MYSQL_VIRTUAL_COLUMNS - /** Check whether given column is a base of stored column. @param[in] col_name column name @param[in] table table @@ -1419,7 +1396,6 @@ innobase_check_fk_stored( return(false); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /** Create InnoDB foreign key structure from MySQL alter_info @param[in] ha_alter_info alter table info @@ -1667,13 +1643,14 @@ innobase_get_foreign_key_info( goto err_exit; } -#ifdef MYSQL_VIRTUAL_COLUMNS if (innobase_check_fk_stored( add_fk[num_fk], table, s_cols)) { - my_error(ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED, MYF(0)); + my_printf_error( + HA_ERR_UNSUPPORTED, + "Cannot add foreign key on the base column " + "of stored column", MYF(0)); goto err_exit; } -#endif num_fk++; } @@ -1794,24 +1771,19 @@ innobase_rec_to_mysql( const ulint* offsets)/*!< in: rec_get_offsets( rec, index, ...) */ { - uint n_fields = table->s->stored_fields; - uint sql_idx = 0; + uint n_fields = table->s->fields; ut_ad(n_fields == dict_table_get_n_user_cols(index->table) - !!(DICT_TF2_FLAG_IS_SET(index->table, DICT_TF2_FTS_HAS_DOC_ID))); - for (uint i = 0; i < n_fields; i++, sql_idx++) { - Field* field; + for (uint i = 0; i < n_fields; i++) { + Field* field = table->field[i]; ulint ipos; ulint ilen; const uchar* ifield; ulint prefix_col; - while (!((field= table->field[sql_idx])->stored_in_db())) { - sql_idx++; - } - field->reset(); ipos = dict_index_get_nth_col_or_prefix_pos( @@ -1852,8 +1824,7 @@ innobase_fields_to_mysql( const dict_index_t* index, /*!< in: InnoDB index */ const dfield_t* fields) /*!< in: InnoDB index fields */ { - uint n_fields = table->s->stored_fields; - uint sql_idx = 0; + uint n_fields = table->s->fields; ulint num_v = 0; ut_ad(n_fields == dict_table_get_n_user_cols(index->table) @@ -1861,16 +1832,12 @@ innobase_fields_to_mysql( - !!(DICT_TF2_FLAG_IS_SET(index->table, DICT_TF2_FTS_HAS_DOC_ID))); - for (uint i = 0; i < n_fields; i++, sql_idx++) { - Field* field; + for (uint i = 0; i < n_fields; i++) { + Field* field = table->field[i]; ulint ipos; ulint col_n; ulint prefix_col; - while (!((field= table->field[sql_idx])->stored_in_db())) { - sql_idx++; - } - field->reset(); if (innobase_is_v_fld(field)) { @@ -1914,9 +1881,8 @@ innobase_row_to_mysql( const dict_table_t* itab, /*!< in: InnoDB table */ const dtuple_t* row) /*!< in: InnoDB row */ { - uint n_fields = table->s->stored_fields; - uint sql_idx = 0; - uint num_v = 0; + uint n_fields = table->s->fields; + ulint num_v = 0; /* The InnoDB row may contain an extra FTS_DOC_ID column at the end. */ ut_ad(row->n_fields == dict_table_get_n_cols(itab)); @@ -1924,12 +1890,8 @@ innobase_row_to_mysql( + dict_table_get_n_v_cols(itab) - !!(DICT_TF2_FLAG_IS_SET(itab, DICT_TF2_FTS_HAS_DOC_ID))); - for (uint i = 0; i < n_fields; i++, sql_idx++) { - Field* field; - - while (!((field= table->field[sql_idx])->stored_in_db())) { - sql_idx++; - } + for (uint i = 0; i < n_fields; i++) { + Field* field = table->field[i]; field->reset(); @@ -1953,6 +1915,11 @@ innobase_row_to_mysql( dfield_get_len(df), field); } } + if (table->vfield) { + my_bitmap_map* old_vcol_set = tmp_use_all_columns(table, table->vcol_set); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); + tmp_restore_column_map(table->vcol_set, old_vcol_set); + } } /*************************************************************//** @@ -2129,22 +2096,19 @@ name_ok: is not being created @param[in] key_part MySQL key definition @param[in,out] index_field index field -@param[in] new_clustered new cluster -@param[in] fields MySQL table fields*/ +@param[in] new_clustered new cluster */ static void innobase_create_index_field_def( const TABLE* altered_table, const KEY_PART_INFO* key_part, index_field_t* index_field, - bool new_clustered, - const Field** fields) + bool new_clustered) { const Field* field; ibool is_unsigned; ulint col_type; ulint num_v = 0; - ulint num_m_v = 0; DBUG_ENTER("innobase_create_index_field_def"); @@ -2157,33 +2121,21 @@ innobase_create_index_field_def( ut_a(field); for (ulint i = 0; i < key_part->fieldnr; i++) { - const Field* ifield = altered_table->field[i]; - if (innobase_is_v_fld(ifield)) { + if (innobase_is_v_fld(altered_table->field[i])) { num_v++; } - - if (!ifield->stored_in_db()) { - num_m_v++; - } } col_type = get_innobase_type_from_mysql_type( &is_unsigned, field); -#ifdef MYSQL_VIRTUAL_COLUMNS - if (!field->stored_in_db && field->gcol_info) { - if (!field->stored_in_db && false) { - index_field->is_v_col = true; - index_field->col_no = num_v; - } else { - index_field->is_v_col = false; - index_field->col_no = key_part->fieldnr - num_v; - } + if (innobase_is_v_fld(field)) { + index_field->is_v_col = true; + index_field->col_no = num_v; + } else { + index_field->is_v_col = false; + index_field->col_no = key_part->fieldnr - num_v; } -#else - index_field->is_v_col = false; - index_field->col_no = key_part->fieldnr - num_m_v; -#endif /* MYSQL_VIRTUAL_COLUMNS */ if (DATA_LARGE_MTYPE(col_type) || (key_part->length < field->pack_length() @@ -2218,8 +2170,7 @@ innobase_create_index_def( bool new_clustered, bool key_clustered, index_def_t* index, - mem_heap_t* heap, - const Field** fields) + mem_heap_t* heap) { const KEY* key = &keys[key_number]; ulint i; @@ -2298,21 +2249,16 @@ innobase_create_index_def( index->fields[0].prefix_len = 0; index->fields[0].is_v_col = false; - #ifdef MYSQL_VIRTUAL_COLUMNS - if (!key->key_part[0].field->stored_in_db - && key->key_part[0].field->gcol_info) { + if (innobase_is_v_fld(key->key_part[0].field)) { /* Currently, the spatial index cannot be created on virtual columns. It is blocked in server layer */ - ut_ad(0); index->fields[0].is_v_col = true; } else { - index->fields[0].is_v_col = false; } -#endif /* MYSQL_VIRTUAL_COLUMNS */ } else { index->ind_type = (key->flags & HA_NOSAME) ? DICT_UNIQUE : 0; } @@ -2321,7 +2267,7 @@ innobase_create_index_def( for (i = 0; i < n_fields; i++) { innobase_create_index_field_def( altered_table, &key->key_part[i], - &index->fields[i], new_clustered, fields); + &index->fields[i], new_clustered); if (index->fields[i].is_v_col) { index->ind_type |= DICT_VIRTUAL; @@ -2352,18 +2298,13 @@ innobase_fts_check_doc_id_col( { *fts_doc_col_no = ULINT_UNDEFINED; - const uint n_cols = altered_table->s->stored_fields; - uint sql_idx = 0; + const uint n_cols = altered_table->s->fields; ulint i; *num_v = 0; - for (i = 0; i < n_cols; i++, sql_idx++) { - const Field* field; - - while (!((field= altered_table->field[sql_idx])->stored_in_db())) { - sql_idx++; - } + for (i = 0; i < n_cols; i++) { + const Field* field = altered_table->field[i]; if (innobase_is_v_fld(field)) { (*num_v)++; @@ -2676,7 +2617,7 @@ innobase_create_key_defs( /* Create the PRIMARY key index definition */ innobase_create_index_def( altered_table, key_info, primary_key_number, - TRUE, TRUE, indexdef++, heap, (const Field **)altered_table->field); + true, true, indexdef++, heap); created_clustered: n_add = 1; @@ -2688,7 +2629,7 @@ created_clustered: /* Copy the index definitions. */ innobase_create_index_def( altered_table, key_info, i, true, - false, indexdef, heap, (const Field **)altered_table->field); + false, indexdef, heap); if (indexdef->ind_type & DICT_FTS) { n_fts_add++; @@ -2705,8 +2646,7 @@ created_clustered: && !innobase_fts_check_doc_id_col( NULL, altered_table, &fts_doc_id_col, &num_v)) { - fts_doc_id_col = - altered_table->s->stored_fields; + fts_doc_id_col = altered_table->s->fields - num_v; add_fts_doc_id = true; } @@ -2735,7 +2675,7 @@ created_clustered: for (ulint i = 0; i < n_add; i++) { innobase_create_index_def( altered_table, key_info, add[i], - false, false, indexdef, heap, (const Field **)altered_table->field); + false, false, indexdef, heap); if (indexdef->ind_type & DICT_FTS) { n_fts_add++; @@ -3136,16 +3076,15 @@ innobase_build_col_map( dtuple_t* add_cols, mem_heap_t* heap) { - uint old_i, old_innobase_i; DBUG_ENTER("innobase_build_col_map"); DBUG_ASSERT(altered_table != table); DBUG_ASSERT(new_table != old_table); DBUG_ASSERT(dict_table_get_n_cols(new_table) + dict_table_get_n_v_cols(new_table) - >= altered_table->s->stored_fields + DATA_N_SYS_COLS); + >= altered_table->s->fields + DATA_N_SYS_COLS); DBUG_ASSERT(dict_table_get_n_cols(old_table) + dict_table_get_n_v_cols(old_table) - >= table->s->stored_fields + DATA_N_SYS_COLS); + >= table->s->fields + DATA_N_SYS_COLS); DBUG_ASSERT(!!add_cols == !!(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN)); DBUG_ASSERT(!add_cols || dtuple_get_n_fields(add_cols) @@ -3158,14 +3097,13 @@ innobase_build_col_map( List_iterator_fast cf_it( ha_alter_info->alter_info->create_list); - uint i = 0, sql_idx = 0; + uint i = 0; uint num_v = 0; /* Any dropped columns will map to ULINT_UNDEFINED. */ - for (old_innobase_i = 0; - old_innobase_i + DATA_N_SYS_COLS < old_table->n_cols; - old_innobase_i++) { - col_map[old_innobase_i] = ULINT_UNDEFINED; + for (uint old_i = 0; old_i + DATA_N_SYS_COLS < old_table->n_cols; + old_i++) { + col_map[old_i] = ULINT_UNDEFINED; } for (uint old_i = 0; old_i < old_table->n_v_cols; old_i++) { @@ -3181,21 +3119,8 @@ innobase_build_col_map( ulint num_old_v = 0; - if (!new_field->stored_in_db()) - { - sql_idx++; - continue; - } - - for (old_i = 0, old_innobase_i= 0; - table->field[old_i]; - old_i++) { + for (uint old_i = 0; table->field[old_i]; old_i++) { const Field* field = table->field[old_i]; - - if (!table->field[old_i]->stored_in_db()) { - continue; - } - if (innobase_is_v_fld(field)) { if (is_v && new_field->field == field) { col_map[old_table->n_cols + num_v] @@ -3208,30 +3133,27 @@ innobase_build_col_map( } if (new_field->field == field) { - col_map[old_innobase_i] = i; + col_map[old_i - num_old_v] = i; goto found_col; } - old_innobase_i++; } ut_ad(!is_v); innobase_build_col_map_add( heap, dtuple_get_nth_field(add_cols, i), - altered_table->field[sql_idx], + altered_table->field[i + num_v], dict_table_is_comp(new_table)); found_col: if (is_v) { num_v++; } else { i++; - sql_idx++; } } - DBUG_ASSERT(i == altered_table->s->stored_fields - num_v); + DBUG_ASSERT(i == altered_table->s->fields - num_v); - i = table->s->stored_fields; - //i = table->s->fields - old_table->n_v_cols; + i = table->s->fields - old_table->n_v_cols; /* Add the InnoDB hidden FTS_DOC_ID column, if any. */ if (i + DATA_N_SYS_COLS < old_table->n_cols) { @@ -3241,21 +3163,21 @@ found_col: DICT_TF2_FTS_HAS_DOC_ID)); DBUG_ASSERT(i + DATA_N_SYS_COLS + 1 == old_table->n_cols); DBUG_ASSERT(!strcmp(dict_table_get_col_name( - old_table, table->s->stored_fields), + old_table, i), FTS_DOC_ID_COL_NAME)); - if (altered_table->s->stored_fields + DATA_N_SYS_COLS + if (altered_table->s->fields + DATA_N_SYS_COLS - new_table->n_v_cols < new_table->n_cols) { DBUG_ASSERT(DICT_TF2_FLAG_IS_SET( new_table, DICT_TF2_FTS_HAS_DOC_ID)); - DBUG_ASSERT(altered_table->s->stored_fields + DBUG_ASSERT(altered_table->s->fields + DATA_N_SYS_COLS + 1 - == new_table->n_cols); - col_map[i] = altered_table->s->stored_fields; - /* col_map[i] = altered_table->s->fields + == static_cast( + new_table->n_cols + + new_table->n_v_cols)); + col_map[i] = altered_table->s->fields - new_table->n_v_cols; - */ } else { DBUG_ASSERT(!DICT_TF2_FLAG_IS_SET( new_table, @@ -3671,8 +3593,6 @@ innobase_check_gis_columns( DBUG_RETURN(DB_SUCCESS); } -#ifdef MYSQL_VIRTUAL_COLUMNS - /** Collect virtual column info for its addition @param[in] ha_alter_info Data used during in-place alter @param[in] altered_table MySQL table that is being altered to @@ -3738,10 +3658,8 @@ prepare_inplace_add_virtual( &is_unsigned, field); - if (!field->gcol_info || field->stored_in_db) { - my_error(ER_WRONG_KEY_COLUMN, MYF(0), - field->field_name); - return(true); + if (!innobase_is_v_fld(field)) { + continue; } col_len = field->pack_length(); @@ -3798,13 +3716,9 @@ prepare_inplace_add_virtual( ctx->add_vcol[j].m_col.len = col_len; ctx->add_vcol[j].m_col.ind = i - 1; - /* ctx->add_vcol[j].num_base = - field->gcol_info->non_virtual_base_columns(); - */ + ctx->add_vcol[j].num_base = 0; ctx->add_vcol_name[j] = field->field_name; - ctx->add_vcol[j].base_col = static_cast( - mem_heap_alloc(ctx->heap, ctx->add_vcol[j].num_base - * sizeof *(ctx->add_vcol[j].base_col))); + ctx->add_vcol[j].base_col = NULL; ctx->add_vcol[j].v_pos = ctx->old_table->n_v_cols - ctx->num_to_drop_vcol + j; @@ -3833,12 +3747,17 @@ prepare_inplace_drop_virtual( ha_innobase_inplace_ctx* ctx; ulint i = 0; ulint j = 0; - Alter_drop *drop; ctx = static_cast (ha_alter_info->handler_ctx); - ctx->num_to_drop_vcol = ha_alter_info->alter_info->drop_list.elements; + ctx->num_to_drop_vcol = 0; + for (i = 0; table->field[i]; i++) { + const Field* field = table->field[i]; + if (field->flags & FIELD_IS_DROPPED && !field->stored_in_db()) { + ctx->num_to_drop_vcol++; + } + } ctx->drop_vcol = static_cast( mem_heap_alloc(ctx->heap, ctx->num_to_drop_vcol @@ -3847,26 +3766,9 @@ prepare_inplace_drop_virtual( mem_heap_alloc(ctx->heap, ctx->num_to_drop_vcol * sizeof *ctx->drop_vcol_name)); - List_iterator_fast cf_it( - ha_alter_info->alter_info->drop_list); - - while ((drop = (cf_it++)) != NULL) { - const Field* field; - ulint old_i; - - ut_ad(drop->type == Alter_drop::COLUMN); - - for (old_i = 0; table->field[old_i]; old_i++) { - const Field* n_field = table->field[old_i]; - if (!my_strcasecmp(system_charset_info, - n_field->field_name, drop->name)) { - break; - } - } - - i++; - - if (!table->field[old_i]) { + for (i = 0; table->field[i]; i++) { + Field *field = table->field[i]; + if (!(field->flags & FIELD_IS_DROPPED) || field->stored_in_db()) { continue; } @@ -3875,19 +3777,10 @@ prepare_inplace_drop_virtual( ulint field_type; ulint charset_no; - field = table->field[old_i]; - ulint col_type = get_innobase_type_from_mysql_type( &is_unsigned, field); - - if (!field->gcol_info || field->stored_in_db) { - my_error(ER_WRONG_KEY_COLUMN, MYF(0), - field->field_name); - return(true); - } - col_len = field->pack_length(); field_type = (ulint) field->type(); @@ -3941,12 +3834,12 @@ prepare_inplace_drop_virtual( ctx->drop_vcol[j].m_col.len = col_len; - ctx->drop_vcol[j].m_col.ind = old_i; + ctx->drop_vcol[j].m_col.ind = i; ctx->drop_vcol_name[j] = field->field_name; dict_v_col_t* v_col = dict_table_get_nth_v_col_mysql( - ctx->old_table, old_i); + ctx->old_table, i); ctx->drop_vcol[j].v_pos = v_col->v_pos; j++; } @@ -4404,7 +4297,7 @@ innodb_v_adjust_idx_col( /* Found the field in the new table */ while (const Create_field* new_field = cf_it++) { - if (!new_field->is_virtual_gcol()) { + if (!innobase_is_v_fld(new_field)) { continue; } @@ -4424,7 +4317,7 @@ innodb_v_adjust_idx_col( ut_a(0); } - ut_ad(field->is_virtual_gcol()); + ut_ad(innobase_is_v_fld(field)); num_v = 0; @@ -4438,7 +4331,7 @@ innodb_v_adjust_idx_col( break; } - if (old_table->field[old_i]->is_virtual_gcol()) { + if (innobase_is_v_fld(old_table->field[old_i])) { num_v++; } } @@ -4446,7 +4339,6 @@ innodb_v_adjust_idx_col( ut_ad(col_found); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /** Update internal structures with concurrent writes blocked, while preparing ALTER TABLE. @@ -4511,7 +4403,6 @@ prepare_inplace_alter_table_dict( trx_start_if_not_started_xa(ctx->prebuilt->trx, true); -#ifdef MYSQL_VIRTUAL_COLUMNS if (ha_alter_info->handler_flags & Alter_inplace_info::DROP_VIRTUAL_COLUMN) { if (prepare_inplace_drop_virtual( @@ -4543,7 +4434,6 @@ prepare_inplace_alter_table_dict( /* There should be no order change for virtual columns coming in here */ ut_ad(check_v_col_in_order(old_table, altered_table, ha_alter_info)); -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* Create a background transaction for the operations on the data dictionary tables. */ @@ -4658,9 +4548,9 @@ prepare_inplace_alter_table_dict( ctx->new_table->id); ulint n_cols = 0; ulint n_v_cols = 0; - ulint n_mv_cols = 0; dtuple_t* add_cols; ulint space_id = 0; + ulint z = 0; ulint key_id = FIL_DEFAULT_ENCRYPTION_KEY; fil_encryption_t mode = FIL_SPACE_ENCRYPTION_DEFAULT; const char* compression=NULL; @@ -4684,15 +4574,11 @@ prepare_inplace_alter_table_dict( if (innobase_is_v_fld(field)) { n_v_cols++; } else { - if (field->stored_in_db()) { n_cols++; - } else { - n_mv_cols++; - } } } - ut_ad(n_cols + n_v_cols + n_mv_cols == altered_table->s->fields); + ut_ad(n_cols + n_v_cols == altered_table->s->fields); if (add_fts_doc_id) { n_cols++; @@ -4744,21 +4630,17 @@ prepare_inplace_alter_table_dict( user_table->data_dir_path); } - for (uint i = 0, sql_idx=0; i < altered_table->s->stored_fields; i++, sql_idx++) { - Field* field; + for (uint i = 0; i < altered_table->s->fields; i++) { + const Field* field = altered_table->field[i]; ulint is_unsigned; - ulint charset_no; - ulint col_len; - - while (!((field= altered_table->field[sql_idx])->stored_in_db())) { - sql_idx++; - } - - ulint field_type = (ulint) field->type(); - bool is_virtual = innobase_is_v_fld(field); + ulint field_type + = (ulint) field->type(); ulint col_type = get_innobase_type_from_mysql_type( &is_unsigned, field); + ulint charset_no; + ulint col_len; + bool is_virtual = innobase_is_v_fld(field); /* we assume in dtype_form_prtype() that this fits in two bytes */ @@ -4825,7 +4707,6 @@ prepare_inplace_alter_table_dict( } if (is_virtual) { -#ifdef MYSQL_VIRTUAL_COLUMNS dict_mem_table_add_v_col( ctx->new_table, ctx->heap, field->field_name, @@ -4833,9 +4714,7 @@ prepare_inplace_alter_table_dict( dtype_form_prtype( field_type, charset_no) | DATA_VIRTUAL, - col_len, i, - field->gcol_info->non_virtual_base_columns()); -#endif /* MYSQL_VIRTUAL_COLUMNS */ + col_len, i, 0); } else { dict_mem_table_add_col( ctx->new_table, ctx->heap, @@ -4847,9 +4726,6 @@ prepare_inplace_alter_table_dict( } } -#ifdef MYSQL_VIRTUAL_COLUMNS - ulint z = 0; - if (n_v_cols) { for (uint i = 0; i < altered_table->s->fields; i++) { dict_v_col_t* v_col; @@ -4865,15 +4741,12 @@ prepare_inplace_alter_table_dict( ctx->new_table, field, v_col); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ if (add_fts_doc_id) { fts_add_doc_id_column(ctx->new_table, ctx->heap); ctx->new_table->fts->doc_col = fts_doc_id_col; ut_ad(fts_doc_id_col - == altered_table->s->stored_fields - n_v_cols); - ut_ad(fts_doc_id_col == altered_table->s->stored_fields); - + == altered_table->s->fields - n_v_cols); } else if (ctx->new_table->fts) { ctx->new_table->fts->doc_col = fts_doc_id_col; } @@ -5023,14 +4896,12 @@ new_clustered_failed: for (ulint a = 0; a < ctx->num_to_add_index; a++) { -#ifdef MYSQL_VIRTUAL_COLUMNS if (index_defs[a].ind_type & DICT_VIRTUAL && ctx->num_to_drop_vcol > 0 && !new_clustered) { innodb_v_adjust_idx_col(ha_alter_info, old_table, ctx->num_to_drop_vcol, &index_defs[a]); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ ctx->add_index[a] = row_merge_create_index( ctx->trx, ctx->new_table, @@ -5601,7 +5472,6 @@ rename_indexes_in_cache( } #endif /* MYSQL_RENAME_INDEX */ -#ifdef MYSQL_VIRTUAL_COLUMNS /** Fill the stored column information in s_cols list. @param[in] altered_table mysql table object @param[in] table innodb table object @@ -5626,7 +5496,7 @@ alter_fill_stored_column( continue; } - ulint num_base = field->gcol_info->non_virtual_base_columns(); + ulint num_base = 0; dict_col_t* col = dict_table_get_nth_col(table, i); s_col.m_col = col; @@ -5649,7 +5519,7 @@ alter_fill_stored_column( (*s_cols)->push_back(s_col); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ + /** Allows InnoDB to update internal structures with concurrent writes blocked (provided that check_if_supported_inplace_alter() @@ -5790,6 +5660,12 @@ ha_innobase::prepare_inplace_alter_table( info.set_tablespace_type(is_file_per_table); + if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_INDEX) { + if (info.gcols_in_fulltext_or_spatial()) { + goto err_exit_no_heap; + } + } + if (ha_alter_info->handler_flags & Alter_inplace_info::CHANGE_CREATE_OPTION) { const char* invalid_opt = info.create_options_are_invalid(); @@ -6228,10 +6104,9 @@ check_if_can_drop_indexes: & Alter_inplace_info::ADD_FOREIGN_KEY) { ut_ad(!m_prebuilt->trx->check_foreigns); -#ifdef MYSQL_VIRTUAL_COLUMNS alter_fill_stored_column(altered_table, m_prebuilt->table, &s_cols, &s_heap); -#endif + add_fk = static_cast( mem_heap_zalloc( heap, @@ -6302,7 +6177,6 @@ err_exit: } -#ifdef MYSQL_VIRTUAL_COLUMNS if ((ha_alter_info->handler_flags & Alter_inplace_info::DROP_VIRTUAL_COLUMN) && prepare_inplace_drop_virtual( @@ -6316,7 +6190,6 @@ err_exit: ha_alter_info, altered_table, table)) { DBUG_RETURN(true); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ DBUG_RETURN(false); } @@ -6332,7 +6205,7 @@ err_exit: m_prebuilt->table, altered_table, &fts_doc_col_no, &num_v)) { - fts_doc_col_no = altered_table->s->stored_fields; + fts_doc_col_no = altered_table->s->fields - num_v; add_fts_doc_id = true; add_fts_doc_id_idx = true; @@ -6360,36 +6233,24 @@ err_exit: DBUG_ASSERT( doc_col_no == fts_doc_col_no || doc_col_no == ULINT_UNDEFINED - || (ha_alter_info->handler_flags)); - /* JAN: TODO: MySQL 5.7 Virtual columns + || (ha_alter_info->handler_flags & (Alter_inplace_info::ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::DROP_STORED_COLUMN - | - Alter_inplace_info::ADD_STORED_COLUMN))); - */ + | Alter_inplace_info::ADD_STORED_BASE_COLUMN))); } } /* See if an AUTO_INCREMENT column was added. */ - uint i = 0, innodb_idx= 0; + uint i = 0; ulint num_v = 0; List_iterator_fast cf_it( ha_alter_info->alter_info->create_list); while (const Create_field* new_field = cf_it++) { const Field* field; - if (!new_field->stored_in_db()) { - i++; - continue; - } DBUG_ASSERT(i < altered_table->s->fields); - DBUG_ASSERT(innodb_idx < altered_table->s->stored_fields); for (uint old_i = 0; table->field[old_i]; old_i++) { - if (!table->field[old_i]->stored_in_db()) { - continue; - } - if (new_field->field == table->field[old_i]) { goto found_col; } @@ -6413,12 +6274,10 @@ err_exit: my_error(ER_WRONG_AUTO_KEY, MYF(0)); goto err_exit; } - add_autoinc_col_no = innodb_idx; - /* JAN: TODO: MySQL 5.7 - autoinc_col_max_value = - field->get_max_int_value(); - */ + /* Get the col no of the old table non-virtual column array */ + add_autoinc_col_no = i - num_v; + autoinc_col_max_value = innobase_get_int_col_max_value(field); } found_col: @@ -6427,7 +6286,6 @@ found_col: } i++; - innodb_idx++; } DBUG_ASSERT(heap); @@ -6601,7 +6459,6 @@ ok_exit: && alter_templ_needs_rebuild( altered_table, ha_alter_info, ctx->new_table)); -#ifdef MYSQL_VIRTUAL_COLUMNS if ((ctx->new_table->n_v_cols > 0) && rebuild_templ) { /* Save the templ if isn't NULL so as to restore the original state in case of alter operation failures. */ @@ -6609,11 +6466,9 @@ ok_exit: old_templ = ctx->new_table->vc_templ; } s_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); - s_templ->vtempl = NULL; innobase_build_v_templ( - altered_table, ctx->new_table, s_templ, - NULL, false, NULL); + altered_table, ctx->new_table, s_templ, NULL, false); ctx->new_table->vc_templ = s_templ; } else if (ctx->num_to_add_vcol > 0 && ctx->num_to_drop_vcol == 0) { @@ -6630,11 +6485,8 @@ ok_exit: add_v->v_col = ctx->add_vcol; add_v->v_col_name = ctx->add_vcol_name; - s_templ->vtempl = NULL; - innobase_build_v_templ( - altered_table, ctx->new_table, s_templ, - add_v, false, NULL); + altered_table, ctx->new_table, s_templ, add_v, false); old_templ = ctx->new_table->vc_templ; ctx->new_table->vc_templ = s_templ; } @@ -6645,7 +6497,6 @@ ok_exit: if (!ctx->need_rebuild() && ctx->num_to_drop_vcol > 0) { eval_table = table; } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* Read the clustered index of the table and build indexes based on this information using temporary @@ -7452,14 +7303,13 @@ innobase_enlarge_columns_try( List_iterator_fast cf_it( ha_alter_info->alter_info->create_list); ulint i = 0; - bool is_v=false; + ulint num_v = 0; + bool is_v; for (Field** fp = table->field; *fp; fp++, i++) { ulint idx; -#ifdef MYSQL_VIRTUAL_COLUMNS - ulint num_v = 0; - if ((*fp)->is_virtual_gcol()) { + if (innobase_is_v_fld(*fp)) { is_v = true; idx = num_v; num_v++; @@ -7467,10 +7317,6 @@ innobase_enlarge_columns_try( idx = i - num_v; is_v = false; } -#else - idx = i; - is_v = false; -#endif cf_it.rewind(); while (Create_field* cf = cf_it++) { @@ -7614,8 +7460,6 @@ commit_get_autoinc( ulonglong offset; col_max_value = innobase_get_int_col_max_value(autoinc_field); - // JAN: TODO: MySQL 5.7 - //col_max_value = autoinc_field->get_max_int_value(); offset = ctx->prebuilt->autoinc_offset; max_autoinc = innobase_next_autoinc( @@ -8213,7 +8057,6 @@ commit_try_norebuild( } #endif /* MYSQL_RENAME_INDEX */ -#ifdef MYSQL_VIRTUAL_COLUMNS if ((ha_alter_info->handler_flags & Alter_inplace_info::DROP_VIRTUAL_COLUMN) && innobase_drop_virtual_try( @@ -8229,7 +8072,6 @@ commit_try_norebuild( ctx->old_table, trx)) { DBUG_RETURN(true); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ DBUG_RETURN(false); } diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 5e5fbae9081..c44dc156aaa 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1984,7 +1984,6 @@ dict_free_vc_templ( ut_free(vc_templ->vtempl[i]); } } - ut_free(vc_templ->default_rec); ut_free(vc_templ->vtempl); vc_templ->vtempl = NULL; } diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 019e20680e5..c81d893ed5a 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1328,14 +1328,19 @@ struct dict_vcol_templ_t { /** table name */ std::string tb_name; - /** share->table_name */ - std::string share_name; - /** MySQL record length */ ulint rec_len; /** default column value if any */ byte* default_rec; + + /** cached MySQL TABLE object */ + TABLE* mysql_table; + + /** when mysql_table was cached */ + uint64_t mysql_table_query_id; + + dict_vcol_templ_t() : vtempl(0), mysql_table_query_id(-1) {} }; /* This flag is for sync SQL DDL and memcached DML. diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index f3641f93681..116ca781726 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -52,7 +52,6 @@ struct fts_string_t; #undef MYSQL_SPATIAL_INDEX #undef MYSQL_STORE_FTS_DOC_ID #undef MYSQL_TABLESPACES -#undef MYSQL_VIRTUAL_COLUMNS /*********************************************************************//** Wrapper around MySQL's copy_and_convert function. @@ -654,5 +653,20 @@ buffer pool size. void innodb_set_buf_pool_size(ulonglong buf_pool_size); +/** Create a MYSQL_THD for background purge threads and mark it as such. +@returns new MYSQL_THD */ +MYSQL_THD +innobase_create_background_thd(); + +/** Destroy a background purge thread THD. +@param[in] thd MYSQL_THD to destroy */ +void +innobase_destroy_background_thd(MYSQL_THD); + +/** Close opened tables, free memory, delete items for a MYSQL_THD. +@param[in] thd MYSQL_THD to reset */ +void +innobase_reset_background_thd(MYSQL_THD); + #endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM */ #endif /* HA_INNODB_PROTOTYPES_H */ diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index bc421774320..0a5e3b27bc0 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -2195,6 +2195,13 @@ loop: count = 0; } + /* Wake up purge threads to die - they have MYSQL_THD's and + thus might keep open transactions. In particular, this is + needed in embedded server and when one uses UNINSTALL PLUGIN. + In the normal server shutdown purge threads should've been + already notified by the thd_destructor_proxy thread. */ + srv_purge_wakeup(); + goto loop; } diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 20c64a4288c..271d70d4da9 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -931,7 +931,6 @@ row_ins_invalidate_query_cache( innobase_invalidate_query_cache(thr_get_trx(thr), name, len); } -#ifdef MYSQL_VIRTUAL_COLUMNS /** Fill virtual column information in cascade node for the child table. @param[out] cascade child update node @@ -1042,7 +1041,6 @@ func_exit: mem_heap_free(v_heap); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ #ifdef WITH_WSREP dberr_t wsrep_append_foreign_key(trx_t *trx, @@ -1338,7 +1336,6 @@ row_ins_foreign_check_on_constraint( cascade->fts_doc_id = doc_id; } -#ifdef MYSQL_VIRTUAL_COLUMNS if (foreign->v_cols != NULL && foreign->v_cols->size() > 0) { row_ins_foreign_fill_virtual( @@ -1349,7 +1346,6 @@ row_ins_foreign_check_on_constraint( goto nonstandard_exit_func; } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ } else if (table->fts && cascade->is_delete) { /* DICT_FOREIGN_ON_DELETE_CASCADE case */ for (i = 0; i < foreign->n_fields; i++) { @@ -1379,7 +1375,6 @@ row_ins_foreign_check_on_constraint( trx, &fts_col_affacted, cascade); -#ifdef MYSQL_VIRTUAL_COLUMNS if (foreign->v_cols != NULL && foreign->v_cols->size() > 0) { row_ins_foreign_fill_virtual( @@ -1390,7 +1385,6 @@ row_ins_foreign_check_on_constraint( goto nonstandard_exit_func; } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ if (n_to_update == ULINT_UNDEFINED) { err = DB_ROW_IS_REFERENCED; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index d302b493f21..7a8b74279f5 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -655,13 +655,10 @@ row_merge_buf_add( const dfield_t* row_field; col = ifield->col; - -#ifdef MYSQL_VIRTUAL_COLUMNS const dict_v_col_t* v_col = NULL; if (dict_col_is_virtual(col)) { v_col = reinterpret_cast(col); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ col_no = dict_col_get_no(col); @@ -687,7 +684,6 @@ row_merge_buf_add( } else { /* Use callback to get the virtual column value */ if (dict_col_is_virtual(col)) { - #ifdef MYSQL_VIRTUAL_COLUMN dict_index_t* clust_index = dict_table_get_first_index(new_table); @@ -701,7 +697,6 @@ row_merge_buf_add( DBUG_RETURN(0); } dfield_copy(field, row_field); -#endif /* MYSQL_VIRTUAL_COLUMN */ } else { row_field = dtuple_get_nth_field(row, col_no); dfield_copy(field, row_field); diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 5b38b7c6c01..100e1bcb708 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -5034,14 +5034,12 @@ end: goto funct_exit; } -#ifdef MYSQL_VIRTUAL_COLUMNS /* In case of copy alter, template db_name and table_name should be renamed only for newly created table. */ if (table->vc_templ != NULL && !new_is_tmp) { innobase_rename_vc_templ(table); } -#endif /* We only want to switch off some of the type checking in an ALTER TABLE...ALGORITHM=COPY, not in a RENAME. */ diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index bac55694056..23e08c38cdd 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -868,7 +868,6 @@ try_again: goto err_exit; } -#ifdef MYSQL_VIRTUAL_COLUMNS if (node->table->n_v_cols && !node->table->vc_templ && dict_table_has_indexed_v_cols(node->table)) { /* Need server fully up for virtual column computation */ @@ -886,7 +885,6 @@ try_again: /* Initialize the template for the table */ innobase_init_vc_templ(node->table); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* Disable purging for temp-tables as they are short-lived and no point in re-organzing such short lived tables */ @@ -1120,6 +1118,8 @@ row_purge_step( row_purge_end(thr); } + innobase_reset_background_thd(thr_get_trx(thr)->mysql_thd); + return(thr); } diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 62fd18d027b..5daa26319a5 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -221,7 +221,6 @@ row_sel_sec_rec_is_for_clust_rec( /* For virtual column, its value will need to be reconstructed from base column in cluster index */ if (is_virtual) { -#ifdef MYSQL_VIRTUAL_COLUMNS const dict_v_col_t* v_col; const dtuple_t* row; dfield_t* vfield; @@ -243,7 +242,6 @@ row_sel_sec_rec_is_for_clust_rec( clust_len = vfield->len; clust_field = static_cast(vfield->data); -#endif /* MYSQL_VIRTUAL_COLUMNS */ } else { clust_pos = dict_col_get_clust_pos(col, clust_index); diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 759bfb57428..2a990904242 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1076,7 +1076,6 @@ row_upd_build_difference_binary( } } -#ifdef MYSQL_VIRTUAL_COLUMNS /* Check the virtual columns updates. Even if there is no non-virtual column (base columns) change, we will still need to build the indexed virtual column value so that undo log would log them ( @@ -1141,7 +1140,6 @@ row_upd_build_difference_binary( mem_heap_free(v_heap); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ update->n_fields = n_diff; ut_ad(update->validate()); @@ -2061,7 +2059,6 @@ row_upd_eval_new_vals( } } -#ifdef MYSQL_VIRTUAL_COLUMNS /** Stores to the heap the virtual columns that need for any indexes @param[in,out] node row update node @param[in] update an update vector if it is update @@ -2140,7 +2137,6 @@ row_upd_store_v_row( mem_heap_free(heap); } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /** Stores to the heap the row on which the node->pcur is positioned. @param[in] node row update node @@ -2190,12 +2186,10 @@ row_upd_store_row( node->row = row_build(ROW_COPY_DATA, clust_index, rec, offsets, NULL, NULL, NULL, ext, node->heap); -#ifdef MYSQL_VIRTUAL_COLUMNS if (node->table->n_v_cols) { row_upd_store_v_row(node, node->is_delete ? NULL : node->update, thd, mysql_table); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ if (node->is_delete) { node->upd_row = NULL; diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index fd17683fb48..f21b1ebbb85 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -467,7 +467,6 @@ row_vers_non_vc_match( return(ret); } -#ifdef MYSQL_VIRTUAL_COLUMNS /** build virtual column value from current cluster index record data @param[in,out] row the cluster index row in dtuple form @param[in] clust_index clustered index @@ -841,7 +840,6 @@ row_vers_build_cur_vrow( ULINT_UNDEFINED, &heap); return(cur_vrow); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /*****************************************************************//** Finds out if a version of the record, where the version >= the current @@ -913,7 +911,6 @@ row_vers_old_has_index_entry( if (dict_index_has_virtual(index)) { -#ifdef MYSQL_VIRTUAL_COLUMNS #ifdef DBUG_OFF # define dbug_v_purge false @@ -963,7 +960,6 @@ row_vers_old_has_index_entry( } clust_offsets = rec_get_offsets(rec, clust_index, NULL, ULINT_UNDEFINED, &heap); -#endif /* MYSQL_VIRTUAL_COLUMNS */ } else { entry = row_build_index_entry( @@ -1001,7 +997,6 @@ row_vers_old_has_index_entry( } } } else if (dict_index_has_virtual(index)) { -#ifdef MYSQL_VIRTUAL_COLUMNS /* The current cluster index record could be deleted, but the previous version of it might not. We will need to get the virtual column data from undo record @@ -1009,7 +1004,6 @@ row_vers_old_has_index_entry( cur_vrow = row_vers_build_cur_vrow( also_curr, rec, clust_index, &clust_offsets, index, ientry, roll_ptr, trx_id, heap, v_heap, mtr); -#endif /* MYSQL_VIRTUAL_COLUMNS */ } version = rec; diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index d2f13ad9b37..2e9e3b7ea8a 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -2664,8 +2664,13 @@ Check if purge should stop. static bool srv_purge_should_exit( + MYSQL_THD thd, ulint n_purged) /*!< in: pages purged in last batch */ { + if (thd_kill_level(thd)) { + return(true); + } + switch (srv_shutdown_state) { case SRV_SHUTDOWN_NONE: /* Normal operation. */ @@ -2736,8 +2741,7 @@ DECLARE_THREAD(srv_worker_thread)( ut_ad(!srv_read_only_mode); ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND); my_thread_init(); - // JAN: TODO: MySQL 5.7 - // THD *thd= create_thd(false, true, true); + THD* thd = innobase_create_background_thd(); #ifdef UNIV_DEBUG_THREAD_CREATION ib::info() << "Worker thread starting, id " @@ -2781,7 +2785,7 @@ DECLARE_THREAD(srv_worker_thread)( ut_a(!purge_sys->running); ut_a(purge_sys->state == PURGE_STATE_EXIT); - ut_a(srv_shutdown_state > SRV_SHUTDOWN_NONE); + ut_a(srv_shutdown_state > SRV_SHUTDOWN_NONE || thd_kill_level(thd)); rw_lock_x_unlock(&purge_sys->latch); @@ -2790,9 +2794,8 @@ DECLARE_THREAD(srv_worker_thread)( << os_thread_pf(os_thread_get_curr_id()); #endif /* UNIV_DEBUG_THREAD_CREATION */ - // JAN: TODO: MySQL 5.7 - // destroy_thd(thd); - my_thread_end(); + innobase_destroy_background_thd(thd); + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ os_thread_exit(); @@ -2807,6 +2810,7 @@ static ulint srv_do_purge( /*=========*/ + MYSQL_THD thd, ulint n_threads, /*!< in: number of threads to use */ ulint* n_total_purged) /*!< in/out: total pages purged */ { @@ -2877,7 +2881,7 @@ srv_do_purge( *n_total_purged += n_pages_purged; - } while (!srv_purge_should_exit(n_pages_purged) + } while (!srv_purge_should_exit(thd, n_pages_purged) && n_pages_purged > 0 && purge_sys->state == PURGE_STATE_RUN); @@ -2890,6 +2894,7 @@ static void srv_purge_coordinator_suspend( /*==========================*/ + MYSQL_THD thd, srv_slot_t* slot, /*!< in/out: Purge coordinator thread slot */ ulint rseg_history_len) /*!< in: history list length @@ -2977,7 +2982,7 @@ srv_purge_coordinator_suspend( } } - } while (stop); + } while (stop && !thd_kill_level(thd)); srv_sys_mutex_enter(); @@ -3001,8 +3006,7 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( required by os_thread_create */ { my_thread_init(); - // JAN: TODO: MySQL 5.7 - // THD *thd= create_thd(false, true, true); + THD* thd = innobase_create_background_thd(); srv_slot_t* slot; ulint n_total_purged = ULINT_UNDEFINED; @@ -3036,13 +3040,14 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( purge didn't purge any records then wait for activity. */ if (srv_shutdown_state == SRV_SHUTDOWN_NONE + && !thd_kill_level(thd) && (purge_sys->state == PURGE_STATE_STOP || n_total_purged == 0)) { - srv_purge_coordinator_suspend(slot, rseg_history_len); + srv_purge_coordinator_suspend(thd, slot, rseg_history_len); } - if (srv_purge_should_exit(n_total_purged)) { + if (srv_purge_should_exit(thd, n_total_purged)) { ut_a(!slot->suspended); break; } @@ -3050,14 +3055,14 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( n_total_purged = 0; rseg_history_len = srv_do_purge( - srv_n_purge_threads, &n_total_purged); + thd, srv_n_purge_threads, &n_total_purged); - } while (!srv_purge_should_exit(n_total_purged)); + } while (!srv_purge_should_exit(thd, n_total_purged)); /* Ensure that we don't jump out of the loop unless the exit condition is satisfied. */ - ut_a(srv_purge_should_exit(n_total_purged)); + ut_a(srv_purge_should_exit(thd, n_total_purged)); ulint n_pages_purged = ULINT_MAX; @@ -3068,12 +3073,6 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( n_pages_purged = trx_purge(1, srv_purge_batch_size, false); } -#ifdef UNIV_DEBUG - if (srv_fast_shutdown == 0) { - trx_commit_disallowed = true; - } -#endif /* UNIV_DEBUG */ - /* This trx_purge is called to remove any undo records (added by background threads) after completion of the above loop. When srv_fast_shutdown != 0, a large batch size can cause significant @@ -3116,8 +3115,7 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( srv_release_threads(SRV_WORKER, srv_n_purge_threads - 1); } - // JAN: TODO: MYSQL 5.7 - // destroy_thd(thd); + innobase_destroy_background_thd(thd); my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index cb902f976fa..27a3e7b3294 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -13969,8 +13969,8 @@ enum_alter_inplace_result ha_mroonga::wrapper_check_if_supported_inplace_alter( ( Alter_inplace_info::ADD_COLUMN | Alter_inplace_info::DROP_COLUMN | - Alter_inplace_info::ALTER_COLUMN_TYPE | - Alter_inplace_info::ALTER_COLUMN_ORDER | + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE | + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::ALTER_COLUMN_NULLABLE | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE | Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE | diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index 00a4602b554..ba1afbf091a 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -216,11 +216,11 @@ static ulong fix_handler_flags( handler_flags &= ~Alter_inplace_info::TOKU_ALTER_RENAME; } - // ALTER_COLUMN_TYPE may be set when no columns have been changed, + // ALTER_STORED_COLUMN_TYPE may be set when no columns have been changed, // so turn off the flag - if (handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) { + if (handler_flags & Alter_inplace_info::ALTER_STORED_COLUMN_TYPE) { if (all_fields_are_same_type(table, altered_table)) { - handler_flags &= ~Alter_inplace_info::ALTER_COLUMN_TYPE; + handler_flags &= ~Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; } } @@ -358,7 +358,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( // but let's do some more checks // we will only allow an hcr if there are no changes - // in column positions (ALTER_COLUMN_ORDER is not set) + // in column positions (ALTER_STORED_COLUMN_ORDER is not set) // now need to verify that one and only one column // has changed only its name. If we find anything to @@ -369,7 +369,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( table, altered_table, (ctx->handler_flags & - Alter_inplace_info::ALTER_COLUMN_ORDER) != 0); + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER) != 0); if (cr_supported) result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } @@ -377,7 +377,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( only_flags( ctx->handler_flags, Alter_inplace_info::ADD_COLUMN + - Alter_inplace_info::ALTER_COLUMN_ORDER) && + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER) && setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { // add column @@ -407,7 +407,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( only_flags( ctx->handler_flags, Alter_inplace_info::DROP_COLUMN + - Alter_inplace_info::ALTER_COLUMN_ORDER) && + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER) && setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { // drop column @@ -452,10 +452,10 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( ha_alter_info, ctx)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else if ((ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) && + } else if ((ctx->handler_flags & Alter_inplace_info::ALTER_STORED_COLUMN_TYPE) && only_flags( ctx->handler_flags, - Alter_inplace_info::ALTER_COLUMN_TYPE + + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE + Alter_inplace_info::ALTER_COLUMN_DEFAULT) && table->s->fields == altered_table->s->fields && find_changed_fields( @@ -1578,7 +1578,7 @@ static bool change_field_type_is_supported( return false; } else if (old_type == MYSQL_TYPE_VARCHAR) { // varchar(X) -> varchar(Y) and varbinary(X) -> varbinary(Y) expansion - // where X < 256 <= Y the ALTER_COLUMN_TYPE handler flag is set for + // where X < 256 <= Y the ALTER_STORED_COLUMN_TYPE handler flag is set for // these cases return change_varchar_length_is_supported( old_field, From 8b3b6dc377c548b1b72978a015af999cf6e99760 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 21 Nov 2016 15:04:57 +0100 Subject: [PATCH 083/135] test how MDL blocks InnoDB purge it must, because purge opens a table that might be being altered right now --- .../gcol/r/innodb_virtual_debug_purge.result | 19 ++++++++++++++++ .../gcol/t/innodb_virtual_debug_purge.test | 22 ++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result index 82513c5c5ca..a266952866a 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -138,4 +138,23 @@ a b c 6 6 12 8 8 16 DROP TABLE t0, t1; +create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100))); +insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk"); +insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm"); +set global innodb_purge_stop_now = 1; +set global debug_dbug="+d,ib_purge_virtual_index_callback"; +update t set a = repeat('m', 16000) where a like "aaa%"; +connect con1, localhost, root; +lock table t write; +connection default; +set global innodb_purge_run_now=1; +select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age'; +variable_value>1 +1 +disconnect con1; +select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age'; +variable_value>1 +0 +set global debug_dbug=@old_dbug; +drop table t; set debug_sync=reset; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test index d2634aa1ee8..1e6cd44d0aa 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test @@ -169,6 +169,26 @@ SELECT * FROM t1; DROP TABLE t0, t1; ---source include/wait_until_count_sessions.inc +# +# test MDLs with purge +# +create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100))); +insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk"); +insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm"); +set global innodb_purge_stop_now = 1; +set global debug_dbug="+d,ib_purge_virtual_index_callback"; +update t set a = repeat('m', 16000) where a like "aaa%"; +connect(con1, localhost, root); +lock table t write; +connection default; +set global innodb_purge_run_now=1; +sleep 3; +select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age'; +disconnect con1; +sleep 3; +select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age'; +set global debug_dbug=@old_dbug; +drop table t; +--source include/wait_until_count_sessions.inc set debug_sync=reset; From a411d7f4f670c24b43b50f7d2a1129e10218f4a7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Nov 2016 17:17:40 +0100 Subject: [PATCH 084/135] store/show vcols as item->print() otherwise we'd need to store sql_mode *per vcol* (consider CREATE INDEX...) and how SHOW CREATE TABLE would support that? Additionally, get rid of vcol::expr_str, just to make sure the string is always generated and never leaked in the original form. --- mysql-test/r/alter_table.result | 4 +- mysql-test/r/cast.result | 2 +- mysql-test/r/check_constraint.result | 54 +- mysql-test/r/constraints.result | 6 +- mysql-test/r/create.result | 6 +- mysql-test/r/ctype_binary.result | 4 +- mysql-test/r/ctype_cp1251.result | 4 +- mysql-test/r/ctype_latin1.result | 4 +- mysql-test/r/ctype_like_range.result | 4 +- mysql-test/r/ctype_ucs.result | 4 +- mysql-test/r/ctype_utf8.result | 18 +- mysql-test/r/default.result | 551 ++++++++++-------- mysql-test/r/dyncol.result | 20 +- mysql-test/r/func_compress.result | 6 +- mysql-test/r/func_crypt.result | 2 +- mysql-test/r/func_digest.result | 4 +- mysql-test/r/func_encrypt.result | 4 +- mysql-test/r/func_hybrid_type.result | 2 +- mysql-test/r/func_misc.result | 16 +- mysql-test/r/func_time.result | 4 +- mysql-test/r/func_time_hires.result | 2 +- mysql-test/r/function_defaults.result | 200 +++---- mysql-test/r/function_defaults_innodb.result | 200 +++---- mysql-test/r/gis.result | 62 +- mysql-test/r/grant.result | 4 +- mysql-test/r/key.result | 4 +- mysql-test/r/log_slow.result | 2 +- mysql-test/r/log_tables.result | 16 +- mysql-test/r/mysql5613mysql.result | 12 +- mysql-test/r/mysql57_virtual.result | 4 +- mysql-test/r/mysqldump.result | 8 +- mysql-test/r/partition.result | 2 +- mysql-test/r/partition_bug18198.result | 3 +- mysql-test/r/plugin_auth.result | 2 +- mysql-test/r/show_check.result | 12 +- mysql-test/r/sql_mode.result | 4 +- mysql-test/r/statistics.result | 2 +- mysql-test/r/strict.result | 2 +- mysql-test/r/system_mysql_db.result | 14 +- mysql-test/r/system_mysql_db_fix40123.result | 14 +- mysql-test/r/system_mysql_db_fix50030.result | 14 +- mysql-test/r/system_mysql_db_fix50117.result | 14 +- mysql-test/r/type_blob.result | 4 +- mysql-test/r/type_ranges.result | 6 +- mysql-test/r/type_temporal_mysql56.result | 2 +- mysql-test/r/type_timestamp.result | 30 +- mysql-test/r/type_timestamp_hires.result | 30 +- mysql-test/r/udf.result | 2 +- mysql-test/r/view.result | 4 +- mysql-test/suite/funcs_1/r/is_columns.result | 6 +- .../suite/funcs_1/r/is_columns_innodb.result | 2 +- .../funcs_1/r/is_columns_is_embedded.result | 4 +- .../suite/funcs_1/r/is_columns_memory.result | 2 +- .../suite/funcs_1/r/is_columns_myisam.result | 2 +- .../r/is_columns_myisam_embedded.result | 2 +- .../suite/funcs_1/r/is_columns_mysql.result | 16 +- .../r/is_columns_mysql_embedded.result | 16 +- mysql-test/suite/gcol/r/gcol_bugfixes.result | 5 +- .../r/gcol_column_def_options_innodb.result | 36 +- .../r/gcol_column_def_options_myisam.result | 36 +- .../suite/gcol/r/gcol_keys_innodb.result | 8 +- .../suite/gcol/r/gcol_keys_myisam.result | 14 +- .../r/gcol_non_stored_columns_innodb.result | 10 +- .../r/gcol_non_stored_columns_myisam.result | 10 +- .../r/gcol_supported_sql_funcs_innodb.result | 368 ++++++------ .../r/gcol_supported_sql_funcs_myisam.result | 368 ++++++------ mysql-test/suite/gcol/r/rpl_gcol.result | 2 +- .../innodb/r/innodb-virtual-columns.result | 150 +---- .../parts/r/partition_datetime_innodb.result | 4 +- .../parts/r/partition_datetime_myisam.result | 4 +- mysql-test/suite/rpl/r/rpl_default.result | 2 +- .../rpl/r/rpl_extra_col_slave_innodb.result | 2 +- .../rpl/r/rpl_extra_col_slave_myisam.result | 2 +- .../suite/rpl/r/rpl_multi_engine.result | 24 +- .../suite/rpl/r/rpl_partition_innodb.result | 8 +- .../suite/rpl/r/rpl_partition_memory.result | 8 +- .../suite/rpl/r/rpl_partition_myisam.result | 8 +- .../r/rpl_temporal_mysql56_to_mariadb.result | 4 +- .../rpl_temporal_mysql56_to_mariadb53.result | 4 +- ...explicit_defaults_for_timestamp_off.result | 38 +- .../explicit_defaults_for_timestamp_on.result | 12 +- mysql-test/suite/vcol/r/delayed.result | 7 + .../suite/vcol/r/innodb_autoinc_vcol.result | 2 +- mysql-test/suite/vcol/r/rpl_vcol.result | 2 +- .../vcol/r/vcol_blocked_sql_funcs.result | 16 +- .../r/vcol_column_def_options_innodb.result | 12 +- .../r/vcol_column_def_options_myisam.result | 12 +- .../suite/vcol/r/vcol_keys_innodb.result | 8 +- .../suite/vcol/r/vcol_keys_myisam.result | 8 +- mysql-test/suite/vcol/r/vcol_misc.result | 22 +- .../r/vcol_non_stored_columns_innodb.result | 12 +- .../r/vcol_non_stored_columns_myisam.result | 12 +- .../vcol/r/vcol_supported_sql_funcs.result | 354 +++++------ mysql-test/suite/vcol/r/vcol_syntax.result | 12 +- mysql-test/suite/vcol/t/delayed.test | 5 + .../vcol/t/vcol_blocked_sql_funcs_main.inc | 2 +- mysql-test/t/default.test | 25 +- mysql-test/t/partition_bug18198.test | 2 +- sql/field.cc | 40 +- sql/field.h | 70 ++- sql/item.cc | 86 +-- sql/item.h | 7 + sql/item_timefunc.cc | 20 +- sql/item_timefunc.h | 4 +- sql/mysqld.h | 14 +- sql/share/errmsg-utf8.txt | 4 +- sql/sql_insert.cc | 69 +-- sql/sql_show.cc | 57 +- sql/sql_string.cc | 2 +- sql/sql_string.h | 6 + sql/sql_table.cc | 44 +- sql/sql_yacc.yy | 43 +- sql/table.cc | 401 +++++++------ sql/table.h | 8 +- sql/unireg.cc | 256 +++----- .../mysql-test/connect/r/mysql_new.result | 4 +- ...stamp_fractional_seconds_with_index.result | 2 +- .../r/column_timestamp_with_index.result | 2 +- .../r/create_table_TODO_SPLIT_ME.result | 2 +- ...y_timestamp_with_fractional_seconds.result | 2 +- ...imestamp_without_fractional_seconds.result | 2 +- .../r/create_table_TODO_SPLIT_ME.result | 2 +- ..._multiple_column_primary_key_myisam.result | 2 +- ...multiple_column_unique_index_myisam.result | 2 +- .../mysql-test/sql_discovery/simple.result | 2 +- .../rpl/r/rpl_extra_col_slave_tokudb.result | 2 +- .../rpl/r/rpl_partition_tokudb.result | 8 +- .../rpl/r/rpl_tokudb_bug28430.result | 2 +- .../mysql-test/tokudb/r/type_ranges.result | 6 +- .../mysql-test/tokudb/r/type_timestamp.result | 22 +- .../r/partition_datetime_tokudb.result | 4 +- tests/mysql_client_test.c | 2 +- 132 files changed, 2091 insertions(+), 2192 deletions(-) create mode 100644 mysql-test/suite/vcol/r/delayed.result create mode 100644 mysql-test/suite/vcol/t/delayed.test diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index f3e41e1b246..dbfe2e8e162 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -2073,8 +2073,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `min` CHECK (a+b > 100), - CONSTRAINT `mini` CHECK (a+b > 100) + CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), + CONSTRAINT `mini` CHECK (((`a` + `b`) > 100)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1(a INT, b INT, CONSTRAINT min check (a>5), diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 9f653a17ce8..ac90a6ec68b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -804,7 +804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` char(5) AS (cast("a" as char(10) binary) + a) VIRTUAL + `b` char(5) AS ((cast('a' as char(10) charset latin1) + `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select collation(cast("a" as char(10) binary)); diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result index f3c1fda1eee..ddca2ea1393 100644 --- a/mysql-test/r/check_constraint.result +++ b/mysql-test/r/check_constraint.result @@ -3,10 +3,10 @@ create table t1 (a int check(a>10), b int check (b > 20), constraint `min` check show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK (a>10), - `b` int(11) DEFAULT NULL CHECK (b > 20), - CONSTRAINT `min` CHECK (a+b > 100), - CONSTRAINT `max` CHECK (a+b <500) + `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), + `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), + CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), + CONSTRAINT `max` CHECK (((`a` + `b`) < 500)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (100,100); insert into t1 values (1,1); @@ -52,12 +52,12 @@ set check_constraint_checks=@save_check_constraint; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK (a>10), - `b` int(11) DEFAULT NULL CHECK (b > 20), - `c` int(11) DEFAULT 0 CHECK (c < 10), - CONSTRAINT `min` CHECK (a+b > 100), - CONSTRAINT `max` CHECK (a+b <500), - CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) + `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), + `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), + `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), + CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), + CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), + CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values(105,105,105); ERROR 23000: CONSTRAINT `c` failed for `test`.`t1` @@ -75,12 +75,12 @@ create table t2 like t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT NULL CHECK (a>10), - `b` int(11) DEFAULT NULL CHECK (b > 20), - `c` int(11) DEFAULT 0 CHECK (c < 10), - CONSTRAINT `min` CHECK (a+b > 100), - CONSTRAINT `max` CHECK (a+b <500), - CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) + `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), + `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), + `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), + CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), + CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), + CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t2 drop constraint c; ERROR 42000: Can't DROP CONSTRAINT `c`; check that it exists @@ -91,11 +91,11 @@ alter table t2 drop constraint min; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT NULL CHECK (a>10), - `b` int(11) DEFAULT NULL CHECK (b > 20), - `c` int(11) DEFAULT 0 CHECK (c < 10), - CONSTRAINT `max` CHECK (a+b <500), - CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) + `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), + `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), + `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), + CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), + CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create or replace table t1 (a int, b int, constraint check (a>b)); @@ -104,7 +104,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK (a>b) + CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a int, b int, constraint CONSTRAINT_1 check (a>1), @@ -114,8 +114,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK (a>1), - CONSTRAINT `CONSTRAINT_2` CHECK (b>1) + CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)), + CONSTRAINT `CONSTRAINT_2` CHECK ((`b` > 1)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a int, b int, constraint CONSTRAINT_1 check (a>1), @@ -126,8 +126,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK (a>1), - CONSTRAINT `CONSTRAINT_3` CHECK (b>1), - CONSTRAINT `CONSTRAINT_2` CHECK (a>b) + CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)), + CONSTRAINT `CONSTRAINT_3` CHECK ((`b` > 1)), + CONSTRAINT `CONSTRAINT_2` CHECK ((`a` > `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index 8ab38bf1f35..017d03f7e67 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -3,7 +3,7 @@ create table t1 (a int check (a>0)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK (a>0) + `a` int(11) DEFAULT NULL CHECK ((`a` > 0)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1); insert into t1 values (0); @@ -15,7 +15,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK (a>b) + CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); @@ -27,7 +27,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `abc` CHECK (a>b) + CONSTRAINT `abc` CHECK ((`a` > `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 801a500345e..4baa254a966 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1866,8 +1866,8 @@ Thinkpad Laptop black ttt show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `color` char(32) AS (COLUMN_GET(dynamic_cols, 1 as char)) PERSISTENT, - `cl` char(32) AS (COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1 , 'blue' as char), 2, 'ttt'), i as char)) PERSISTENT, + `color` char(32) AS (column_get(`dynamic_cols`,1 as char charset latin1)) PERSISTENT, + `cl` char(32) AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 ),2,'ttt'),`i` as char charset latin1)) PERSISTENT, `item_name` varchar(32) NOT NULL, `i` int(11) DEFAULT NULL, `dynamic_cols` blob DEFAULT NULL, @@ -1888,7 +1888,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) DEFAULT NULL, - `c` char(32) AS (convert(cast(n as char), char)) PERSISTENT + `c` char(32) AS (cast(cast(`n` as char charset latin1) as char charset latin1)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set @@session.collation_server=filename; diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index eb1746b933b..77e1224fa83 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2869,11 +2869,11 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())` +Note 1003 select concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())` DROP PROCEDURE p1; # # Bug#52159 returning time type from function and empty left join causes debug assertion diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 36dc23f33be..3f8dae4e03d 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3278,11 +3278,11 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),now()) AS `CONCAT(v_LastPaymentDate, NOW())` +Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())` DROP PROCEDURE p1; # # Bug#52159 returning time type from function and empty left join causes debug assertion diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 5ed8e9e8868..1a155a1c63d 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3575,11 +3575,11 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())` +Note 1003 select concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())` DROP PROCEDURE p1; # # Bug#52159 returning time type from function and empty left join causes debug assertion diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result index 176cfe3acf0..f8032d0ae86 100644 --- a/mysql-test/r/ctype_like_range.result +++ b/mysql-test/r/ctype_like_range.result @@ -4419,8 +4419,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `mn` varchar(10) DEFAULT LIKE_RANGE_MIN(a,10), - `mx` varchar(10) DEFAULT LIKE_RANGE_MAX(a,10) + `mn` varchar(10) DEFAULT like_range_min(`a`,10), + `mx` varchar(10) DEFAULT like_range_max(`a`,10) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%'); SELECT a, HEX(mn), HEX(mx) FROM t1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 9902a91a2bf..61367cbe081 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -4478,11 +4478,11 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(now() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())` +Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(current_timestamp() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())` DROP PROCEDURE p1; # # Bug#52159 returning time type from function and empty left join causes debug assertion diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 5e76aa2c203..bd148d82ac7 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5320,11 +5320,11 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),now()) AS `CONCAT(v_LastPaymentDate, NOW())` +Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())` DROP PROCEDURE p1; # # Bug#52159 returning time type from function and empty left join causes debug assertion @@ -10515,7 +10515,7 @@ SET NAMES utf8; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) DEFAULT CONCAT('ß') + `a` varchar(30) DEFAULT concat('ß') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT HEX(a),a FROM t1; @@ -10528,9 +10528,9 @@ ALTER TABLE t1 ADD c VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) DEFAULT CONCAT('ß'), - `b` varchar(30) DEFAULT CONCAT('ß'), - `c` varchar(30) DEFAULT CONCAT('ß') + `a` varchar(30) DEFAULT concat('ß'), + `b` varchar(30) DEFAULT concat('ß'), + `c` varchar(30) DEFAULT concat('ß') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELETE FROM t1; INSERT INTO t1 VALUES(); @@ -10551,7 +10551,7 @@ SET NAMES utf8; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß') + `a` varchar(30) CHARACTER SET utf8 DEFAULT concat('ß') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT HEX(a), a FROM t1; @@ -10563,7 +10563,7 @@ CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß')); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) DEFAULT CONCAT('ß') + `a` varchar(30) DEFAULT concat('ß') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT HEX(a) FROM t1; @@ -10575,7 +10575,7 @@ CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß') + `a` varchar(30) CHARACTER SET utf8 DEFAULT concat('ß') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT HEX(a) FROM t1; diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 03a444e6075..7e9fff5fe9d 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -247,19 +247,19 @@ CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIM SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(6) + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(2) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT SYSDATE(2) ON UPDATE CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `event_time` timestamp(6) NOT NULL DEFAULT SYSDATE(2) ON UPDATE CURRENT_TIMESTAMP(6) + `event_time` timestamp(6) NOT NULL DEFAULT sysdate(2) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # @@ -270,8 +270,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 1, - `b` int(11) DEFAULT (a+1), - `c` int(11) DEFAULT (a+b) + `b` int(11) DEFAULT ((`a` + 1)), + `c` int(11) DEFAULT ((`a` + `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (); insert into t1 (a) values (2); @@ -301,8 +301,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` blob DEFAULT 1, - `c` blob DEFAULT "hello", - `t` text DEFAULT concat(a,b,c) + `c` blob DEFAULT 'hello', + `t` text DEFAULT concat(`a`,`b`,`c`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (2); insert into t1 (a,b) values (10,"test1"); @@ -345,11 +345,11 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT 1, `c` int(11) DEFAULT -1, - `d` int(11) DEFAULT (1+1), - `e` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `f` int(11) DEFAULT (1+1+1), - `g` int(11) NOT NULL DEFAULT (1+1+1+1), - `h` int(11) DEFAULT (2+2+2+2) + `d` int(11) DEFAULT ((1 + 1)), + `e` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `f` int(11) DEFAULT (((1 + 1) + 1)), + `g` int(11) NOT NULL DEFAULT ((((1 + 1) + 1) + 1)), + `h` int(11) DEFAULT ((((2 + 2) + 2) + 2)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -358,11 +358,11 @@ t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT 1, `c` int(11) DEFAULT -1, - `d` int(11) DEFAULT (1+1), - `e` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `f` int(11) DEFAULT (1+1+1), - `g` int(11) NOT NULL DEFAULT (1+1+1+1), - `h` int(11) DEFAULT (2+2+2+2) + `d` int(11) DEFAULT ((1 + 1)), + `e` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `f` int(11) DEFAULT (((1 + 1) + 1)), + `g` int(11) NOT NULL DEFAULT ((((1 + 1) + 1) + 1)), + `h` int(11) DEFAULT ((((2 + 2) + 2) + 2)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t2 (a) values (100); select a,b,c,d,e,f,g,h from t2; @@ -373,7 +373,7 @@ create table t1 (a int default (1----1), b int default - 1, c int default +1, e show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT (1----1), + `a` int(11) DEFAULT ((1 - -1)), `b` int(11) DEFAULT -1, `c` int(11) DEFAULT 1, `e` int(11) DEFAULT 1 @@ -542,11 +542,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; DEALLOCATE PREPARE stmt; -PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?+?))'; +prepare stmt from 'create table t1 (a int default(?+?))'; set @a=1; execute stmt using @a,@a; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?+?)' at line 1 -DEALLOCATE PREPARE stmt; +deallocate prepare stmt; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT ((1 + 1)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; # # Parenthesized Item_basic_constant # @@ -623,20 +628,20 @@ d03 DATETIME DEFAULT COALESCE(TIMESTAMP'2001-01-01 10:20:30') SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `i01` int(11) DEFAULT COALESCE(1), - `i02` int(11) DEFAULT COALESCE(0x3939), - `i03` int(11) DEFAULT COALESCE(1.0), - `i04` int(11) DEFAULT COALESCE(1e0), - `i05` int(11) DEFAULT COALESCE(NULL), - `f01` double DEFAULT COALESCE(PI()), - `s01` varchar(10) DEFAULT COALESCE(_latin1'test'), - `s02` varchar(10) DEFAULT COALESCE('test'), - `s03` varchar(10) DEFAULT COALESCE(0x40), - `s04` varchar(10) DEFAULT COALESCE(X'40'), - `s05` varchar(10) DEFAULT COALESCE(B'1000000'), - `d01` time DEFAULT COALESCE(TIME'10:20:30'), - `d02` date DEFAULT COALESCE(DATE'2001-01-01'), - `d03` datetime DEFAULT COALESCE(TIMESTAMP'2001-01-01 10:20:30') + `i01` int(11) DEFAULT coalesce(1), + `i02` int(11) DEFAULT coalesce(0x3939), + `i03` int(11) DEFAULT coalesce(1.0), + `i04` int(11) DEFAULT coalesce(1e0), + `i05` int(11) DEFAULT coalesce(NULL), + `f01` double DEFAULT coalesce(pi()), + `s01` varchar(10) DEFAULT coalesce(_latin1'test'), + `s02` varchar(10) DEFAULT coalesce('test'), + `s03` varchar(10) DEFAULT coalesce(0x40), + `s04` varchar(10) DEFAULT coalesce(X'40'), + `s05` varchar(10) DEFAULT coalesce(0x40), + `d01` time DEFAULT coalesce(TIME'10:20:30'), + `d02` date DEFAULT coalesce(DATE'2001-01-01'), + `d03` datetime DEFAULT coalesce(TIMESTAMP'2001-01-01 10:20:30') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT * FROM t1; @@ -682,7 +687,7 @@ CREATE TABLE t1 (a INT DEFAULT COALESCE(1) NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL DEFAULT COALESCE(1) + `a` int(11) NOT NULL DEFAULT coalesce(1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -707,7 +712,7 @@ CREATE TABLE t1 (a INT DEFAULT CONCAT('1') NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL DEFAULT CONCAT('1') + `a` int(11) NOT NULL DEFAULT concat('1') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -718,7 +723,7 @@ CREATE TABLE t1 (a INT DEFAULT COALESCE('1') NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL DEFAULT COALESCE('1') + `a` int(11) NOT NULL DEFAULT coalesce('1') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -767,7 +772,7 @@ Note 1265 Data truncated for column 'a' at row 1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT CONCAT('1 ') + `a` int(11) DEFAULT concat('1 ') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); Warnings: @@ -782,7 +787,7 @@ Note 1265 Data truncated for column 'a' at row 1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT COALESCE('1 ') + `a` int(11) DEFAULT coalesce('1 ') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); Warnings: @@ -830,7 +835,7 @@ CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(0x41) NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(2) NOT NULL DEFAULT CONCAT(0x41) + `a` varchar(2) NOT NULL DEFAULT concat(0x41) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -841,7 +846,7 @@ CREATE TABLE t1 (a VARCHAR(2) DEFAULT COALESCE(0x41) NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(2) NOT NULL DEFAULT COALESCE(0x41) + `a` varchar(2) NOT NULL DEFAULT coalesce(0x41) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -852,7 +857,7 @@ CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 0x41) NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(2) NOT NULL DEFAULT CONCAT(_utf8 0x41) + `a` varchar(2) NOT NULL DEFAULT concat(_utf8'A') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -863,7 +868,7 @@ CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 X'41') NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(2) NOT NULL DEFAULT CONCAT(_utf8 X'41') + `a` varchar(2) NOT NULL DEFAULT concat(_utf8'A') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); SELECT * FROM t1; @@ -901,7 +906,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT a + `b` int(11) DEFAULT `a` ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (DEFAULT, DEFAULT); @@ -921,7 +926,7 @@ CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT 1); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT DEFAULT(b), + `a` int(11) DEFAULT default(`b`), `b` int(11) DEFAULT 1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT, DEFAULT); @@ -934,7 +939,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 1, - `b` int(11) DEFAULT DEFAULT(a) + `b` int(11) DEFAULT default(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT, DEFAULT); SELECT * FROM t1; @@ -948,21 +953,21 @@ CREATE TABLE t1 (a DATETIME DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT CURRENT_TIMESTAMP + `a` datetime DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIME DEFAULT CURRENT_TIME); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` time DEFAULT CURRENT_TIME + `a` time DEFAULT curtime() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a DATE DEFAULT CURRENT_DATE); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` date DEFAULT CURRENT_DATE + `a` date DEFAULT curdate() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # @@ -972,7 +977,7 @@ CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT CURRENT_TIMESTAMP(6)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(30,6) DEFAULT CURRENT_TIMESTAMP(6) + `a` decimal(30,6) DEFAULT current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT * FROM t1; @@ -983,7 +988,7 @@ CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6))); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) + `a` decimal(30,6) DEFAULT coalesce(current_timestamp(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); Warnings: @@ -1003,7 +1008,7 @@ CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIME(6))); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(30,6) DEFAULT COALESCE(CURRENT_TIME(6)) + `a` decimal(30,6) DEFAULT coalesce(curtime(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); Warnings: @@ -1016,7 +1021,7 @@ CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_DATE)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(30,6) DEFAULT COALESCE(CURRENT_DATE) + `a` decimal(30,6) DEFAULT coalesce(curdate()) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); Warnings: @@ -1029,21 +1034,21 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT COALESCE(CURRENT_TIMESTAMP) + `a` timestamp NOT NULL DEFAULT coalesce(current_timestamp()) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a DATE DEFAULT COALESCE(CURRENT_DATE)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` date DEFAULT COALESCE(CURRENT_DATE) + `a` date DEFAULT coalesce(curdate()) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIME DEFAULT COALESCE(CURRENT_TIME)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` time DEFAULT COALESCE(CURRENT_TIME) + `a` time DEFAULT coalesce(curtime()) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 ( @@ -1053,8 +1058,8 @@ b TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) + `a` timestamp NOT NULL DEFAULT current_timestamp(), + `b` timestamp NOT NULL DEFAULT coalesce(current_timestamp(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT CURRENT_TIMESTAMP(6); @@ -1071,8 +1076,8 @@ b DECIMAL(30,0) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(30,0) DEFAULT CURRENT_TIMESTAMP(6), - `b` decimal(30,0) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) + `a` decimal(30,0) DEFAULT current_timestamp(6), + `b` decimal(30,0) DEFAULT coalesce(current_timestamp(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); Warnings: @@ -1089,7 +1094,7 @@ CREATE TABLE `t1` (`a` int(11) DEFAULT (3+3),`b` int(11) DEFAULT '1000'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT (3+3), + `a` int(11) DEFAULT ((3 + 3)), `b` int(11) DEFAULT 1000 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1),(2,2); @@ -1118,7 +1123,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` decimal(10,1) DEFAULT NULL, - `b` double DEFAULT (CAST(a AS DOUBLE)) + `b` double DEFAULT (cast(`a` as double)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (10.1, DEFAULT); SELECT * FROM t1; @@ -1130,9 +1135,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double DEFAULT EXP(a), - `c` double DEFAULT LOG(b), - `d` double DEFAULT LOG(4, b) + `b` double DEFAULT exp(`a`), + `c` double DEFAULT log(`b`), + `d` double DEFAULT log(4,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (2, DEFAULT, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -1144,8 +1149,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` double DEFAULT LOG2(a), - `c` double DEFAULT LOG10(a) + `b` double DEFAULT log2(`a`), + `c` double DEFAULT log10(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); INSERT INTO t1 VALUES (100, DEFAULT, DEFAULT); @@ -1159,8 +1164,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double DEFAULT SQRT(a), - `c` double DEFAULT POW(a,3) + `b` double DEFAULT sqrt(`a`), + `c` double DEFAULT pow(`a`,3) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -1172,9 +1177,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double DEFAULT ACOS(a), - `c` double DEFAULT ASIN(a), - `d` double DEFAULT ATAN(a) + `b` double DEFAULT acos(`a`), + `c` double DEFAULT asin(`a`), + `d` double DEFAULT atan(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1, DEFAULT, DEFAULT, DEFAULT); SELECT a, b/PI(), c/PI(), d/PI() FROM t1; @@ -1186,10 +1191,10 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double DEFAULT COS(a), - `c` double DEFAULT SIN(a), - `d` double DEFAULT TAN(a), - `e` double DEFAULT COT(a) + `b` double DEFAULT cos(`a`), + `c` double DEFAULT sin(`a`), + `d` double DEFAULT tan(`a`), + `e` double DEFAULT cot(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (PI()/3); SELECT ROUND(a,3), ROUND(b,3), ROUND(c,3), ROUND(d,3), ROUND(e,3) FROM t1; @@ -1200,7 +1205,7 @@ CREATE TABLE t1 (a DOUBLE DEFAULT RAND()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` double DEFAULT RAND() + `a` double DEFAULT rand() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT); DROP TABLE t1; @@ -1209,8 +1214,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double DEFAULT DEGREES(a), - `c` double DEFAULT RADIANS(b) + `b` double DEFAULT degrees(`a`), + `c` double DEFAULT radians(`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (PI(), DEFAULT, DEFAULT); SELECT * FROM t1; @@ -1225,7 +1230,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT INTERVAL(a, 10, 20, 30, 40) + `b` int(11) DEFAULT interval(`a`,10,20,30,40) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (34); SELECT * FROM t1; @@ -1238,7 +1243,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a DIV b) + `c` int(11) DEFAULT ((`a` DIV `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a, b) VALUES (13, 3); SELECT * FROM t1; @@ -1250,7 +1255,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT SIGN(a) + `b` int(11) DEFAULT sign(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (-10),(0), (10); SELECT * FROM t1; @@ -1264,7 +1269,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` int(11) DEFAULT FIELD(a, 'Hej', 'ej', 'Heja', 'hej', 'foo') + `b` int(11) DEFAULT field(`a`,'Hej','ej','Heja','hej','foo') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('ej'); SELECT * FROM t1; @@ -1276,7 +1281,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` int(11) DEFAULT FIND_IN_SET(a, 'Hej,ej,Heja,hej,foo') + `b` int(11) DEFAULT find_in_set(`a`,'Hej,ej,Heja,hej,foo') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('ej'); SELECT * FROM t1; @@ -1288,8 +1293,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` int(11) DEFAULT ASCII(a), - `c` int(11) DEFAULT ORD(a) + `b` int(11) DEFAULT ascii(`a`), + `c` int(11) DEFAULT ord(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'); SELECT * FROM t1; @@ -1300,7 +1305,7 @@ CREATE TABLE t1 (a TEXT DEFAULT UUID_SHORT()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text DEFAULT UUID_SHORT() + `a` text DEFAULT uuid_short() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT a>0 FROM t1; @@ -1339,7 +1344,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` date DEFAULT (DATE_ADD(a, INTERVAL b DAY)) + `c` date DEFAULT ((`a` + interval `b` day)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2001-01-01', 30, DEFAULT); SELECT * FROM t1; @@ -1352,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` time DEFAULT NULL, - `c` datetime DEFAULT ADDTIME(a, b) + `c` datetime DEFAULT addtime(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2001-01-01', '10:20:30', DEFAULT); SELECT * FROM t1; @@ -1365,7 +1370,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(32) DEFAULT NULL, `b` varchar(32) DEFAULT NULL, - `c` date DEFAULT STR_TO_DATE(a,b) + `c` date DEFAULT str_to_date(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('01,5,2013','%d,%m,%Y', DEFAULT); SELECT * FROM t1; @@ -1379,8 +1384,8 @@ CREATE TABLE t1 (a DATE DEFAULT CURDATE(), b DATE DEFAULT UTC_DATE()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` date DEFAULT CURDATE(), - `b` date DEFAULT UTC_DATE() + `a` date DEFAULT curdate(), + `b` date DEFAULT utc_date() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT * FROM t1; @@ -1393,7 +1398,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` date DEFAULT FROM_DAYS(a) + `b` date DEFAULT from_days(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (730669, DEFAULT); SELECT * FROM t1; @@ -1405,7 +1410,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` date DEFAULT LAST_DAY(a) + `b` date DEFAULT last_day(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2003-02-05', DEFAULT); SELECT * FROM t1; @@ -1418,7 +1423,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `yy` int(11) DEFAULT NULL, `yd` int(11) DEFAULT NULL, - `d` date DEFAULT MAKEDATE(yy, yd) + `d` date DEFAULT makedate(`yy`,`yd`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (2011,32,DEFAULT); SELECT * FROM t1; @@ -1432,8 +1437,8 @@ CREATE TABLE t1 (a TIME DEFAULT CURTIME(), b TIME DEFAULT UTC_TIME()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` time DEFAULT CURTIME(), - `b` time DEFAULT UTC_TIME() + `a` time DEFAULT curtime(), + `b` time DEFAULT utc_time() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT * FROM t1; @@ -1446,7 +1451,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time DEFAULT SEC_TO_TIME(a) + `b` time DEFAULT sec_to_time(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (2378, DEFAULT); SELECT * FROM t1; @@ -1459,7 +1464,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` time DEFAULT TIMEDIFF(a,b) + `c` time DEFAULT timediff(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2000:01:01 00:00:00', '2000:01:02 10:20:30', DEFAULT); SELECT * FROM t1; @@ -1473,7 +1478,7 @@ t1 CREATE TABLE `t1` ( `hh` int(11) DEFAULT NULL, `mm` int(11) DEFAULT NULL, `ss` int(11) DEFAULT NULL, - `t` time DEFAULT MAKETIME(hh,mm,ss) + `t` time DEFAULT maketime(`hh`,`mm`,`ss`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (10,20,30,DEFAULT); SELECT * FROM t1; @@ -1487,8 +1492,8 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT NOW(), b TIMESTAMP DEFAULT UTC_TIMESTAMP()) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT UTC_TIMESTAMP() + `a` timestamp NOT NULL DEFAULT current_timestamp(), + `b` timestamp NOT NULL DEFAULT utc_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT * FROM t1; @@ -1500,9 +1505,9 @@ CREATE TABLE t1 (a TIMESTAMP(6) DEFAULT SYSDATE(6), s INT, b TIMESTAMP(6) DEFAUL SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(6) NOT NULL DEFAULT SYSDATE(6), + `a` timestamp(6) NOT NULL DEFAULT sysdate(6), `s` int(11) DEFAULT NULL, - `b` timestamp(6) NOT NULL DEFAULT SYSDATE(6) + `b` timestamp(6) NOT NULL DEFAULT sysdate(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (DEFAULT, SLEEP(0.1), DEFAULT); SELECT b>a FROM t1; @@ -1515,7 +1520,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT FROM_UNIXTIME(a) + `b` timestamp NOT NULL DEFAULT from_unixtime(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1447430881, DEFAULT); SELECT * FROM t1; @@ -1527,8 +1532,8 @@ CREATE TABLE t1 (a TIMESTAMP, b TIMESTAMP DEFAULT CONVERT_TZ(a, '-10:00', '+10:0 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT CONVERT_TZ(a, '-10:00', '+10:00') + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NOT NULL DEFAULT convert_tz(`a`,'-10:00','+10:00') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); SELECT * FROM t1; @@ -1541,7 +1546,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` date DEFAULT CAST(a AS DATE) + `b` date DEFAULT cast(`a` as date) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (20010203, DEFAULT); SELECT * FROM t1; @@ -1553,7 +1558,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time DEFAULT CAST(a AS TIME) + `b` time DEFAULT cast(`a` as time) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (102030, DEFAULT); SELECT * FROM t1; @@ -1565,7 +1570,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime DEFAULT CAST(a AS DATETIME) + `b` datetime DEFAULT cast(`a` as datetime) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (20010203102030, DEFAULT); SELECT * FROM t1; @@ -1581,7 +1586,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT PERIOD_ADD(a,b) + `c` int(11) DEFAULT period_add(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (200801, 2); SELECT * FROM t1; @@ -1594,7 +1599,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT PERIOD_DIFF(a,b) + `c` int(11) DEFAULT period_diff(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (200802, 200703); SELECT * FROM t1; @@ -1606,7 +1611,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT TO_DAYS(a) + `b` int(11) DEFAULT to_days(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (950501); SELECT * FROM t1; @@ -1618,7 +1623,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT TO_DAYS(a) + `b` int(11) DEFAULT to_days(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2007-10-07'); SELECT * FROM t1; @@ -1630,7 +1635,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) DEFAULT TO_SECONDS(a) + `b` bigint(20) DEFAULT to_seconds(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (950501); SELECT * FROM t1; @@ -1642,7 +1647,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` bigint(20) DEFAULT TO_SECONDS(a) + `b` bigint(20) DEFAULT to_seconds(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-11-29'); SELECT * FROM t1; @@ -1654,7 +1659,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) DEFAULT TO_SECONDS(a) + `b` bigint(20) DEFAULT to_seconds(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-11-29 13:43:32'); SELECT * FROM t1; @@ -1666,7 +1671,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` bigint(20) DEFAULT DAYOFMONTH(a) + `b` bigint(20) DEFAULT dayofmonth(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2007-02-03'); SELECT * FROM t1; @@ -1678,7 +1683,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` bigint(20) DEFAULT DAYOFWEEK(a) + `b` bigint(20) DEFAULT dayofweek(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2007-02-03'); SELECT * FROM t1; @@ -1690,7 +1695,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` bigint(20) DEFAULT DAYOFYEAR(a) + `b` bigint(20) DEFAULT dayofyear(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2007-02-03'); SELECT * FROM t1; @@ -1702,7 +1707,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` int(11) DEFAULT HOUR(a) + `b` int(11) DEFAULT hour(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('10:05:03'); SELECT * FROM t1; @@ -1714,7 +1719,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` int(11) DEFAULT MINUTE(a) + `b` int(11) DEFAULT minute(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('10:05:03'); SELECT * FROM t1; @@ -1726,7 +1731,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` int(11) DEFAULT SECOND(a) + `b` int(11) DEFAULT second(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('10:05:03'); SELECT * FROM t1; @@ -1738,7 +1743,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime(6) DEFAULT NULL, - `b` int(11) DEFAULT MICROSECOND(a) + `b` int(11) DEFAULT microsecond(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-12-31 23:59:59.000010'); SELECT * FROM t1; @@ -1750,7 +1755,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT YEAR(a) + `b` int(11) DEFAULT year(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('1987-01-01'); SELECT * FROM t1; @@ -1762,7 +1767,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT MONTH(a) + `b` int(11) DEFAULT month(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('1987-01-01'); SELECT * FROM t1; @@ -1774,7 +1779,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT WEEK(a) + `b` int(11) DEFAULT week(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('1987-02-01'); SELECT * FROM t1; @@ -1786,7 +1791,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT YEARWEEK(a) + `b` int(11) DEFAULT yearweek(`a`,0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2000-01-01'); SELECT * FROM t1; @@ -1798,7 +1803,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT QUARTER(a) + `b` int(11) DEFAULT quarter(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2008-04-01'); SELECT * FROM t1; @@ -1810,7 +1815,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` int(11) DEFAULT EXTRACT(YEAR FROM a) + `b` int(11) DEFAULT extract(year from `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-07-02'); SELECT * FROM t1; @@ -1822,7 +1827,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) DEFAULT EXTRACT(YEAR_MONTH FROM a) + `b` int(11) DEFAULT extract(year_month from `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); SELECT * FROM t1; @@ -1834,7 +1839,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) DEFAULT EXTRACT(DAY_MINUTE FROM a) + `b` int(11) DEFAULT extract(day_minute from `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); SELECT * FROM t1; @@ -1846,7 +1851,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime(6) DEFAULT NULL, - `b` int(11) DEFAULT EXTRACT(MICROSECOND FROM a) + `b` int(11) DEFAULT extract(microsecond from `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03.000123'); SELECT * FROM t1; @@ -1859,7 +1864,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` date DEFAULT NULL, - `c` int(11) DEFAULT TIMESTAMPDIFF(MONTH,a,b) + `c` int(11) DEFAULT timestampdiff(MONTH,`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01'); SELECT * FROM t1; @@ -1872,7 +1877,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` date DEFAULT NULL, - `c` int(11) DEFAULT TIMESTAMPDIFF(YEAR,a,b) + `c` int(11) DEFAULT timestampdiff(YEAR,`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES ('2002-05-01','2001-01-01'); SELECT * FROM t1; @@ -1885,7 +1890,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) DEFAULT TIMESTAMPDIFF(MINUTE,a,b) + `c` int(11) DEFAULT timestampdiff(MINUTE,`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01 12:05:55'); SELECT * FROM t1; @@ -1901,7 +1906,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT COALESCE(a,b) + `c` int(11) DEFAULT coalesce(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (NULL, 1, DEFAULT); SELECT * FROM t1; @@ -1914,7 +1919,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT IFNULL(a,b) + `c` int(11) DEFAULT ifnull(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (NULL, 2, DEFAULT); INSERT INTO t1 VALUES (1, 2, DEFAULT); @@ -1929,7 +1934,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT NULLIF(a,b) + `c` int(11) DEFAULT nullif(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1, 1, DEFAULT); INSERT INTO t1 VALUES (1, 2, DEFAULT); @@ -1944,7 +1949,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT IF(a,b,2) + `c` int(11) DEFAULT if(`a`,`b`,2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (0, 1, DEFAULT); INSERT INTO t1 VALUES (1, 1, DEFAULT); @@ -1959,7 +1964,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (CASE WHEN a THEN b ELSE 2 END) + `c` int(11) DEFAULT ((case when `a` then `b` else 2 end)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (0, 1, DEFAULT); INSERT INTO t1 VALUES (1, 1, DEFAULT); @@ -1973,13 +1978,13 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (-a) + `b` int(11) DEFAULT (-(`a`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (-a) + `b` int(11) DEFAULT (-(`a`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (10, DEFAULT); SELECT * FROM t1; @@ -1991,7 +1996,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ABS(a) + `b` int(11) DEFAULT abs(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (-10, DEFAULT); SELECT * FROM t1; @@ -2003,9 +2008,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) DEFAULT CEILING(a), - `c` int(11) DEFAULT FLOOR(a), - `d` int(11) DEFAULT ROUND(a) + `b` int(11) DEFAULT ceiling(`a`), + `c` int(11) DEFAULT floor(`a`), + `d` int(11) DEFAULT round(`a`,0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1.5, DEFAULT, DEFAULT, DEFAULT); INSERT INTO t1 VALUES (-1.5, DEFAULT, DEFAULT, DEFAULT); @@ -2020,8 +2025,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a+b), - `d` int(11) DEFAULT (a-b) + `c` int(11) DEFAULT ((`a` + `b`)), + `d` int(11) DEFAULT ((`a` - `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (2, 1, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -2034,18 +2039,18 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a*b), - `d` int(11) DEFAULT (a/b), - `e` int(11) DEFAULT (a MOD b) + `c` int(11) DEFAULT ((`a` * `b`)), + `d` int(11) DEFAULT ((`a` / `b`)), + `e` int(11) DEFAULT ((`a` % `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a*b), - `d` int(11) DEFAULT (a/b), - `e` int(11) DEFAULT (a MOD b) + `c` int(11) DEFAULT ((`a` * `b`)), + `d` int(11) DEFAULT ((`a` / `b`)), + `e` int(11) DEFAULT ((`a` % `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (7, 3, DEFAULT, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -2058,7 +2063,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) DEFAULT UNIX_TIMESTAMP(a) + `b` int(11) DEFAULT unix_timestamp(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); SELECT * FROM t1; @@ -2071,7 +2076,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` int(11) DEFAULT TIME_TO_SEC(a) + `b` int(11) DEFAULT time_to_sec(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('22:23:00', DEFAULT); SELECT * FROM t1; @@ -2084,8 +2089,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT LEAST(a,b), - `d` int(11) DEFAULT GREATEST(a,b) + `c` int(11) DEFAULT least(`a`,`b`), + `d` int(11) DEFAULT greatest(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (0, 1, DEFAULT, DEFAULT); INSERT INTO t1 VALUES (1, 1, DEFAULT, DEFAULT); @@ -2100,7 +2105,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT LAST_VALUE(a,b) + `c` int(11) DEFAULT last_value(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (1, 2, DEFAULT); SELECT * FROM t1; @@ -2115,7 +2120,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` decimal(10,6) DEFAULT (CAST(a AS DECIMAL(10,1))) + `b` decimal(10,6) DEFAULT (cast(`a` as decimal(10,1))) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('123.456'); SELECT * FROM t1; @@ -2129,8 +2134,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` decimal(10,3) DEFAULT NULL, - `b` varchar(10) DEFAULT (CAST(a AS CHAR(10))), - `c` varchar(10) DEFAULT (CAST(a AS CHAR(4))) + `b` varchar(10) DEFAULT (cast(`a` as char(10) charset latin1)), + `c` varchar(10) DEFAULT (cast(`a` as char(4) charset latin1)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (123.456); Warnings: @@ -2144,7 +2149,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(10) unsigned DEFAULT (CAST(a AS UNSIGNED)) + `b` int(10) unsigned DEFAULT (cast(`a` as unsigned)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (-1); Warnings: @@ -2159,7 +2164,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned DEFAULT NULL, - `b` bigint(20) DEFAULT (CAST(a AS SIGNED)) + `b` bigint(20) DEFAULT (cast(`a` as signed)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (0xFFFFFFFFFFFFFFFF); SELECT * FROM t1; @@ -2176,9 +2181,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT a, - `c` varchar(10) CHARACTER SET utf8 DEFAULT CONVERT(a USING utf8), - `d` varbinary(10) DEFAULT (BINARY(a)) + `b` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT `a`, + `c` varchar(10) CHARACTER SET utf8 DEFAULT convert(`a` using utf8), + `d` varbinary(10) DEFAULT (cast(`a` as char charset binary)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'); SELECT * FROM t1; @@ -2193,7 +2198,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT BIT_COUNT(a) + `b` int(11) DEFAULT bit_count(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (7); SELECT * FROM t1; @@ -2206,7 +2211,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a|b) + `c` int(11) DEFAULT ((`a` | `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (1,2); SELECT * FROM t1; @@ -2219,7 +2224,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a&b) + `c` int(11) DEFAULT ((`a` & `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,4); SELECT * FROM t1; @@ -2232,7 +2237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a^b) + `c` int(11) DEFAULT ((`a` ^ `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (11,3); SELECT * FROM t1; @@ -2245,7 +2250,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a&~b) + `c` int(11) DEFAULT ((`a` & ~(`b`))) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,1); SELECT * FROM t1; @@ -2258,8 +2263,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT (a<>b) + `c` int(11) DEFAULT ((`a` << `b`)), + `d` int(11) DEFAULT ((`a` >> `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,1); SELECT * FROM t1; @@ -2274,7 +2279,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) DEFAULT REVERSE(a) + `b` varchar(20) DEFAULT reverse(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('abcd'); SELECT * FROM t1; @@ -2286,8 +2291,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT UPPER(a), - `c` varchar(10) DEFAULT LOWER(a) + `b` varchar(10) DEFAULT ucase(`a`), + `c` varchar(10) DEFAULT lcase(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('ABcd'); SELECT * FROM t1; @@ -2299,9 +2304,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT LEFT(a,1), - `c` varchar(10) DEFAULT RIGHT(a,1), - `d` varchar(10) DEFAULT SUBSTR(a,2,2) + `b` varchar(10) DEFAULT left(`a`,1), + `c` varchar(10) DEFAULT right(`a`,1), + `d` varchar(10) DEFAULT substr(`a`,2,2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('abcd'); SELECT * FROM t1; @@ -2313,7 +2318,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(20) DEFAULT NULL, - `b` varchar(20) DEFAULT SUBSTRING_INDEX(a,'.',2) + `b` varchar(20) DEFAULT substring_index(`a`,'.',2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('www.mariadb.org'); SELECT * FROM t1; @@ -2326,7 +2331,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) DEFAULT CONCAT(a,b) + `c` varchar(20) DEFAULT concat(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES ('a','b'); SELECT * FROM t1; @@ -2339,7 +2344,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) DEFAULT CONCAT_WS(',',a,b) + `c` varchar(20) DEFAULT concat_ws(',',`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES ('a','b'); SELECT * FROM t1; @@ -2351,7 +2356,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT REPLACE(a,'a','A') + `b` varchar(10) DEFAULT replace(`a`,'a','A') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('abc'); SELECT * FROM t1; @@ -2363,7 +2368,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT REGEXP_REPLACE(a,'[0-9]','.') + `b` varchar(10) DEFAULT regexp_replace(`a`,'[0-9]','.') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a1b2c'); SELECT * FROM t1; @@ -2375,7 +2380,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT REGEXP_SUBSTR(a,'[0-9]+') + `b` varchar(10) DEFAULT regexp_substr(`a`,'[0-9]+') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('ab12cd'); SELECT * FROM t1; @@ -2387,7 +2392,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(20) DEFAULT NULL, - `b` varchar(20) DEFAULT SOUNDEX(a) + `b` varchar(20) DEFAULT soundex(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('tester'); SELECT * FROM t1; @@ -2399,7 +2404,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(20) DEFAULT NULL, - `b` varchar(20) DEFAULT QUOTE(a) + `b` varchar(20) DEFAULT quote(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a\'b'); SELECT * FROM t1; @@ -2411,8 +2416,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT LPAD(a,10,'.'), - `c` varchar(10) DEFAULT RPAD(a,10,'.') + `b` varchar(10) DEFAULT lpad(`a`,10,'.'), + `c` varchar(10) DEFAULT rpad(`a`,10,'.') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('ab'); SELECT * FROM t1; @@ -2424,8 +2429,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT LTRIM(a), - `c` varchar(10) DEFAULT RTRIM(a) + `b` varchar(10) DEFAULT ltrim(`a`), + `c` varchar(10) DEFAULT rtrim(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (' ab '); SELECT a, HEX(b), HEX(c) FROM t1; @@ -2437,7 +2442,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT TRIM(BOTH 'a' FROM a) + `b` varchar(10) DEFAULT trim(both 'a' from `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('abba'); SELECT a, b FROM t1; @@ -2449,7 +2454,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) DEFAULT SPACE(a) + `b` varchar(10) DEFAULT space(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (3); SELECT a, HEX(b) FROM t1; @@ -2462,7 +2467,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) DEFAULT REPEAT(b,a) + `c` varchar(10) DEFAULT repeat(`b`,`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (3,'x'); SELECT a, b, c FROM t1; @@ -2477,7 +2482,7 @@ t1 CREATE TABLE `t1` ( `pos` int(11) DEFAULT NULL, `len` int(11) DEFAULT NULL, `newstr` varchar(10) DEFAULT NULL, - `result` varchar(10) DEFAULT INSERT(str,pos,len,newstr) + `result` varchar(10) DEFAULT insert(`str`,`pos`,`len`,`newstr`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (str,pos,len,newstr) VALUES ('Quadratic', 3, 4, 'What'); SELECT * FROM t1; @@ -2489,7 +2494,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) DEFAULT NULL, - `res` varchar(10) DEFAULT ELT(n,'ej', 'Heja', 'hej', 'foo') + `res` varchar(10) DEFAULT elt(`n`,'ej','Heja','hej','foo') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (n) VALUES (1); SELECT * FROM t1; @@ -2501,7 +2506,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `bits` int(11) DEFAULT NULL, - `res` varchar(10) DEFAULT MAKE_SET(bits,'a','b','c','d') + `res` varchar(10) DEFAULT make_set(`bits`,'a','b','c','d') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (bits) VALUES (1|4); SELECT * FROM t1; @@ -2513,7 +2518,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) DEFAULT CHAR(a) + `b` varchar(10) DEFAULT char(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (77); SELECT * FROM t1; @@ -2525,7 +2530,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) DEFAULT CONV(a,10,16) + `b` varchar(10) DEFAULT conv(`a`,10,16) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (64); SELECT * FROM t1; @@ -2538,7 +2543,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varchar(30) DEFAULT FORMAT(a,b) + `c` varchar(30) DEFAULT format(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (10000,3); SELECT * FROM t1; @@ -2552,7 +2557,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, `l` varchar(10) DEFAULT NULL, - `c` varchar(30) DEFAULT FORMAT(a,b,l) + `c` varchar(30) DEFAULT format(`a`,`b`,`l`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b,l) VALUES (10000,2,'no_NO'),(10000,2,'ru_RU'),(10000,2,'ar_BH'); SELECT * FROM t1; @@ -2566,7 +2571,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) DEFAULT GET_FORMAT(DATE,a) + `b` varchar(20) DEFAULT get_format(DATE, `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('EUR'),('USA'),('JIS'),('ISO'),('INTERNAL'); SELECT * FROM t1; @@ -2593,7 +2598,7 @@ t1 CREATE TABLE `t1` ( `v_off` varchar(10) DEFAULT NULL, `v_separator` varchar(10) DEFAULT NULL, `number_of_bits` int(11) DEFAULT NULL, - `x` varchar(30) DEFAULT EXPORT_SET(bits, v_on, v_off, v_separator, number_of_bits) + `x` varchar(30) DEFAULT export_set(`bits`,`v_on`,`v_off`,`v_separator`,`number_of_bits`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (0x50006,'Y','N','',64,DEFAULT); Warnings: @@ -2612,7 +2617,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (NOT a) + `b` int(11) DEFAULT ((`a` = 0)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2627,7 +2632,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `x` int(11) DEFAULT (a XOR b) + `x` int(11) DEFAULT ((`a` xor `b`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (0,0),(0,1),(1,0),(1,1); SELECT * FROM t1; @@ -2642,8 +2647,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (a IS TRUE), - `c` int(11) DEFAULT (a IS NOT TRUE) + `b` int(11) DEFAULT ((`a` is true)), + `c` int(11) DEFAULT ((`a` is not true)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2657,8 +2662,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (a IS FALSE), - `c` int(11) DEFAULT (a IS NOT FALSE) + `b` int(11) DEFAULT ((`a` is false)), + `c` int(11) DEFAULT ((`a` is not false)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2672,8 +2677,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (a IS NULL), - `c` int(11) DEFAULT (a IS NOT NULL) + `b` int(11) DEFAULT (isnull(`a`)), + `c` int(11) DEFAULT ((`a` is not null)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2687,8 +2692,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (a IS UNKNOWN), - `c` int(11) DEFAULT (a IS NOT UNKNOWN) + `b` int(11) DEFAULT (isnull(`a`)), + `c` int(11) DEFAULT ((`a` is not null)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2706,13 +2711,13 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `eq` int(11) DEFAULT (a=0), - `equal` int(11) DEFAULT (a<=>0), - `ne` int(11) DEFAULT (a<>0), - `lt` int(11) DEFAULT (a<0), - `le` int(11) DEFAULT (a<=0), - `gt` int(11) DEFAULT (a>0), - `ge` int(11) DEFAULT (a>=0) + `eq` int(11) DEFAULT ((`a` = 0)), + `equal` int(11) DEFAULT ((`a` <=> 0)), + `ne` int(11) DEFAULT ((`a` <> 0)), + `lt` int(11) DEFAULT ((`a` < 0)), + `le` int(11) DEFAULT ((`a` <= 0)), + `gt` int(11) DEFAULT ((`a` > 0)), + `ge` int(11) DEFAULT ((`a` >= 0)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(-1),(0),(1); SELECT * FROM t1; @@ -2727,7 +2732,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a LIKE 'a%') + `b` int(11) DEFAULT ((`a` like 'a%')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); SELECT * FROM t1; @@ -2741,7 +2746,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a RLIKE 'a$') + `b` int(11) DEFAULT ((`a` regexp 'a$')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); SELECT * FROM t1; @@ -2755,7 +2760,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a IN ('aaa','bbb')) + `b` int(11) DEFAULT ((`a` in ('aaa','bbb'))) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2770,7 +2775,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a NOT IN ('aaa','bbb')) + `b` int(11) DEFAULT ((`a` not in ('aaa','bbb'))) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2785,7 +2790,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a BETWEEN 'aaa' AND 'bbb') + `b` int(11) DEFAULT ((`a` between 'aaa' and 'bbb')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2800,7 +2805,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT (a NOT BETWEEN 'aaa' AND 'bbb') + `b` int(11) DEFAULT ((`a` not between 'aaa' and 'bbb')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2814,7 +2819,7 @@ CREATE TABLE t1 (a TEXT DEFAULT UUID()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text DEFAULT UUID() + `a` text DEFAULT uuid() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); SELECT LENGTH(a)>0 FROM t1; @@ -2829,7 +2834,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT STRCMP(a,'b') + `b` int(11) DEFAULT strcmp(`a`,'b') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('A'),('a'),('B'),('b'),('C'),('c'); SELECT * FROM t1; @@ -2846,9 +2851,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT LENGTH(a), - `c` int(11) DEFAULT CHAR_LENGTH(a), - `d` int(11) DEFAULT BIT_LENGTH(a) + `b` int(11) DEFAULT length(`a`), + `c` int(11) DEFAULT char_length(`a`), + `d` int(11) DEFAULT bit_length(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'),('aa'),('aaa'); SELECT * FROM t1; @@ -2862,7 +2867,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT LOCATE('a',a) + `b` int(11) DEFAULT locate('a',`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); SELECT * FROM t1; @@ -2876,7 +2881,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT REGEXP_INSTR(a, 'a') + `b` int(11) DEFAULT regexp_instr(`a`,'a') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); SELECT * FROM t1; @@ -2898,7 +2903,7 @@ CREATE TABLE t1 (a INT DEFAULT CONNECTION_ID()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT CONNECTION_ID() + `a` int(11) DEFAULT connection_id() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); SELECT a>0 FROM t1; @@ -2910,8 +2915,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT COERCIBILITY(a), - `c` int(11) DEFAULT COERCIBILITY(b) + `b` int(11) DEFAULT coercibility(`a`), + `c` int(11) DEFAULT coercibility(`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('test'); SELECT * FROM t1; @@ -2930,8 +2935,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) DEFAULT CHARSET(a), - `c` varchar(20) DEFAULT COLLATION(a) + `b` varchar(20) DEFAULT charset(`a`), + `c` varchar(20) DEFAULT collation(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('test'); SELECT * FROM t1; @@ -2946,8 +2951,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) DEFAULT CRC32(a), - `c` text DEFAULT MD5(a) + `b` bigint(20) DEFAULT crc32(`a`), + `c` text DEFAULT md5(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('a'); SELECT * FROM t1; @@ -2959,8 +2964,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` text DEFAULT TO_BASE64(a), - `c` text DEFAULT FROM_BASE64(b) + `b` text DEFAULT to_base64(`a`), + `c` text DEFAULT from_base64(`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('aaaabbbb'); SELECT * FROM t1; @@ -2972,8 +2977,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` text DEFAULT HEX(a), - `c` text DEFAULT UNHEX(b) + `b` text DEFAULT hex(`a`), + `c` text DEFAULT unhex(`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('aaaabbbb'); SELECT * FROM t1; @@ -2985,8 +2990,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` text DEFAULT ENCODE(a,'test'), - `c` text DEFAULT DECODE(b,'test') + `b` text DEFAULT encode(`a`,'test'), + `c` text DEFAULT decode(`b`,'test') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('aaaabbbb'); SELECT a, HEX(b), c FROM t1; @@ -2998,7 +3003,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` text DEFAULT PASSWORD(a) + `b` text DEFAULT password(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('notagoodpwd'); SELECT * FROM t1; @@ -3014,8 +3019,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` blob DEFAULT AES_ENCRYPT(a, 'passwd'), - `c` text DEFAULT AES_DECRYPT(b, 'passwd') + `b` blob DEFAULT aes_encrypt(`a`,'passwd'), + `c` text DEFAULT aes_decrypt(`b`,'passwd') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('test'); SELECT c FROM t1; @@ -3047,7 +3052,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 1, - `b` int(11) DEFAULT (1+1), + `b` int(11) DEFAULT ((1 + 1)), `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 alter a set default (2+3), alter b set default 4, @@ -3057,9 +3062,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT (2+3), + `a` int(11) DEFAULT ((2 + 3)), `b` int(11) DEFAULT 4, - `c` int(11) DEFAULT (-a) + `c` int(11) DEFAULT (-(`a`)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int default 5 check (a>10), b int default (5+5), c int as (a+b)); @@ -3068,8 +3073,8 @@ create table t3 as select max(a), max(b), max(c) from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT 5 CHECK (a>10), - `b` int(11) DEFAULT (5+5), + `a` int(11) DEFAULT 5 CHECK ((`a` > 10)), + `b` int(11) DEFAULT ((5 + 5)), `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t3; @@ -3230,3 +3235,35 @@ EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE ?+a<=>?+a' USING DEFA ERROR HY000: Default/ignore value is not supported for such parameter usage DROP TABLE t1; # end of 10.2 test +set sql_mode=ansi_quotes; +create table t1 (a int, b int default (a+1)); +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" int(11) DEFAULT NULL, + "b" int(11) DEFAULT (("a" + 1)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 (a) values (10); +set sql_mode=''; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT ((`a` + 1)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 (a) values (20); +flush tables; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT ((`a` + 1)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 (a) values (30); +select * from t1; +a b +10 11 +20 21 +30 31 +drop table t1; +set sql_mode=default; diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 27547ef9a72..2841f27d45d 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1908,16 +1908,16 @@ Table Create Table t1 CREATE TABLE `t1` ( `name` varchar(10) DEFAULT NULL, `value` varchar(10) DEFAULT NULL, - `dyncol0` blob DEFAULT COLUMN_CREATE(name, value), - `value_dyncol0_name0` varchar(10) DEFAULT (COLUMN_GET(dyncol0, 'name0' AS CHAR)), - `dyncol1` blob DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'), - `value_dyncol1_name1` varchar(10) DEFAULT (COLUMN_GET(dyncol1, 'name1' AS CHAR)), - `dyncol2` blob DEFAULT COLUMN_DELETE(dyncol1, 'name1'), - `dyncol2_exists_name0` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name0'), - `dyncol2_exists_name1` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name1'), - `dyncol2_check` int(11) DEFAULT COLUMN_CHECK(dyncol2), - `dyncol1_list` text DEFAULT COLUMN_LIST(dyncol1), - `dyncol1_json` text DEFAULT COLUMN_JSON(dyncol1) + `dyncol0` blob DEFAULT column_create(`name`,`value`), + `value_dyncol0_name0` varchar(10) DEFAULT (column_get(`dyncol0`,'name0' as char charset utf8)), + `dyncol1` blob DEFAULT column_add(`dyncol0`,'name1','value1'), + `value_dyncol1_name1` varchar(10) DEFAULT (column_get(`dyncol1`,'name1' as char charset utf8)), + `dyncol2` blob DEFAULT column_add(`dyncol1`,'name1',NULL AS int), + `dyncol2_exists_name0` int(11) DEFAULT column_exists(`dyncol2`,'name0'), + `dyncol2_exists_name1` int(11) DEFAULT column_exists(`dyncol2`,'name1'), + `dyncol2_check` int(11) DEFAULT column_check(`dyncol2`), + `dyncol1_list` text DEFAULT column_list(`dyncol1`), + `dyncol1_json` text DEFAULT column_json(`dyncol1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (name,value) VALUES ('name0', 'value0'); SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1; diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 9ef7f13487f..b436a3c72b1 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -178,9 +178,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` text DEFAULT NULL, - `b` blob DEFAULT COMPRESS(a), - `bl` int(11) DEFAULT UNCOMPRESSED_LENGTH(b), - `a1` text DEFAULT UNCOMPRESS(b) + `b` blob DEFAULT compress(`a`), + `bl` int(11) DEFAULT uncompressed_length(`b`), + `a1` text DEFAULT uncompress(`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (REPEAT('a',100)); SELECT bl, a1 FROM t1; diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 85c1cb2ce94..389e92641b3 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -112,7 +112,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) DEFAULT ENCRYPT(a,123) + `b` varchar(30) DEFAULT encrypt(`a`,123) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('hello'); SELECT * FROM t1; diff --git a/mysql-test/r/func_digest.result b/mysql-test/r/func_digest.result index 31a32da72ed..43ddcb2ee77 100644 --- a/mysql-test/r/func_digest.result +++ b/mysql-test/r/func_digest.result @@ -1441,8 +1441,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` text DEFAULT SHA(a), - `c` text DEFAULT SHA2(a,224) + `b` text DEFAULT sha(`a`), + `c` text DEFAULT sha2(`a`,224) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('abc'); SELECT * FROM t1; diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index 34dff598452..e72e1ff05bb 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -223,8 +223,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` blob DEFAULT DES_ENCRYPT(a, 'passwd'), - `c` text DEFAULT DES_DECRYPT(b, 'passwd') + `b` blob DEFAULT des_encrypt(`a`,'passwd'), + `c` text DEFAULT des_decrypt(`b`,'passwd') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('test'); SELECT c FROM t1; diff --git a/mysql-test/r/func_hybrid_type.result b/mysql-test/r/func_hybrid_type.result index ea9c203e3f6..746bc55ef85 100644 --- a/mysql-test/r/func_hybrid_type.result +++ b/mysql-test/r/func_hybrid_type.result @@ -2397,7 +2397,7 @@ FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `___________a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `___________a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `case_______a` timestamp NULL DEFAULT NULL, `case_____a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `coalesce___a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index f6a04c6fb79..663fc2583e7 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -1457,10 +1457,10 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(30) DEFAULT NULL, - `b` bigint(20) DEFAULT INET_ATON(a), - `a1` varchar(30) DEFAULT INET_NTOA(b), - `c` int(11) DEFAULT IS_IPV4(a), - `d` int(11) DEFAULT IS_IPV6(a) + `b` bigint(20) DEFAULT inet_aton(`a`), + `a1` varchar(30) DEFAULT inet_ntoa(`b`), + `c` int(11) DEFAULT is_ipv4(`a`), + `d` int(11) DEFAULT is_ipv6(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx'); SELECT * FROM t1; @@ -1480,10 +1480,10 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `str` varchar(128) DEFAULT NULL, - `addr` varbinary(16) DEFAULT INET6_ATON(str), - `str1` varchar(128) DEFAULT INET6_NTOA(addr), - `b` int(11) DEFAULT IS_IPV4_COMPAT(addr), - `c` int(11) DEFAULT IS_IPV4_MAPPED(addr) + `addr` varbinary(16) DEFAULT inet6_aton(`str`), + `str1` varchar(128) DEFAULT inet6_ntoa(`addr`), + `b` int(11) DEFAULT is_ipv4_compat(`addr`), + `c` int(11) DEFAULT is_ipv4_mapped(`addr`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9'); SELECT str, str1, b,c FROM t1; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f75ec17c702..6ca89082a45 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -874,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(current_timestamp())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP='2007-08-01 12:22:49'; CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ('2007-08-01 12:22:59'); @@ -1976,7 +1976,7 @@ select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010') microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010') 123456 10 select now(258); -ERROR 42000: Too big precision 258 specified for 'now'. Maximum is 6 +ERROR 42000: Too big precision 258 specified for 'current_timestamp'. Maximum is 6 SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12')); 1 SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12')); diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result index 7101dc8f121..93119dcb309 100644 --- a/mysql-test/r/func_time_hires.result +++ b/mysql-test/r/func_time_hires.result @@ -24,7 +24,7 @@ select time_to_sec(sec_to_time(11111)), time_to_sec(sec_to_time(11111.22222)); time_to_sec(sec_to_time(11111)) 11111 time_to_sec(sec_to_time(11111.22222)) 11111.22222 select current_timestamp(7); -ERROR 42000: Too big precision 7 specified for 'now'. Maximum is 6 +ERROR 42000: Too big precision 7 specified for 'current_timestamp'. Maximum is 6 select curtime(7); ERROR 42000: Too big precision 7 specified for 'curtime'. Maximum is 6 drop table if exists t1; diff --git a/mysql-test/r/function_defaults.result b/mysql-test/r/function_defaults.result index 987c505f1fb..4b8694ec838 100644 --- a/mysql-test/r/function_defaults.result +++ b/mysql-test/r/function_defaults.result @@ -483,7 +483,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c TIMESTAMP NULL ); @@ -491,7 +491,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -501,7 +501,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -527,7 +527,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE N SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -536,7 +536,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -546,7 +546,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp NULL DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -554,7 +554,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -563,7 +563,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -573,7 +573,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp NULL DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -586,7 +586,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # @@ -650,7 +650,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -659,7 +659,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -668,7 +668,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -695,7 +695,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -704,7 +704,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime DEFAULT CURRENT_TIMESTAMP + `g` datetime DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -713,7 +713,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `h` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -753,25 +753,25 @@ SELECT * FROM t1; SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `k` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `l` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `k` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `l` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `m` timestamp NOT NULL DEFAULT current_timestamp(), + `n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `o` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `p` timestamp NULL DEFAULT NULL, - `q` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `r` datetime DEFAULT CURRENT_TIMESTAMP, - `s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `q` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `r` datetime DEFAULT current_timestamp(), + `s` datetime DEFAULT NULL ON UPDATE current_timestamp(), `t` datetime DEFAULT NULL, `u` datetime DEFAULT '1986-09-27 03:00:00', - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NOT NULL DEFAULT current_timestamp(), + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `e` timestamp NULL DEFAULT NULL, - `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `g` datetime DEFAULT CURRENT_TIMESTAMP, - `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `g` datetime DEFAULT current_timestamp(), + `h` datetime DEFAULT NULL ON UPDATE current_timestamp(), `i` datetime DEFAULT NULL, `j` datetime DEFAULT '1986-09-27 03:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -792,7 +792,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -801,7 +801,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime DEFAULT CURRENT_TIMESTAMP + `b` datetime DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -810,7 +810,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `c` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -847,7 +847,7 @@ CREATE TABLE t2 ( b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRE SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SET TIMESTAMP = 2000.876543; @@ -1224,12 +1224,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NOT NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1276,12 +1276,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1343,12 +1343,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NOT NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1381,12 +1381,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1429,7 +1429,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 ( a ) VALUES ( 1 ); SELECT * FROM t1; @@ -2029,7 +2029,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), c TIMESTAMP(6) NULL ); @@ -2037,7 +2037,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -2047,7 +2047,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2073,7 +2073,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDAT SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -2082,7 +2082,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2092,7 +2092,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp(6) NULL DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2100,7 +2100,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT NOW(6) ON UPDATE CURRENT_TIMES SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -2109,7 +2109,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2119,7 +2119,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp(6) NULL DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2132,7 +2132,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # @@ -2196,7 +2196,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2205,7 +2205,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2214,7 +2214,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6) + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2241,7 +2241,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -2250,7 +2250,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) + `g` datetime(6) DEFAULT current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -2259,7 +2259,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) + `h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -2299,25 +2299,25 @@ SELECT * FROM t1; SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `k` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `l` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `m` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `k` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `l` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `m` timestamp(6) NOT NULL DEFAULT current_timestamp(6), + `n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `o` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `p` timestamp(6) NULL DEFAULT NULL, - `q` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `r` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), - `s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), + `q` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `r` datetime(6) DEFAULT current_timestamp(6), + `s` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6), `t` datetime(6) DEFAULT NULL, `u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765', - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6), + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `e` timestamp(6) NULL DEFAULT NULL, - `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), - `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), + `f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `g` datetime(6) DEFAULT current_timestamp(6), + `h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6), `i` datetime(6) DEFAULT NULL, `j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -2338,7 +2338,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2347,7 +2347,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) + `b` datetime(6) DEFAULT current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2356,7 +2356,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) + `c` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2393,7 +2393,7 @@ CREATE TABLE t2 ( b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SET TIMESTAMP = 2000.876543; @@ -2770,12 +2770,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `f` timestamp(6) NOT NULL DEFAULT current_timestamp(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2822,12 +2822,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2889,12 +2889,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `f` timestamp(6) NOT NULL DEFAULT current_timestamp(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2927,12 +2927,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2975,7 +2975,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 ( a ) VALUES ( 1 ); SELECT * FROM t1; diff --git a/mysql-test/r/function_defaults_innodb.result b/mysql-test/r/function_defaults_innodb.result index b539f70a3cb..fe97870ab88 100644 --- a/mysql-test/r/function_defaults_innodb.result +++ b/mysql-test/r/function_defaults_innodb.result @@ -484,7 +484,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c TIMESTAMP NULL ); @@ -492,7 +492,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -502,7 +502,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -528,7 +528,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE N SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -537,7 +537,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -547,7 +547,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp NULL DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -555,7 +555,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL, `c` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -564,7 +564,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -574,7 +574,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp NULL DEFAULT NULL, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -587,7 +587,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; # @@ -651,7 +651,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -660,7 +660,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -669,7 +669,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -696,7 +696,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -705,7 +705,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime DEFAULT CURRENT_TIMESTAMP + `g` datetime DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -714,7 +714,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `h` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -754,25 +754,25 @@ SELECT * FROM t1; SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `k` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `l` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `k` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `l` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `m` timestamp NOT NULL DEFAULT current_timestamp(), + `n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `o` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `p` timestamp NULL DEFAULT NULL, - `q` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `r` datetime DEFAULT CURRENT_TIMESTAMP, - `s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `q` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `r` datetime DEFAULT current_timestamp(), + `s` datetime DEFAULT NULL ON UPDATE current_timestamp(), `t` datetime DEFAULT NULL, `u` datetime DEFAULT '1986-09-27 03:00:00', - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NOT NULL DEFAULT current_timestamp(), + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `e` timestamp NULL DEFAULT NULL, - `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `g` datetime DEFAULT CURRENT_TIMESTAMP, - `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `g` datetime DEFAULT current_timestamp(), + `h` datetime DEFAULT NULL ON UPDATE current_timestamp(), `i` datetime DEFAULT NULL, `j` datetime DEFAULT '1986-09-27 03:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -793,7 +793,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -802,7 +802,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime DEFAULT CURRENT_TIMESTAMP + `b` datetime DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -811,7 +811,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `c` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -848,7 +848,7 @@ CREATE TABLE t2 ( b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRE SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SET TIMESTAMP = 2000.876543; @@ -1225,12 +1225,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NOT NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1277,12 +1277,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1344,12 +1344,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NOT NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1382,12 +1382,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime DEFAULT NULL, `b` datetime DEFAULT '2011-11-18 00:00:00', - `like_b` datetime DEFAULT CURRENT_TIMESTAMP, + `like_b` datetime DEFAULT current_timestamp(), `c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00', - `like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `like_c` datetime NOT NULL DEFAULT current_timestamp(), + `d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(), `e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -1430,7 +1430,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 INSERT INTO t1 ( a ) VALUES ( 1 ); SELECT * FROM t1; @@ -2030,7 +2030,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), c TIMESTAMP(6) NULL ); @@ -2038,7 +2038,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -2048,7 +2048,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2074,7 +2074,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDAT SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -2083,7 +2083,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2093,7 +2093,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp(6) NULL DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2101,7 +2101,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT NOW(6) ON UPDATE CURRENT_TIMES SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL, `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -2110,7 +2110,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `c` timestamp(6) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2120,7 +2120,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c` timestamp(6) NULL DEFAULT NULL, - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `b` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2133,7 +2133,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; # @@ -2197,7 +2197,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2206,7 +2206,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2215,7 +2215,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6) + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2242,7 +2242,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -2251,7 +2251,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) + `g` datetime(6) DEFAULT current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -2260,7 +2260,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) + `h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -2300,25 +2300,25 @@ SELECT * FROM t1; SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `k` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `l` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `m` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `k` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `l` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `m` timestamp(6) NOT NULL DEFAULT current_timestamp(6), + `n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `o` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `p` timestamp(6) NULL DEFAULT NULL, - `q` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `r` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), - `s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), + `q` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `r` datetime(6) DEFAULT current_timestamp(6), + `s` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6), `t` datetime(6) DEFAULT NULL, `u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765', - `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6), + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6), `d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `e` timestamp(6) NULL DEFAULT NULL, - `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), - `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), + `f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `g` datetime(6) DEFAULT current_timestamp(6), + `h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6), `i` datetime(6) DEFAULT NULL, `j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -2339,7 +2339,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `a` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2348,7 +2348,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) + `b` datetime(6) DEFAULT current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2357,7 +2357,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) + `c` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2394,7 +2394,7 @@ CREATE TABLE t2 ( b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SET TIMESTAMP = 2000.876543; @@ -2771,12 +2771,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `f` timestamp(6) NOT NULL DEFAULT current_timestamp(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2823,12 +2823,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2890,12 +2890,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `f` timestamp(6) NOT NULL DEFAULT current_timestamp(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2928,12 +2928,12 @@ t1 CREATE TABLE `t1` ( `dummy` int(11) DEFAULT NULL, `a` datetime(6) DEFAULT NULL, `b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000', - `like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `like_b` datetime(6) DEFAULT current_timestamp(6), `c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000', - `like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), - `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), + `like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6), + `d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6), `e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000', - `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `f` timestamp NULL DEFAULT current_timestamp(), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, `i` int(11) NOT NULL DEFAULT 42 @@ -2976,7 +2976,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) + `b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 INSERT INTO t1 ( a ) VALUES ( 1 ); SELECT * FROM t1; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 04d169c84b6..ed0d8f540a0 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1848,8 +1848,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` point DEFAULT NULL, - `x` double DEFAULT x(a), - `y` double DEFAULT y(a) + `x` double DEFAULT st_x(`a`), + `y` double DEFAULT st_y(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Point(1,2)); SELECT x,y FROM t1; @@ -1861,7 +1861,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `g` geometry DEFAULT NULL, - `area` double DEFAULT ST_AREA(g) + `area` double DEFAULT st_area(`g`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))')); SELECT area FROM t1; @@ -1873,7 +1873,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `g` geometry DEFAULT NULL, - `length` double DEFAULT ST_LENGTH(g) + `length` double DEFAULT st_length(`g`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)')); SELECT length FROM t1; @@ -1885,7 +1885,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `g` point DEFAULT NULL, - `distance` double DEFAULT ST_DISTANCE(g, POINT(0,0)) + `distance` double DEFAULT st_distance(`g`,point(0,0)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (Point(1,0)); SELECT distance FROM t1; @@ -1897,7 +1897,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` text DEFAULT NULL, - `g` geometry DEFAULT GeomFromText(a) + `g` geometry DEFAULT st_geometryfromtext(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('point(1 1)'); SELECT AsText(g) FROM t1; @@ -1910,7 +1910,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `x` int(11) DEFAULT NULL, `y` int(11) DEFAULT NULL, - `g` geometry DEFAULT POINT(x,y) + `g` geometry DEFAULT point(`x`,`y`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (x,y) VALUES (10,20); SELECT AsText(g) FROM t1; @@ -1922,7 +1922,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT PointN(a,2) + `b` geometry DEFAULT st_pointn(`a`,2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); SELECT AsText(b) FROM t1; @@ -1934,7 +1934,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT StartPoint(a) + `b` geometry DEFAULT st_startpoint(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); SELECT AsText(b) FROM t1; @@ -1947,7 +1947,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, `b` geometry DEFAULT NULL, - `c` geometry DEFAULT GeometryCollection(a,b) + `c` geometry DEFAULT geometrycollection(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2)); SELECT AsText(c) FROM t1; @@ -1959,7 +1959,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT GeomFromWKB(AsBinary(a),20) + `b` geometry DEFAULT st_geometryfromwkb(st_aswkb(`a`),20) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10)); SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1; @@ -1971,7 +1971,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT BOUNDARY(a) + `b` geometry DEFAULT st_boundary(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); SELECT AsText(b) FROM t1; @@ -1983,7 +1983,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT BUFFER(a,10) + `b` geometry DEFAULT st_buffer(`a`,10) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); SELECT GeometryType(b) FROM t1; @@ -1995,7 +1995,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT CENTROID(a) + `b` geometry DEFAULT st_centroid(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); SELECT AsText(b) FROM t1; @@ -2007,7 +2007,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT ENVELOPE(a) + `b` geometry DEFAULT st_envelope(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)')); SELECT AsText(b) FROM t1; @@ -2019,7 +2019,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT PointOnSurface(a) + `b` geometry DEFAULT st_pointonsurface(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); SELECT GeometryType(b) FROM t1; @@ -2031,8 +2031,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` geometry DEFAULT Point(1,1), - `c` geometry DEFAULT ST_UNION(a,b) + `b` geometry DEFAULT point(1,1), + `c` geometry DEFAULT st_union(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Point(0,0)); SELECT AsText(c) FROM t1; @@ -2044,7 +2044,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` varchar(20) DEFAULT GeometryType(a) + `b` varchar(20) DEFAULT st_geometrytype(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Point(0, 0)); SELECT b FROM t1; @@ -2056,7 +2056,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT IsSimple(a) + `b` int(11) DEFAULT st_issimple(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Point(0, 0)); SELECT b FROM t1; @@ -2068,7 +2068,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT IsEmpty(a) + `b` int(11) DEFAULT st_isempty(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Point(0, 0)); SELECT b FROM t1; @@ -2080,7 +2080,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT IsRing(a) + `b` int(11) DEFAULT st_isring(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); SELECT b FROM t1; @@ -2092,7 +2092,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT IsClosed(a) + `b` int(11) DEFAULT st_isclosed(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); SELECT b FROM t1; @@ -2104,7 +2104,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT Dimension(a) + `b` int(11) DEFAULT st_dimension(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1)); SELECT b FROM t1; @@ -2116,7 +2116,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT NumGeometries(a) + `b` int(11) DEFAULT st_numgeometries(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0))); SELECT b FROM t1; @@ -2128,7 +2128,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT NumInteriorRings(a) + `b` int(11) DEFAULT st_numinteriorrings(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))')); SELECT b FROM t1; @@ -2140,7 +2140,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT NumPoints(a) + `b` int(11) DEFAULT st_numpoints(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0))); SELECT b FROM t1; @@ -2152,7 +2152,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, - `b` int(11) DEFAULT SRID(a) + `b` int(11) DEFAULT srid(`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100)); SELECT b FROM t1; @@ -2165,7 +2165,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, `b` geometry DEFAULT NULL, - `c` int(11) DEFAULT MBRDisjoint(a,b) + `c` int(11) DEFAULT mbrdisjoint(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); SELECT c FROM t1; @@ -2178,7 +2178,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, `b` geometry DEFAULT NULL, - `c` int(11) DEFAULT ST_Disjoint(a,b) + `c` int(11) DEFAULT st_disjoint(`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); SELECT c FROM t1; @@ -2191,7 +2191,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` geometry DEFAULT NULL, `b` geometry DEFAULT NULL, - `c` int(11) DEFAULT ST_Relate(a,b,'T*F**FFF*') + `c` int(11) DEFAULT st_relate(`a`,`b`,'T*F**FFF*') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); SELECT c FROM t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 8442f7fc401..8d2ab0d8a55 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -685,7 +685,7 @@ Db char(64) NO PRI User char(80) NO PRI Table_name char(64) NO PRI Grantor char(141) NO MUL -Timestamp timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +Timestamp timestamp NO current_timestamp() on update current_timestamp() Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') NO Column_priv set('Select','Insert','Update','References') NO use test; @@ -2675,7 +2675,7 @@ CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER()); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(30) DEFAULT USER() + `a` varchar(30) DEFAULT user() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (); GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd'; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index cda028536cf..29bdb144551 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -435,7 +435,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` char(12) NOT NULL, `c3` varchar(123) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`c2`,`c3`), UNIQUE KEY `i4` (`c4`), KEY `c1` (`c1`), @@ -474,7 +474,7 @@ t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` char(12) NOT NULL, `c3` varchar(123) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`), KEY `i5` (`c1`,`c2`,`c3`,`c4`), KEY `c1` (`c1`), diff --git a/mysql-test/r/log_slow.result b/mysql-test/r/log_slow.result index 6a3f48506e3..383ad10ba66 100644 --- a/mysql-test/r/log_slow.result +++ b/mysql-test/r/log_slow.result @@ -46,7 +46,7 @@ select @@log_slow_verbosity; innodb show fields from mysql.slow_log; Field Type Null Key Default Extra -start_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP +start_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6) user_host mediumtext NO NULL query_time time(6) NO NULL lock_time time(6) NO NULL diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index db2727c8234..2ec12bfe1c4 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -54,7 +54,7 @@ ERROR HY000: You can't use locks with log tables show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -63,7 +63,7 @@ general_log CREATE TABLE `general_log` ( ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' show fields from mysql.general_log; Field Type Null Key Default Extra -event_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP +event_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6) user_host mediumtext NO NULL thread_id bigint(21) unsigned NO NULL server_id int(10) unsigned NO NULL @@ -72,7 +72,7 @@ argument mediumtext NO NULL show create table mysql.slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, @@ -88,7 +88,7 @@ slow_log CREATE TABLE `slow_log` ( ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show fields from mysql.slow_log; Field Type Null Key Default Extra -start_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP +start_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6) user_host mediumtext NO NULL query_time time(6) NO NULL lock_time time(6) NO NULL @@ -169,7 +169,7 @@ set global slow_query_log='OFF'; show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -179,7 +179,7 @@ general_log CREATE TABLE `general_log` ( show create table mysql.slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, @@ -198,7 +198,7 @@ alter table mysql.slow_log engine=myisam; show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -208,7 +208,7 @@ general_log CREATE TABLE `general_log` ( show create table mysql.slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/mysql5613mysql.result b/mysql-test/r/mysql5613mysql.result index 1d2c3b97baf..183af7211d3 100644 --- a/mysql-test/r/mysql5613mysql.result +++ b/mysql-test/r/mysql5613mysql.result @@ -10,7 +10,7 @@ columns_priv CREATE TABLE `columns_priv` ( `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' @@ -58,7 +58,7 @@ event CREATE TABLE `event` ( `execute_at` datetime DEFAULT NULL, `interval_value` int(11) DEFAULT NULL, `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, @@ -115,7 +115,7 @@ proc CREATE TABLE `proc` ( `returns` longblob NOT NULL DEFAULT '', `body` longblob NOT NULL, `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -138,7 +138,7 @@ procs_priv CREATE TABLE `procs_priv` ( `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' @@ -154,7 +154,7 @@ proxies_priv CREATE TABLE `proxies_priv` ( `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', `With_grant` tinyint(1) NOT NULL DEFAULT 0, `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges' @@ -186,7 +186,7 @@ tables_priv CREATE TABLE `tables_priv` ( `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), diff --git a/mysql-test/r/mysql57_virtual.result b/mysql-test/r/mysql57_virtual.result index ace8fe38d36..6f337c8e7d7 100644 --- a/mysql-test/r/mysql57_virtual.result +++ b/mysql-test/r/mysql57_virtual.result @@ -32,7 +32,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) PERSISTENT, - `c` int(11) AS (a+2) VIRTUAL + `b` int(11) AS ((`a` + 1)) PERSISTENT, + `c` int(11) AS ((`a` + 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 04612e02b7f..fcfab3e068a 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2923,7 +2923,7 @@ DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( - `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `d` (`d`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2960,7 +2960,7 @@ DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( - `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `d` (`d`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -5260,7 +5260,7 @@ Error 1146 Table 'mysql.event' doesn't exist SHOW CREATE TABLE mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -5270,7 +5270,7 @@ general_log CREATE TABLE `general_log` ( SHOW CREATE TABLE mysql.slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 3b365d6fdde..bc3598131e2 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -260,7 +260,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp(), `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result index 80f11edaaf6..ee7bf514807 100644 --- a/mysql-test/r/partition_bug18198.result +++ b/mysql-test/r/partition_bug18198.result @@ -130,8 +130,7 @@ ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitio create table t1 (col1 datetime) partition by range(week(col1)) (partition p0 values less than (10), partition p1 values less than (30)); -ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ') -(partition p0 values less than (10), partition p1 values less than (30))' at line 2 +ERROR HY000: This partition function is not allowed create table t1 (col1 varchar(25)) partition by range(cast(col1 as signed)) (partition p0 values less than (10), partition p1 values less than (30)); diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 436db33af36..8bb360e96ae 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -27,7 +27,7 @@ proxies_priv CREATE TABLE `proxies_priv` ( `Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `With_grant` tinyint(1) NOT NULL DEFAULT 0, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges' diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index ed768343581..7ef480a6019 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -342,7 +342,7 @@ t1 CREATE TABLE `t1` ( `empty_char` char(0) DEFAULT NULL, `type_char` char(2) DEFAULT NULL, `type_varchar` varchar(10) DEFAULT NULL, - `type_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `type_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `type_date` date NOT NULL DEFAULT '0000-00-00', `type_time` time NOT NULL DEFAULT '00:00:00', `type_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -742,17 +742,17 @@ DROP VIEW v1; CREATE VIEW v1 AS SELECT NOW(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()` binary binary +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select current_timestamp() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE NOW(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()` binary binary +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache current_timestamp() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_NO_CACHE NOW(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache current_timestamp() AS `NOW()` binary binary DROP VIEW v1; CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW(); ERROR HY000: Incorrect usage of SQL_CACHE and SQL_NO_CACHE @@ -979,7 +979,7 @@ def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33 def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33 def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33 -def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33 +def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 90 0 N 1 0 33 def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33 def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 3072 0 N 1 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT @@ -998,7 +998,7 @@ def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33 def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33 def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33 def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33 -def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33 +def information_schema COLUMNS COLUMNS EXTRA Extra 253 90 0 N 1 0 33 Field Type Null Key Default Extra c int(11) NO PRI NULL ---------------------------------------------------------------- diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index e1afb964f0a..782ae00bb33 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -149,7 +149,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "f1" int(11) NOT NULL AUTO_INCREMENT, - "f2" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "f2" timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY ("f1") ) set session sql_mode=no_field_options; @@ -157,7 +157,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f1` int(11) NOT NULL, - `f2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `f2` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`f1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result index 52986fa9a6b..58d9dded51e 100644 --- a/mysql-test/r/statistics.result +++ b/mysql-test/r/statistics.result @@ -1688,7 +1688,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` blob DEFAULT NULL, - `b` text DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a) + `b` text DEFAULT decode_histogram('SINGLE_PREC_HB',`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF); SELECT b FROM t1; diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 4da77f21792..9436627aa1f 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1273,7 +1273,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 414815f02b7..b88497dbd9b 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), @@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' @@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` ( `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' @@ -212,7 +212,7 @@ proc CREATE TABLE `proc` ( `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -232,7 +232,7 @@ event CREATE TABLE `event` ( `execute_at` datetime DEFAULT NULL, `interval_value` int(11) DEFAULT NULL, `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, @@ -252,7 +252,7 @@ event CREATE TABLE `event` ( show create table general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` ( show create table slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/system_mysql_db_fix40123.result b/mysql-test/r/system_mysql_db_fix40123.result index 414815f02b7..b88497dbd9b 100644 --- a/mysql-test/r/system_mysql_db_fix40123.result +++ b/mysql-test/r/system_mysql_db_fix40123.result @@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), @@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' @@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` ( `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' @@ -212,7 +212,7 @@ proc CREATE TABLE `proc` ( `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -232,7 +232,7 @@ event CREATE TABLE `event` ( `execute_at` datetime DEFAULT NULL, `interval_value` int(11) DEFAULT NULL, `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, @@ -252,7 +252,7 @@ event CREATE TABLE `event` ( show create table general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` ( show create table slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/system_mysql_db_fix50030.result b/mysql-test/r/system_mysql_db_fix50030.result index ed86a35c910..14905ab81a0 100644 --- a/mysql-test/r/system_mysql_db_fix50030.result +++ b/mysql-test/r/system_mysql_db_fix50030.result @@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), @@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' @@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` ( `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' @@ -212,7 +212,7 @@ proc CREATE TABLE `proc` ( `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -232,7 +232,7 @@ event CREATE TABLE `event` ( `execute_at` datetime DEFAULT NULL, `interval_value` int(11) DEFAULT NULL, `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, @@ -252,7 +252,7 @@ event CREATE TABLE `event` ( show create table general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` ( show create table slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/system_mysql_db_fix50117.result b/mysql-test/r/system_mysql_db_fix50117.result index 414815f02b7..b88497dbd9b 100644 --- a/mysql-test/r/system_mysql_db_fix50117.result +++ b/mysql-test/r/system_mysql_db_fix50117.result @@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), @@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' @@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` ( `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', - `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' @@ -212,7 +212,7 @@ proc CREATE TABLE `proc` ( `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -232,7 +232,7 @@ event CREATE TABLE `event` ( `execute_at` datetime DEFAULT NULL, `interval_value` int(11) DEFAULT NULL, `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, @@ -252,7 +252,7 @@ event CREATE TABLE `event` ( show create table general_log; Table Create Table general_log CREATE TABLE `general_log` ( - `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `thread_id` bigint(21) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL, @@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` ( show create table slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( - `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `user_host` mediumtext NOT NULL, `query_time` time(6) NOT NULL, `lock_time` time(6) NOT NULL, diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 819fe5306ab..dae9094f463 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -42,13 +42,13 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext DEFAULT "hello" + `a` mediumtext DEFAULT 'hello' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 (a blob default "hello"); SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` blob DEFAULT "hello" + `a` blob DEFAULT 'hello' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 43409cf60e7..6af497577fc 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -54,7 +54,7 @@ ushort smallint(5) unsigned zerofill NULL NO MUL 00000 # umedium mediumint(8) unsigned NULL NO MUL 0 # ulong int(11) unsigned NULL NO MUL 0 # ulonglong bigint(13) unsigned NULL NO MUL 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field date NULL YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # @@ -226,7 +226,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 # umedium mediumint(8) unsigned NULL NO MUL 0 # ulong int(11) unsigned NULL NO MUL 0 # ulonglong bigint(13) unsigned NULL NO MUL 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field char(10) latin1_swedish_ci YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # @@ -252,7 +252,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 # umedium mediumint(8) unsigned NULL NO 0 # ulong int(11) unsigned NULL NO 0 # ulonglong bigint(13) unsigned NULL NO 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field char(10) latin1_swedish_ci YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # diff --git a/mysql-test/r/type_temporal_mysql56.result b/mysql-test/r/type_temporal_mysql56.result index b0c81844781..cdc951dac14 100644 --- a/mysql-test/r/type_temporal_mysql56.result +++ b/mysql-test/r/type_temporal_mysql56.result @@ -63,7 +63,7 @@ SET TIME_ZONE='+00:00'; SHOW CREATE TABLE mysql56timestamp; Table Create Table mysql56timestamp CREATE TABLE `mysql56timestamp` ( - `ts0` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ts0` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ts1` timestamp(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', `ts2` timestamp(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', `ts3` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 69c9f68811d..90246fed831 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -195,13 +195,13 @@ t1 t2 t3 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp(), `t2` datetime DEFAULT NULL, `t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() t2 datetime YES NULL t3 timestamp NO 0000-00-00 00:00:00 drop table t1; @@ -222,12 +222,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO 2003-01-01 00:00:00 on update CURRENT_TIMESTAMP +t1 timestamp NO 2003-01-01 00:00:00 on update current_timestamp() t2 datetime YES NULL drop table t1; create table t1 (t1 timestamp not null default now() on update now(), t2 datetime); @@ -247,12 +247,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL drop table t1; create table t1 (t1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'); @@ -272,13 +272,13 @@ t1 t2 t3 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL, `t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL t3 timestamp NO 0000-00-00 00:00:00 drop table t1; @@ -299,12 +299,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL truncate table t1; insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00'); @@ -369,7 +369,7 @@ create table t1 (a timestamp null default current_timestamp on update current_ti show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL, NULL); @@ -710,12 +710,12 @@ CREATE TABLE t2 AS SELECT * from t1 LIMIT 0; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `ts` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `ts` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2; SET sql_mode=DEFAULT; @@ -731,13 +731,13 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `vc` varchar(10) NOT NULL DEFAULT 'test', - `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `ts` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `vc` varchar(10) NOT NULL DEFAULT 'test', - `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP + `ts` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2; End of 10.0 tests diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result index ccad5c8f8a1..fc1bd83e04f 100644 --- a/mysql-test/r/type_timestamp_hires.result +++ b/mysql-test/r/type_timestamp_hires.result @@ -64,15 +64,15 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) + `a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -a timestamp(4) NO CURRENT_TIMESTAMP(4) on update CURRENT_TIMESTAMP +a timestamp(4) NO current_timestamp(4) on update current_timestamp(4) select table_name, column_name, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, datetime_precision, character_set_name, collation_name, column_type, column_key, extra from information_schema.columns where table_name='t1'; table_name t1 column_name a -column_default CURRENT_TIMESTAMP(4) +column_default current_timestamp(4) is_nullable NO data_type timestamp character_maximum_length NULL @@ -84,7 +84,7 @@ character_set_name NULL collation_name NULL column_type timestamp(4) column_key -extra on update CURRENT_TIMESTAMP +extra on update current_timestamp(4) select a, a+interval 9876543 microsecond from t1; a a+interval 9876543 microsecond 2010-12-11 01:02:03.4567 2010-12-11 01:02:13.333243 @@ -109,12 +109,12 @@ create table t3 like t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) + `a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) + `a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2, t3; insert t1 values ('2010-12-13 14:15:16.222222'); @@ -130,7 +130,7 @@ create table t3 select max(a), min(a), sum(a), avg(a) from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4), + `a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4), `a+0` decimal(25,4) NOT NULL, `a-1` decimal(25,4) NOT NULL, `a*1` decimal(25,4) NOT NULL, @@ -276,13 +276,13 @@ create or replace table t1 (a timestamp(5) default current_timestamp); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) default current_timestamp()); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) default current_timestamp(2)); show create table t1; @@ -298,25 +298,25 @@ create or replace table t1 (a timestamp(5) default current_timestamp(5)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) default current_timestamp(6)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) on update current_timestamp); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) on update current_timestamp()); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) on update current_timestamp(3)); ERROR HY000: Invalid ON UPDATE clause for 'a' column @@ -324,12 +324,12 @@ create or replace table t1 (a timestamp(5) on update current_timestamp(5)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a timestamp(5) on update current_timestamp(6)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index dc9806bb7d1..737ed32f1ee 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -457,7 +457,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT METAPHON(a) + `b` varchar(10) DEFAULT metaphon(`a` AS `a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('Hello'); SELECT * FROM t1; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 34b899b3f00..faf645d9468 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1920,7 +1920,7 @@ create table t2 (b timestamp default now()); create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now()) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < current_timestamp()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < current_timestamp()) latin1 latin1_swedish_ci drop view v1; drop table t1, t2; CREATE TABLE t1 ( a varchar(50) ); @@ -2948,7 +2948,7 @@ create table t1 (f1 datetime); create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute)) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between current_timestamp() and (current_timestamp() + interval 1 minute)) latin1 latin1_swedish_ci drop view v1; drop table t1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index 4b028e1da3d..89f29ff4b38 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -45,7 +45,7 @@ CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL COLUMN_TYPE longtext NO COLUMN_KEY varchar(3) NO -EXTRA varchar(27) NO +EXTRA varchar(30) NO PRIVILEGES varchar(80) NO COLUMN_COMMENT varchar(1024) NO SHOW CREATE TABLE information_schema.COLUMNS; @@ -68,7 +68,7 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( `COLLATION_NAME` varchar(32) DEFAULT NULL, `COLUMN_TYPE` longtext NOT NULL DEFAULT '', `COLUMN_KEY` varchar(3) NOT NULL DEFAULT '', - `EXTRA` varchar(27) NOT NULL DEFAULT '', + `EXTRA` varchar(30) NOT NULL DEFAULT '', `PRIVILEGES` varchar(80) NOT NULL DEFAULT '', `COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT '' ) DEFAULT CHARSET=utf8 @@ -91,7 +91,7 @@ CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL COLUMN_TYPE longtext NO COLUMN_KEY varchar(3) NO -EXTRA varchar(27) NO +EXTRA varchar(30) NO PRIVILEGES varchar(80) NO COLUMN_COMMENT varchar(1024) NO SELECT table_catalog, table_schema, table_name, column_name diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index fd8989c7667..a005e39b0b4 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -645,7 +645,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references -def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 69c5d79b541..bc7a693d617 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -68,7 +68,7 @@ def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL NULL u def information_schema COLUMNS COLUMN_TYPE 16 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned -def information_schema COLUMNS EXTRA 18 NO varchar 27 81 NULL NULL NULL utf8 utf8_general_ci varchar(27) +def information_schema COLUMNS EXTRA 18 NO varchar 30 90 NULL NULL NULL utf8 utf8_general_ci varchar(30) def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned @@ -602,7 +602,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi 3.0000 information_schema COLUMNS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3) -3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27) +3.0000 information_schema COLUMNS EXTRA varchar 30 90 utf8 utf8_general_ci varchar(30) 3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80) 3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 190 570 utf8 utf8_general_ci varchar(190) diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index 674abfaefab..fdb410fee7a 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -620,7 +620,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references -def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 6ce5f1bd8a0..823a3ffe214 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -682,7 +682,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references -def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index d89459a88ac..3b9f33f2917 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -682,7 +682,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime -def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 2821e1112e5..832460e085b 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -7,7 +7,7 @@ def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL NULL utf8 utf8_gene def mysql columns_priv Db 2 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references -def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql columns_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references @@ -47,7 +47,7 @@ def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL N def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql event comment 16 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) select,insert,update,references -def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql event db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references def mysql event db_collation 21 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql event definer 4 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) select,insert,update,references @@ -70,7 +70,7 @@ def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) sele def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('function','aggregate') select,insert,update,references def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references -def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP select,insert,update,references +def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references @@ -124,7 +124,7 @@ def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NU def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references -def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql proc db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references def mysql proc definer 12 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) select,insert,update,references @@ -145,13 +145,13 @@ def mysql procs_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60 def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references -def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql procs_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references def mysql proxies_priv Grantor 6 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL select,insert,update,references def mysql proxies_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references def mysql proxies_priv Proxied_user 4 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references -def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql proxies_priv User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references def mysql roles_mapping Admin_option 4 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -177,7 +177,7 @@ def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references -def mysql slow_log start_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP select,insert,update,references +def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references @@ -186,7 +186,7 @@ def mysql tables_priv Grantor 5 NO char 141 423 NULL NULL NULL utf8 utf8_bin ch def mysql tables_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references -def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references +def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references def mysql tables_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 006ed9d82f2..0a92e6edf24 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -7,7 +7,7 @@ def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL NULL utf8 utf8_gene def mysql columns_priv Db 2 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI -def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql columns_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) @@ -47,7 +47,7 @@ def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL N def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql event comment 16 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) -def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql event db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI def mysql event db_collation 21 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql event definer 4 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) @@ -70,7 +70,7 @@ def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('function','aggregate') def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP +def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext @@ -124,7 +124,7 @@ def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NU def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text -def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql proc db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) def mysql proc definer 12 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) @@ -145,13 +145,13 @@ def mysql procs_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60 def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI -def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql procs_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI def mysql proxies_priv Grantor 6 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL def mysql proxies_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI def mysql proxies_priv Proxied_user 4 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI -def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql proxies_priv User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) def mysql roles_mapping Admin_option 4 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -177,7 +177,7 @@ def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext -def mysql slow_log start_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP +def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') @@ -186,7 +186,7 @@ def mysql tables_priv Grantor 5 NO char 141 423 NULL NULL NULL utf8 utf8_bin ch def mysql tables_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') -def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() def mysql tables_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index fa0badff96d..5deeeb23baa 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -486,7 +486,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, - `c` char(2) GENERATED ALWAYS AS ((`a` or `b`)) VIRTUAL + `c` char(2) AS (((`a` <> 0) or (`b` <> 0))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; @@ -507,7 +507,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, - `c` char(2) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL + `c` char(2) AS (concat(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; @@ -534,7 +534,6 @@ ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1)); Warnings: Warning 1292 Truncated incorrect INTEGER value: 'a' Warning 1292 Truncated incorrect INTEGER value: 'a' -Warning 1292 Truncated incorrect INTEGER value: 'a' DROP TABLE t; set sql_mode= @save_old_sql_mode; # Bug#21875520 Problems with virtual column indexes diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index 6a738685a5d..d271edd37cf 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -94,7 +94,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -114,7 +114,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -136,7 +136,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -191,7 +191,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -216,7 +216,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -229,7 +229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (5 * 2) VIRTUAL + `b` int(11) AS ((5 * 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -294,9 +294,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a + 1) VIRTUAL, - `c` varchar(12) AS ("aaaabb") PERSISTENT, - `d` blob AS (c) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) AS ('aaaabb') PERSISTENT, + `d` blob AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1 order by a; a b c d @@ -307,9 +307,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a + 1) VIRTUAL, - `c` varchar(12) AS ("aaaabb") PERSISTENT, - `d` blob AS (c) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) AS ('aaaabb') PERSISTENT, + `d` blob AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 CREATE TABLE t3 AS SELECT * FROM t1; SHOW CREATE TABLE t3; @@ -604,7 +604,7 @@ Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) NOT NULL, "b" varchar(10) DEFAULT NULL, - "c" char(3) AS (substr(b,1,3)) VIRTUAL, + "c" char(3) AS (substr("b",1,3)) VIRTUAL, PRIMARY KEY ("a"), KEY "c" ("c") ) @@ -619,7 +619,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(10) DEFAULT NULL, - `c` char(3) AS (substr(b,1,3)) VIRTUAL, + `c` char(3) AS (substr(`b`,1,3)) VIRTUAL, PRIMARY KEY (`a`), KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index f5f8afcc353..37cdc82710d 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -94,7 +94,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -114,7 +114,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -136,7 +136,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -191,7 +191,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -216,7 +216,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -229,7 +229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (5 * 2) VIRTUAL + `b` int(11) AS ((5 * 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -294,9 +294,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a + 1) VIRTUAL, - `c` varchar(12) AS ("aaaabb") PERSISTENT, - `d` blob AS (c) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) AS ('aaaabb') PERSISTENT, + `d` blob AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t1 order by a; a b c d @@ -307,9 +307,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a + 1) VIRTUAL, - `c` varchar(12) AS ("aaaabb") PERSISTENT, - `d` blob AS (c) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) AS ('aaaabb') PERSISTENT, + `d` blob AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t3 AS SELECT * FROM t1; SHOW CREATE TABLE t3; @@ -604,7 +604,7 @@ Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) NOT NULL, "b" varchar(10) DEFAULT NULL, - "c" char(3) AS (substr(b,1,3)) VIRTUAL, + "c" char(3) AS (substr("b",1,3)) VIRTUAL, PRIMARY KEY ("a"), KEY "c" ("c") ) @@ -619,7 +619,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(10) DEFAULT NULL, - `c` char(3) AS (substr(b,1,3)) VIRTUAL, + `c` char(3) AS (substr(`b`,1,3)) VIRTUAL, PRIMARY KEY (`a`), KEY `c` (`c`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index ff3e7970f29..3f73b44607c 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -11,7 +11,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -46,7 +46,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -59,7 +59,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index 162035c999e..7a45008b9a2 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -11,7 +11,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) VIRTUAL, + `b` int(11) AS ((`a` * 2)) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -37,7 +37,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) VIRTUAL, + `b` int(11) AS ((`a` * 2)) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -50,7 +50,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -75,7 +75,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) VIRTUAL, + `b` int(11) AS ((`a` * 2)) VIRTUAL, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -103,7 +103,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result index aed3fbc8e0b..30d3abb3df0 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -101,7 +101,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -182,7 +182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) VIRTUAL, + `c` int(11) AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) PERSISTENT, + `c` int(11) AS (dayofyear(`b`)) PERSISTENT, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -225,7 +225,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) VIRTUAL + `c` int(11) AS (week(`b`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; DROP VIEW IF EXISTS v1,v2; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result index 2ebe751009c..2d3d57ab39d 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -101,7 +101,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -182,7 +182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) VIRTUAL, + `c` int(11) AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) PERSISTENT, + `c` int(11) AS (dayofyear(`b`)) PERSISTENT, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -225,7 +225,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) VIRTUAL + `c` int(11) AS (week(`b`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; DROP VIEW IF EXISTS v1,v2; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result index 72021909e0f..e8d91e13e4d 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result @@ -10,7 +10,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(a)) VIRTUAL + `b` int(11) AS (abs(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -25,7 +25,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(a),6)) VIRTUAL + `b` double AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -44,7 +44,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(a),6)) VIRTUAL + `b` double AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -62,7 +62,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -78,7 +78,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(a),6)) VIRTUAL + `c` double AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -96,7 +96,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan2(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -113,7 +113,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceil(a)) VIRTUAL + `b` int(11) AS (ceiling(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(a,b,c)) VIRTUAL + `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -153,7 +153,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(a),6)) VIRTUAL + `b` double AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(a),6)) VIRTUAL + `b` double AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (12,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (crc32(a)) VIRTUAL + `b` bigint(20) AS (crc32(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(a),6)) VIRTUAL + `b` double AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a/2) VIRTUAL + `b` double AS ((`a` / 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(a),6)) VIRTUAL + `b` double AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` bigint(20) AS (floor(a)) VIRTUAL + `b` bigint(20) AS (floor(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(a),6)) VIRTUAL + `b` double AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(a,b),6)) VIRTUAL + `c` double AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(a),6)) VIRTUAL + `b` double AS (format(log(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(a),6)) VIRTUAL + `b` double AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(a),6)) VIRTUAL + `b` double AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a-1) VIRTUAL + `b` double AS ((`a` - 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (mod(a,10)) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 10) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (oct(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(PI()*a*a,6)) VIRTUAL + `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(a,2)) VIRTUAL, - `c` int(11) AS (power(a,2)) VIRTUAL + `b` int(11) AS (pow(`a`,2)) VIRTUAL, + `c` int(11) AS (pow(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(a),6)) VIRTUAL + `b` double AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(a)) VIRTUAL + `b` int(11) AS (round(`a`,0)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(a,b)) VIRTUAL + `c` int(11) AS (round(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(a)) VIRTUAL + `b` int(11) AS (sign(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(a),6)) VIRTUAL + `b` double AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(a),6)) VIRTUAL + `b` double AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(a),6)) VIRTUAL + `b` double AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a*3) VIRTUAL + `b` double AS ((`a` * 3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(a,4)) VIRTUAL + `b` double AS (truncate(`a`,4)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-a) VIRTUAL + `b` double AS (-(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(a)) VIRTUAL + `b` int(11) AS (ascii(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (bin(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (bit_length(a)) VIRTUAL + `b` bigint(20) AS (bit_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(a)) VIRTUAL + `b` bigint(20) AS (char_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(a,b)) VIRTUAL + `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (character_length(a)) VIRTUAL + `b` bigint(20) AS (char_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL + `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(a,',',b)) VIRTUAL + `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(c,a,b)) VIRTUAL + `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL + `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',a,b)) VIRTUAL + `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(a,b)) VIRTUAL + `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(a,2)) VIRTUAL + `b` varchar(20) AS (format(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL + `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (instr(a,b)) VIRTUAL + `c` int(11) AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(a,5)) VIRTUAL + `b` varchar(5) AS (left(`a`,5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a like 'H%o') VIRTUAL + `b` tinyint(1) AS ((`a` like 'H%o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lower(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL + `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(a)) VIRTUAL + `b` varchar(10) AS (ltrim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL + `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (mid(a,1,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not like 'H%o') VIRTUAL + `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (octet_length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (ord(a)) VIRTUAL + `b` bigint(20) AS (ord(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (position('bar' in a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(a)) VIRTUAL + `b` varchar(10) AS (quote(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(a,3)) VIRTUAL + `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL + `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(a)) VIRTUAL + `b` varchar(30) AS (reverse(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(a,4)) VIRTUAL + `b` varchar(10) AS (right(`a`,4)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL + `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(a)) VIRTUAL + `b` varchar(10) AS (rtrim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(a)) VIRTUAL + `b` varchar(20) AS (soundex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a sounds like b) VIRTUAL + `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(a,space(5))) VIRTUAL + `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL + `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(a,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL + `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(a)) VIRTUAL + `b` varchar(10) AS (trim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(a)) VIRTUAL + `b` varchar(10) AS (unhex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (upper(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1479,7 +1479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (weight_string(a as char(4))) VIRTUAL + `b` varchar(10) AS (weight_string(`a`,0,4,65)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL + `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if(a=1,a,b)) VIRTUAL + `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1535,7 +1535,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL + `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1552,7 +1552,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL + `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a>0 && a<2) VIRTUAL + `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1606,7 +1606,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (binary a) VIRTUAL + `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a & 5) VIRTUAL + `b` int(11) AS ((`a` & 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~a) VIRTUAL + `b` int(11) AS (~(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a | 5) VIRTUAL + `b` int(11) AS ((`a` | 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a ^ 5) VIRTUAL + `b` int(11) AS ((`a` ^ 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a div 5) VIRTUAL + `b` int(11) AS ((`a` DIV 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS (a <=> b) VIRTUAL + `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a=b) VIRTUAL + `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a >= b) VIRTUAL + `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a > b) VIRTUAL + `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is not null) VIRTUAL + `b` tinyint(1) AS ((`a` is not null)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is null) VIRTUAL + `b` tinyint(1) AS (isnull(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a << 2) VIRTUAL + `b` int(11) AS ((`a` << 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <= b) VIRTUAL + `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a < b) VIRTUAL + `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <> b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a != b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a>5 || a<3) VIRTUAL + `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a >> 2) VIRTUAL + `b` int(11) AS ((`a` >> 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a xor 5) VIRTUAL + `b` int(11) AS ((`a` xor 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL + `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL + `b` varchar(64) AS (date_format(`a`,'%W %M %D')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date(a)) VIRTUAL + `b` datetime AS (cast(`a` as date)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (datediff(a,'2000-01-01')) VIRTUAL + `b` bigint(20) AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (day(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(a)) VIRTUAL + `b` varchar(10) AS (dayname(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(a)) VIRTUAL + `b` int(11) AS (dayofweek(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2170,7 +2170,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(a)) VIRTUAL + `b` int(11) AS (dayofyear(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2185,7 +2185,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from a)) VIRTUAL + `b` int(11) AS (extract(year from `a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2200,7 +2200,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_days(a)) VIRTUAL + `b` datetime AS (from_days(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2215,7 +2215,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_unixtime(a)) VIRTUAL + `b` datetime AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2230,7 +2230,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL + `b` varchar(32) AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2245,7 +2245,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (hour(a)) VIRTUAL + `b` bigint(20) AS (hour(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2260,7 +2260,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(a)) VIRTUAL + `b` datetime AS (last_day(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2279,7 +2279,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(a,1)) VIRTUAL + `b` datetime AS (makedate(`a`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2294,7 +2294,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(a,1,3)) VIRTUAL + `b` time AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2309,7 +2309,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (microsecond(a)) VIRTUAL + `b` bigint(20) AS (microsecond(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2326,7 +2326,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(a)) VIRTUAL + `b` int(11) AS (minute(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2341,7 +2341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(a)) VIRTUAL + `b` int(11) AS (month(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2356,7 +2356,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(a)) VIRTUAL + `b` varchar(16) AS (monthname(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2371,7 +2371,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(a,2)) VIRTUAL + `b` int(11) AS (period_add(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2387,7 +2387,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(a,b)) VIRTUAL + `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2402,7 +2402,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(a)) VIRTUAL + `b` int(11) AS (quarter(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2417,7 +2417,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` time AS (sec_to_time(a)) VIRTUAL + `b` time AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2432,7 +2432,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(a)) VIRTUAL + `b` int(11) AS (second(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2447,7 +2447,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL + `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2477,7 +2477,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2492,7 +2492,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL + `b` varchar(32) AS (time_format(`a`,'%r')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2507,7 +2507,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (time_to_sec(a)) VIRTUAL + `b` bigint(20) AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2522,7 +2522,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (time(a)) VIRTUAL + `b` time AS (cast(`a` as time)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2538,7 +2538,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` time AS (timediff(a,b)) VIRTUAL + `c` time AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2553,7 +2553,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestamp(a)) VIRTUAL + `b` timestamp AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL + `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2582,8 +2582,8 @@ create table t1 (a timestamp, c bigint generated always as (timestampdiff(MONTH, show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `c` bigint(20) AS (timestampdiff(MONTH, a, a)) VIRTUAL + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `c` bigint(20) AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01',default); select * from t1; @@ -2598,7 +2598,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (to_days(a)) VIRTUAL + `b` bigint(20) AS (to_days(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2613,7 +2613,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(a)) VIRTUAL + `b` int(11) AS (week(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(a)) VIRTUAL + `b` int(11) AS (weekday(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2643,7 +2643,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekofyear(a)) VIRTUAL + `b` int(11) AS (week(`a`,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2658,7 +2658,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(a)) VIRTUAL + `b` int(11) AS (year(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2673,7 +2673,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(a)) VIRTUAL + `b` int(11) AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2695,7 +2695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(a as unsigned)) VIRTUAL + `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (convert(a,unsigned)) VIRTUAL + `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2740,7 +2740,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (ExtractValue(a,'/b')) VIRTUAL + `b` varchar(1024) AS (extractvalue(`a`,'/b')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -2759,7 +2759,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2774,7 +2774,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(a)) VIRTUAL + `b` int(11) AS (bit_count(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2789,7 +2789,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (charset(a)) VIRTUAL + `b` varchar(1024) AS (charset(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2804,7 +2804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` int(11) AS (coercibility(a)) VIRTUAL + `b` int(11) AS (coercibility(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2819,7 +2819,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (collation(a)) VIRTUAL + `b` varchar(1024) AS (collation(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2834,7 +2834,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL + `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2849,7 +2849,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL + `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2864,7 +2864,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL + `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2878,7 +2878,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (des_encrypt(des_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2893,7 +2893,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL + `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2908,7 +2908,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(a)) VIRTUAL + `b` varbinary(32) AS (md5(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2923,7 +2923,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(a)) VIRTUAL + `b` varchar(1024) AS (password(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2938,7 +2938,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha1(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2953,7 +2953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2968,7 +2968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha2(a,224)) VIRTUAL + `b` varchar(1024) AS (sha2(`a`,224)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2983,7 +2983,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL + `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result index add3a6a3fe0..905645f2972 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result @@ -10,7 +10,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(a)) VIRTUAL + `b` int(11) AS (abs(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -25,7 +25,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(a),6)) VIRTUAL + `b` double AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -44,7 +44,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(a),6)) VIRTUAL + `b` double AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -62,7 +62,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -78,7 +78,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(a),6)) VIRTUAL + `c` double AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -96,7 +96,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan2(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -113,7 +113,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceil(a)) VIRTUAL + `b` int(11) AS (ceiling(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(a,b,c)) VIRTUAL + `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -153,7 +153,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(a),6)) VIRTUAL + `b` double AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(a),6)) VIRTUAL + `b` double AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (12,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (crc32(a)) VIRTUAL + `b` bigint(20) AS (crc32(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(a),6)) VIRTUAL + `b` double AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a/2) VIRTUAL + `b` double AS ((`a` / 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(a),6)) VIRTUAL + `b` double AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` bigint(20) AS (floor(a)) VIRTUAL + `b` bigint(20) AS (floor(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(a),6)) VIRTUAL + `b` double AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(a,b),6)) VIRTUAL + `c` double AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(a),6)) VIRTUAL + `b` double AS (format(log(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(a),6)) VIRTUAL + `b` double AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(a),6)) VIRTUAL + `b` double AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a-1) VIRTUAL + `b` double AS ((`a` - 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (mod(a,10)) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 10) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (oct(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(PI()*a*a,6)) VIRTUAL + `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(a,2)) VIRTUAL, - `c` int(11) AS (power(a,2)) VIRTUAL + `b` int(11) AS (pow(`a`,2)) VIRTUAL, + `c` int(11) AS (pow(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(a),6)) VIRTUAL + `b` double AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(a)) VIRTUAL + `b` int(11) AS (round(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(a,b)) VIRTUAL + `c` int(11) AS (round(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(a)) VIRTUAL + `b` int(11) AS (sign(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(a),6)) VIRTUAL + `b` double AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(a),6)) VIRTUAL + `b` double AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(a),6)) VIRTUAL + `b` double AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a*3) VIRTUAL + `b` double AS ((`a` * 3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(a,4)) VIRTUAL + `b` double AS (truncate(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-a) VIRTUAL + `b` double AS (-(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(a)) VIRTUAL + `b` int(11) AS (ascii(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (bin(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (bit_length(a)) VIRTUAL + `b` bigint(20) AS (bit_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(a)) VIRTUAL + `b` bigint(20) AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(a,b)) VIRTUAL + `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (character_length(a)) VIRTUAL + `b` bigint(20) AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL + `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(a,',',b)) VIRTUAL + `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(c,a,b)) VIRTUAL + `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL + `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',a,b)) VIRTUAL + `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(a,b)) VIRTUAL + `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(a,2)) VIRTUAL + `b` varchar(20) AS (format(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL + `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (instr(a,b)) VIRTUAL + `c` int(11) AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(a,5)) VIRTUAL + `b` varchar(5) AS (left(`a`,5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a like 'H%o') VIRTUAL + `b` tinyint(1) AS ((`a` like 'H%o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lower(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL + `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(a)) VIRTUAL + `b` varchar(10) AS (ltrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL + `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (mid(a,1,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not like 'H%o') VIRTUAL + `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (octet_length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (ord(a)) VIRTUAL + `b` bigint(20) AS (ord(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (position('bar' in a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(a)) VIRTUAL + `b` varchar(10) AS (quote(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(a,3)) VIRTUAL + `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL + `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(a)) VIRTUAL + `b` varchar(30) AS (reverse(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(a,4)) VIRTUAL + `b` varchar(10) AS (right(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL + `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(a)) VIRTUAL + `b` varchar(10) AS (rtrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(a)) VIRTUAL + `b` varchar(20) AS (soundex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a sounds like b) VIRTUAL + `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(a,space(5))) VIRTUAL + `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL + `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(a,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL + `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(a)) VIRTUAL + `b` varchar(10) AS (trim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(a)) VIRTUAL + `b` varchar(10) AS (unhex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (upper(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1479,7 +1479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (weight_string(a as char(4))) VIRTUAL + `b` varchar(10) AS (weight_string(`a`,0,4,65)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL + `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if(a=1,a,b)) VIRTUAL + `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1535,7 +1535,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL + `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1552,7 +1552,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL + `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a>0 && a<2) VIRTUAL + `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1606,7 +1606,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (binary a) VIRTUAL + `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a & 5) VIRTUAL + `b` int(11) AS ((`a` & 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~a) VIRTUAL + `b` int(11) AS (~(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a | 5) VIRTUAL + `b` int(11) AS ((`a` | 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a ^ 5) VIRTUAL + `b` int(11) AS ((`a` ^ 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a div 5) VIRTUAL + `b` int(11) AS ((`a` DIV 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS (a <=> b) VIRTUAL + `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a=b) VIRTUAL + `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a >= b) VIRTUAL + `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a > b) VIRTUAL + `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is not null) VIRTUAL + `b` tinyint(1) AS ((`a` is not null)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is null) VIRTUAL + `b` tinyint(1) AS (isnull(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a << 2) VIRTUAL + `b` int(11) AS ((`a` << 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <= b) VIRTUAL + `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a < b) VIRTUAL + `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <> b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a != b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a>5 || a<3) VIRTUAL + `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a >> 2) VIRTUAL + `b` int(11) AS ((`a` >> 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a xor 5) VIRTUAL + `b` int(11) AS ((`a` xor 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL + `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL + `b` varchar(64) AS (date_format(`a`,'%W %M %D')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date(a)) VIRTUAL + `b` datetime AS (cast(`a` as date)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (datediff(a,'2000-01-01')) VIRTUAL + `b` bigint(20) AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (day(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(a)) VIRTUAL + `b` varchar(10) AS (dayname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(a)) VIRTUAL + `b` int(11) AS (dayofweek(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2170,7 +2170,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(a)) VIRTUAL + `b` int(11) AS (dayofyear(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2185,7 +2185,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from a)) VIRTUAL + `b` int(11) AS (extract(year from `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2200,7 +2200,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_days(a)) VIRTUAL + `b` datetime AS (from_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2215,7 +2215,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_unixtime(a)) VIRTUAL + `b` datetime AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2230,7 +2230,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL + `b` varchar(32) AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2245,7 +2245,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (hour(a)) VIRTUAL + `b` bigint(20) AS (hour(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2260,7 +2260,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(a)) VIRTUAL + `b` datetime AS (last_day(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2279,7 +2279,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(a,1)) VIRTUAL + `b` datetime AS (makedate(`a`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2294,7 +2294,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(a,1,3)) VIRTUAL + `b` time AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2309,7 +2309,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (microsecond(a)) VIRTUAL + `b` bigint(20) AS (microsecond(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2326,7 +2326,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(a)) VIRTUAL + `b` int(11) AS (minute(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2341,7 +2341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(a)) VIRTUAL + `b` int(11) AS (month(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2356,7 +2356,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(a)) VIRTUAL + `b` varchar(16) AS (monthname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2371,7 +2371,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(a,2)) VIRTUAL + `b` int(11) AS (period_add(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2387,7 +2387,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(a,b)) VIRTUAL + `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2402,7 +2402,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(a)) VIRTUAL + `b` int(11) AS (quarter(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2417,7 +2417,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` time AS (sec_to_time(a)) VIRTUAL + `b` time AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2432,7 +2432,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(a)) VIRTUAL + `b` int(11) AS (second(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2447,7 +2447,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL + `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2477,7 +2477,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2492,7 +2492,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL + `b` varchar(32) AS (time_format(`a`,'%r')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2507,7 +2507,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (time_to_sec(a)) VIRTUAL + `b` bigint(20) AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2522,7 +2522,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (time(a)) VIRTUAL + `b` time AS (cast(`a` as time)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2538,7 +2538,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` time AS (timediff(a,b)) VIRTUAL + `c` time AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2553,7 +2553,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestamp(a)) VIRTUAL + `b` timestamp AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL + `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2582,8 +2582,8 @@ create table t1 (a timestamp, c bigint generated always as (timestampdiff(MONTH, show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `c` bigint(20) AS (timestampdiff(MONTH, a, a)) VIRTUAL + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `c` bigint(20) AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01',default); select * from t1; @@ -2598,7 +2598,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (to_days(a)) VIRTUAL + `b` bigint(20) AS (to_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2613,7 +2613,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(a)) VIRTUAL + `b` int(11) AS (week(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(a)) VIRTUAL + `b` int(11) AS (weekday(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2643,7 +2643,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekofyear(a)) VIRTUAL + `b` int(11) AS (week(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2658,7 +2658,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(a)) VIRTUAL + `b` int(11) AS (year(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2673,7 +2673,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(a)) VIRTUAL + `b` int(11) AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2695,7 +2695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(a as unsigned)) VIRTUAL + `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (convert(a,unsigned)) VIRTUAL + `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2740,7 +2740,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (ExtractValue(a,'/b')) VIRTUAL + `b` varchar(1024) AS (extractvalue(`a`,'/b')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -2759,7 +2759,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2774,7 +2774,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(a)) VIRTUAL + `b` int(11) AS (bit_count(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2789,7 +2789,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (charset(a)) VIRTUAL + `b` varchar(1024) AS (charset(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2804,7 +2804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` int(11) AS (coercibility(a)) VIRTUAL + `b` int(11) AS (coercibility(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2819,7 +2819,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (collation(a)) VIRTUAL + `b` varchar(1024) AS (collation(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2834,7 +2834,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL + `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2849,7 +2849,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL + `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2864,7 +2864,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL + `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2878,7 +2878,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (des_encrypt(des_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2893,7 +2893,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL + `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2908,7 +2908,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(a)) VIRTUAL + `b` varbinary(32) AS (md5(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2923,7 +2923,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(a)) VIRTUAL + `b` varchar(1024) AS (password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2938,7 +2938,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha1(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2953,7 +2953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2968,7 +2968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha2(a,224)) VIRTUAL + `b` varchar(1024) AS (sha2(`a`,224)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2983,7 +2983,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL + `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/rpl_gcol.result b/mysql-test/suite/gcol/r/rpl_gcol.result index 245ce3ba2e5..3174858faa6 100644 --- a/mysql-test/suite/gcol/r/rpl_gcol.result +++ b/mysql-test/suite/gcol/r/rpl_gcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index 9837f567954..b28c411fcc5 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -30,11 +30,7 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' - ELSE 'Not Completed' - END) VIRTUAL, + `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -140,46 +136,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' - ELSE 'Not Completed' - END) VIRTUAL, - `ofis_deg_status2` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress2' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' - ELSE 'Not Completed2' - END) VIRTUAL, - `ofis_deg_status3` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress3' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' - ELSE 'Not Completed3' - END) VIRTUAL, - `ofis_deg_status4` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress4' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' - ELSE 'Not Completed4' - END) VIRTUAL, - `ofis_deg_status5` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress5' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' - ELSE 'Not Completed5' - END) VIRTUAL, - `ofis_deg_status6` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress6' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' - ELSE 'Not Completed6' - END) VIRTUAL, - `ofis_deg_status7` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress7' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' - ELSE 'Not Completed7' - END) VIRTUAL, - `ofis_deg_status8` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress8' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' - ELSE 'Not Completed8' - END) VIRTUAL, + `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -229,46 +193,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' - ELSE 'Not Completed' - END) VIRTUAL, - `ofis_deg_status2` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress2' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' - ELSE 'Not Completed2' - END) VIRTUAL, - `ofis_deg_status3` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress3' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' - ELSE 'Not Completed3' - END) VIRTUAL, - `ofis_deg_status4` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress4' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' - ELSE 'Not Completed4' - END) VIRTUAL, - `ofis_deg_status5` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress5' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' - ELSE 'Not Completed5' - END) VIRTUAL, - `ofis_deg_status6` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress6' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' - ELSE 'Not Completed6' - END) VIRTUAL, - `ofis_deg_status7` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress7' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' - ELSE 'Not Completed7' - END) VIRTUAL, - `ofis_deg_status8` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress8' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' - ELSE 'Not Completed8' - END) VIRTUAL, + `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`), KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`) @@ -338,46 +270,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' - ELSE 'Not Completed' - END) VIRTUAL, - `ofis_deg_status2` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress2' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' - ELSE 'Not Completed2' - END) VIRTUAL, - `ofis_deg_status3` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress3' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' - ELSE 'Not Completed3' - END) VIRTUAL, - `ofis_deg_status4` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress4' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' - ELSE 'Not Completed4' - END) VIRTUAL, - `ofis_deg_status5` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress5' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' - ELSE 'Not Completed5' - END) VIRTUAL, - `ofis_deg_status6` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress6' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' - ELSE 'Not Completed6' - END) VIRTUAL, - `ofis_deg_status7` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress7' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' - ELSE 'Not Completed7' - END) VIRTUAL, - `ofis_deg_status8` varchar(15) AS (CASE -WHEN wdraw_rsn = '' THEN 'In progress8' - WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' - ELSE 'Not Completed8' - END) VIRTUAL, + `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index ced3a1d0b25..0c7b47edcda 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -7,7 +7,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY (a) @@ -37,7 +37,7 @@ partition by key (a) partitions 12; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY (a) diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 7939df21d67..40efba9d984 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -7,7 +7,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) @@ -37,7 +37,7 @@ partition by key (a) partitions 12; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) diff --git a/mysql-test/suite/rpl/r/rpl_default.result b/mysql-test/suite/rpl/r/rpl_default.result index a1629b99bb3..3195046a42d 100644 --- a/mysql-test/suite/rpl/r/rpl_default.result +++ b/mysql-test/suite/rpl/r/rpl_default.result @@ -8,7 +8,7 @@ connection slave; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT (1+1), + `a` int(11) DEFAULT ((1 + 1)), `b` bigint(20) DEFAULT uuid_short(), `u` blob DEFAULT user() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index 815c2599a65..a07bac9340c 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -675,7 +675,7 @@ t16 CREATE TABLE `t16` ( `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, `c6` int(11) DEFAULT 1, - `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `c7` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY (c1) diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 0d249834e70..280afed0385 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -675,7 +675,7 @@ t16 CREATE TABLE `t16` ( `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, `c6` int(11) DEFAULT 1, - `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `c7` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (c1) diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result index 075cbc14fe7..a000384909c 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_engine.result +++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result @@ -21,7 +21,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection slave; @@ -38,7 +38,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; @@ -80,7 +80,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 connection master; @@ -122,7 +122,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 connection master; @@ -164,7 +164,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 connection slave; @@ -181,7 +181,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; @@ -223,7 +223,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 connection master; @@ -265,7 +265,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 connection master; @@ -307,7 +307,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 connection slave; @@ -324,7 +324,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; @@ -366,7 +366,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 connection master; @@ -408,7 +408,7 @@ t1 CREATE TABLE `t1` ( `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, - `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 connection master; diff --git a/mysql-test/suite/rpl/r/rpl_partition_innodb.result b/mysql-test/suite/rpl/r/rpl_partition_innodb.result index 4494b757291..4657ed7dde5 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_partition_innodb.result @@ -55,7 +55,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -69,7 +69,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -99,7 +99,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -113,7 +113,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, diff --git a/mysql-test/suite/rpl/r/rpl_partition_memory.result b/mysql-test/suite/rpl/r/rpl_partition_memory.result index 6073352210d..1d57c48ad78 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_memory.result +++ b/mysql-test/suite/rpl/r/rpl_partition_memory.result @@ -55,7 +55,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -69,7 +69,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -99,7 +99,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -113,7 +113,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, diff --git a/mysql-test/suite/rpl/r/rpl_partition_myisam.result b/mysql-test/suite/rpl/r/rpl_partition_myisam.result index 8d6cd8e3b77..42ad10c8cf1 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_partition_myisam.result @@ -55,7 +55,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -69,7 +69,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -99,7 +99,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -113,7 +113,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result index 41b3ca9d6fe..ac0a419b7e5 100644 --- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result +++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result @@ -12,14 +12,14 @@ Table Create Table mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` ( `a` time DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE mysql050614_temporal1; Table Create Table mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` ( `a` time(1) DEFAULT NULL, `b` datetime(1) DEFAULT NULL, - `c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1) + `c` timestamp(1) NOT NULL DEFAULT current_timestamp(1) ON UPDATE current_timestamp(1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection slave; SELECT @@mysql56_temporal_format; diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result index 2e3af3367ff..ace11d5bd6e 100644 --- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result +++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result @@ -15,14 +15,14 @@ Table Create Table mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` ( `a` time DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE mysql050614_temporal1; Table Create Table mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` ( `a` time(1) DEFAULT NULL, `b` datetime(1) DEFAULT NULL, - `c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1) + `c` timestamp(1) NOT NULL DEFAULT current_timestamp(1) ON UPDATE current_timestamp(1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection slave; SELECT @@mysql56_temporal_format; diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result index cdf612e6db8..f214e6d7dac 100644 --- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result +++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result @@ -2,7 +2,7 @@ CREATE TABLE t1 (a TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP NULL); @@ -32,7 +32,7 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL); @@ -60,7 +60,7 @@ CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'); @@ -81,14 +81,14 @@ CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -96,7 +96,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NULL DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -104,7 +104,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT '0000-00-00 00:00:00'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -112,7 +112,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -120,7 +120,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00') SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -128,39 +128,39 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `b` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `i` int(1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 (b TIMESTAMP) AS SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; @@ -170,6 +170,6 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result index 1c42da57bfc..5219fd4e9c4 100644 --- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result +++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result @@ -37,7 +37,7 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL); @@ -65,7 +65,7 @@ CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'); @@ -86,7 +86,7 @@ CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `a` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL); @@ -134,7 +134,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NULL DEFAULT NULL, - `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `b` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP); @@ -142,7 +142,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NULL DEFAULT NULL, - `b` timestamp NULL DEFAULT CURRENT_TIMESTAMP + `b` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP); @@ -150,7 +150,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NULL DEFAULT NULL, - `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + `b` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i; diff --git a/mysql-test/suite/vcol/r/delayed.result b/mysql-test/suite/vcol/r/delayed.result new file mode 100644 index 00000000000..ba3ac5c1c65 --- /dev/null +++ b/mysql-test/suite/vcol/r/delayed.result @@ -0,0 +1,7 @@ +create table t (a int primary key, b int, c int as (b), index (c)); +insert t (a,b) values (10,1); +replace delayed t (a,b) values (10,5); +check table t; +Table Op Msg_type Msg_text +test.t check status OK +drop table t; diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result index 934a84cc3cc..7bad8e9f6d4 100644 --- a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result +++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result @@ -9,7 +9,7 @@ alter table t1 auto_increment = 3; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` int(11) AS (1+1) VIRTUAL, + `c2` int(11) AS ((1 + 1)) VIRTUAL, `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index a20719ad813..2ec225b0ff6 100644 --- a/mysql-test/suite/vcol/r/rpl_vcol.result +++ b/mysql-test/suite/vcol/r/rpl_vcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result index dd580c344b0..6605f7c99b4 100644 --- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result @@ -21,25 +21,25 @@ create or replace table t1 (a datetime as (current_time()) PERSISTENT); ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a` # CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP create or replace table t1 (a datetime as (current_timestamp()) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `a` create or replace table t1 (a datetime as (current_timestamp) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `a` # CURTIME() create or replace table t1 (a datetime as (curtime()) PERSISTENT); ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a` # LOCALTIME(), LOCALTIME create or replace table t1 (a datetime, b varchar(10) as (localtime()) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` create or replace table t1 (a datetime, b varchar(10) as (localtime) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` # LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) create or replace table t1 (a datetime, b varchar(10) as (localtimestamp()) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` create or replace table t1 (a datetime, b varchar(10) as (localtimestamp) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` # NOW() create or replace table t1 (a datetime, b varchar(10) as (now()) PERSISTENT); -ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` # SYSDATE() create or replace table t1 (a int, b varchar(10) as (sysdate()) PERSISTENT); ERROR HY000: Function or expression 'sysdate()' cannot be used in the GENERATED ALWAYS AS clause of `b` @@ -242,7 +242,7 @@ drop function sub1; create or replace table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); drop table t1; create or replace table t1 (a int, b varchar(16384) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); -ERROR HY000: Table definition is too large +ERROR HY000: Expression in the GENERATED ALWAYS AS clause is too big # # Constant expression create or replace table t1 (a int as (PI()) PERSISTENT); diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result index e66c2d3a3c3..42b852a7c6c 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result @@ -54,7 +54,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -67,7 +67,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -87,7 +87,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -109,7 +109,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result index d60a3cf1a51..7af1d35b67f 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result @@ -54,7 +54,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -67,7 +67,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -87,7 +87,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment' + `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -109,7 +109,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 79450d41684..843bd6efc8e 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -13,7 +13,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -28,7 +28,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -57,7 +57,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -70,7 +70,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index a62fc2ffda0..2a551956173 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -129,7 +129,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -144,7 +144,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -186,7 +186,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a*2) PERSISTENT, + `b` int(11) AS ((`a` * 2)) PERSISTENT, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index d4a583c34b2..4aeeda38cc1 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -130,7 +130,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(32) DEFAULT NULL, - `v` char(32) CHARACTER SET ucs2 AS (a) VIRTUAL + `v` char(32) CHARACTER SET ucs2 AS (`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a int, b int); @@ -155,7 +155,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` char(2) NOT NULL, - `c` enum('Y','N') AS (case when b = 'aa' then 'Y' else 'N' end) PERSISTENT + `c` enum('Y','N') AS ((case when (`b` = 'aa') then 'Y' else 'N' end)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1(a,b) values (1,'bb'), (2,'aa'), (3,'cc'); select * from t1; @@ -173,7 +173,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` set('y','n') AS (if(a=0,if(b=0,('n,n'),('n,y')),if(b=0,('y,n'),('y,y')))) PERSISTENT + `c` set('y','n') AS (if((`a` = 0),if((`b` = 0),'n,n','n,y'),if((`b` = 0),'y,n','y,y'))) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t2(a,b) values (7,0), (2,3), (0,1); select * from t2; @@ -227,7 +227,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) AS (a > '2') VIRTUAL + `b` bigint(20) AS ((`a` > '2')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -244,7 +244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) AS (a between 0 and 2) VIRTUAL + `b` bigint(20) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -261,7 +261,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL, - `b` char(10) AS (a between 0 and 2) VIRTUAL + `b` char(10) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -284,8 +284,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(32) DEFAULT NULL, - `c` int(11) AS (a MOD 10) VIRTUAL, - `d` varchar(5) AS (LEFT(b,5)) PERSISTENT + `c` int(11) AS ((`a` % 10)) VIRTUAL, + `d` varchar(5) AS (left(`b`,5)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra @@ -324,7 +324,7 @@ create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=lat show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v1` varchar(255) AS (c1) PERSISTENT, + `v1` varchar(255) AS (`c1`) PERSISTENT, `c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci drop table t1; @@ -339,7 +339,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (TIMESTAMP(a)) VIRTUAL + `b` timestamp AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP); @@ -347,7 +347,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (TIMESTAMP(a)) VIRTUAL, + `b` timestamp AS (cast(`a` as datetime)) VIRTUAL, `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result index 76482b39d79..c026637c0a5 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -92,7 +92,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) VIRTUAL, + `c` int(11) AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -194,7 +194,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) PERSISTENT, + `c` int(11) AS (dayofyear(`b`)) PERSISTENT, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -216,7 +216,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) PERSISTENT + `c` int(11) AS (week(`b`,1)) PERSISTENT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 15. ALTER. Changing the expression of a virtual non-stored column. @@ -237,7 +237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) VIRTUAL + `c` int(11) AS (week(`b`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result index 233f6778ca9..172fc631f08 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) PERSISTENT + `b` int(11) AS ((`a` % 2)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -92,7 +92,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 2) VIRTUAL + `b` int(11) AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) VIRTUAL, + `c` int(11) AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -194,7 +194,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(b)) PERSISTENT, + `c` int(11) AS (dayofyear(`b`)) PERSISTENT, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -216,7 +216,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) PERSISTENT + `c` int(11) AS (week(`b`,1)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 15. ALTER. Changing the expression of a virtual non-stored column. @@ -237,7 +237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(b,1)) VIRTUAL + `c` int(11) AS (week(`b`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index a6f69edab1a..328184aabca 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -9,7 +9,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(a)) VIRTUAL + `b` int(11) AS (abs(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(a),6)) VIRTUAL + `b` double AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -43,7 +43,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(a),6)) VIRTUAL + `b` double AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -61,7 +61,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -77,7 +77,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(a),6)) VIRTUAL + `c` double AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -95,7 +95,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan2(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -112,7 +112,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceil(a)) VIRTUAL + `b` int(11) AS (ceiling(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -131,7 +131,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(a,b,c)) VIRTUAL + `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -152,7 +152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(a),6)) VIRTUAL + `b` double AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -167,7 +167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(a),6)) VIRTUAL + `b` double AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); insert into t1 values (1,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (crc32(a)) VIRTUAL + `b` mediumtext AS (crc32(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(a),6)) VIRTUAL + `b` double AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a/2) VIRTUAL + `b` double AS ((`a` / 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(a),6)) VIRTUAL + `b` double AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` mediumtext AS (floor(a)) VIRTUAL + `b` mediumtext AS (floor(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(a),6)) VIRTUAL + `b` double AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(a,b),6)) VIRTUAL + `c` double AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(a),6)) VIRTUAL + `b` double AS (format(log(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(a),6)) VIRTUAL + `b` double AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(a),6)) VIRTUAL + `b` double AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a-1) VIRTUAL + `b` double AS ((`a` - 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (mod(a,10)) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 10) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (oct(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(PI()*a*a,6)) VIRTUAL + `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(a,2)) VIRTUAL, - `c` int(11) AS (power(a,2)) VIRTUAL + `b` int(11) AS (pow(`a`,2)) VIRTUAL, + `c` int(11) AS (pow(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(a),6)) VIRTUAL + `b` double AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(a)) VIRTUAL + `b` int(11) AS (round(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(a,b)) VIRTUAL + `c` int(11) AS (round(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(a)) VIRTUAL + `b` int(11) AS (sign(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(a),6)) VIRTUAL + `b` double AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(a),6)) VIRTUAL + `b` double AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(a),6)) VIRTUAL + `b` double AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a*3) VIRTUAL + `b` double AS ((`a` * 3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(a,4)) VIRTUAL + `b` double AS (truncate(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-a) VIRTUAL + `b` double AS (-(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(a)) VIRTUAL + `b` int(11) AS (ascii(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (bin(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (bit_length(a)) VIRTUAL + `b` mediumtext AS (bit_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (char_length(a)) VIRTUAL + `b` mediumtext AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(a,b)) VIRTUAL + `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (character_length(a)) VIRTUAL + `b` mediumtext AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL + `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(a,',',b)) VIRTUAL + `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(c,a,b)) VIRTUAL + `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL + `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',a,b)) VIRTUAL + `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(a,b)) VIRTUAL + `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(a,2)) VIRTUAL + `b` varchar(20) AS (format(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL + `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (instr(a,b)) VIRTUAL + `c` int(11) AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(a,5)) VIRTUAL + `b` varchar(5) AS (left(`a`,5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a like 'H%!o' escape '!') VIRTUAL + `b` tinyint(1) AS ((`a` like 'H%!o' escape '!')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lower(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL + `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(a)) VIRTUAL + `b` varchar(10) AS (ltrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL + `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (mid(a,1,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not like 'H%o') VIRTUAL + `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (octet_length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (ord(a)) VIRTUAL + `b` mediumtext AS (ord(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (position('bar' in a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(a)) VIRTUAL + `b` varchar(10) AS (quote(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(a,3)) VIRTUAL + `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL + `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(a)) VIRTUAL + `b` varchar(30) AS (reverse(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(a,4)) VIRTUAL + `b` varchar(10) AS (right(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL + `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(a)) VIRTUAL + `b` varchar(10) AS (rtrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(a)) VIRTUAL + `b` varchar(20) AS (soundex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a sounds like b) VIRTUAL + `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(a,space(5))) VIRTUAL + `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL + `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(a,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL + `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(a)) VIRTUAL + `b` varchar(10) AS (trim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(a)) VIRTUAL + `b` varchar(10) AS (unhex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (upper(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1482,7 +1482,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL + `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1502,7 +1502,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if(a=1,a,b)) VIRTUAL + `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1520,7 +1520,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL + `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1537,7 +1537,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL + `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1557,7 +1557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a>0 && a<2) VIRTUAL + `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1574,7 +1574,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1591,7 +1591,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (binary a) VIRTUAL + `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1608,7 +1608,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a & 5) VIRTUAL + `b` int(11) AS ((`a` & 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1625,7 +1625,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~a) VIRTUAL + `b` int(11) AS (~(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1642,7 +1642,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a | 5) VIRTUAL + `b` int(11) AS ((`a` | 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1661,7 +1661,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a ^ 5) VIRTUAL + `b` int(11) AS ((`a` ^ 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1680,7 +1680,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a div 5) VIRTUAL + `b` int(11) AS ((`a` DIV 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1698,7 +1698,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS (a <=> b) VIRTUAL + `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1718,7 +1718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a=b) VIRTUAL + `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1736,7 +1736,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a >= b) VIRTUAL + `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1754,7 +1754,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a > b) VIRTUAL + `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1771,7 +1771,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is not null) VIRTUAL + `b` tinyint(1) AS ((`a` is not null)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1788,7 +1788,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is null) VIRTUAL + `b` tinyint(1) AS (isnull(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1805,7 +1805,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a << 2) VIRTUAL + `b` int(11) AS ((`a` << 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1823,7 +1823,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <= b) VIRTUAL + `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1843,7 +1843,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a < b) VIRTUAL + `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1862,7 +1862,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1880,7 +1880,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <> b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1900,7 +1900,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a != b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1919,7 +1919,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a>5 || a<3) VIRTUAL + `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1936,7 +1936,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a >> 2) VIRTUAL + `b` int(11) AS ((`a` >> 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1953,7 +1953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a xor 5) VIRTUAL + `b` int(11) AS ((`a` xor 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1975,7 +1975,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL + `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date(a)) VIRTUAL + `b` datetime AS (cast(`a` as date)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (datediff(a,'2000-01-01')) VIRTUAL + `b` mediumtext AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (day(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(a)) VIRTUAL + `b` int(11) AS (dayofweek(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(a)) VIRTUAL + `b` int(11) AS (dayofyear(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from a)) VIRTUAL + `b` int(11) AS (extract(year from `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_days(a)) VIRTUAL + `b` datetime AS (from_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2171,7 +2171,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_unixtime(a)) VIRTUAL + `b` datetime AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2186,7 +2186,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (hour(a)) VIRTUAL + `b` mediumtext AS (hour(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2201,7 +2201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(a)) VIRTUAL + `b` datetime AS (last_day(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2220,7 +2220,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(a,1)) VIRTUAL + `b` datetime AS (makedate(`a`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2235,7 +2235,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(a,1,3)) VIRTUAL + `b` time AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2250,7 +2250,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (microsecond(a)) VIRTUAL + `b` mediumtext AS (microsecond(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2267,7 +2267,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(a)) VIRTUAL + `b` int(11) AS (minute(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2282,7 +2282,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(a)) VIRTUAL + `b` int(11) AS (month(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2297,7 +2297,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(a,2)) VIRTUAL + `b` int(11) AS (period_add(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2313,7 +2313,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(a,b)) VIRTUAL + `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2328,7 +2328,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(a)) VIRTUAL + `b` int(11) AS (quarter(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2343,7 +2343,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` time AS (sec_to_time(a)) VIRTUAL + `b` time AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2358,7 +2358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(a)) VIRTUAL + `b` int(11) AS (second(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2373,7 +2373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL + `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2388,7 +2388,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2403,7 +2403,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2418,7 +2418,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (time_to_sec(a)) VIRTUAL + `b` mediumtext AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2433,7 +2433,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (time(a)) VIRTUAL + `b` time AS (cast(`a` as time)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2449,7 +2449,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` mediumtext AS (timediff(a,b)) VIRTUAL + `c` mediumtext AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2464,7 +2464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestamp(a)) VIRTUAL + `b` timestamp AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2479,7 +2479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL + `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2493,9 +2493,9 @@ create table t1 (a timestamp, b timestamp, c long as (timestampdiff(MONTH, a,b)) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c` mediumtext AS (timestampdiff(MONTH, a,b)) VIRTUAL + `c` mediumtext AS (timestampdiff(MONTH,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01','2003-05-01',default); select * from t1; @@ -2510,7 +2510,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (to_days(a)) VIRTUAL + `b` mediumtext AS (to_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2525,7 +2525,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(a,0)) VIRTUAL + `b` int(11) AS (week(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2540,7 +2540,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(a)) VIRTUAL + `b` int(11) AS (weekday(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2555,7 +2555,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekofyear(a)) VIRTUAL + `b` int(11) AS (week(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2570,7 +2570,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(a)) VIRTUAL + `b` int(11) AS (year(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2585,7 +2585,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(a)) VIRTUAL + `b` int(11) AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2607,7 +2607,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (cast(a as unsigned)) VIRTUAL + `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (convert(a,unsigned)) VIRTUAL + `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2656,7 +2656,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2671,7 +2671,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(a)) VIRTUAL + `b` int(11) AS (bit_count(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2686,7 +2686,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL + `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2701,7 +2701,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL + `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL + `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2731,7 +2731,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL + `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2746,7 +2746,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(a)) VIRTUAL + `b` varbinary(32) AS (md5(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2761,7 +2761,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (old_password(a)) VIRTUAL + `b` varchar(1024) AS (old_password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2776,7 +2776,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(a)) VIRTUAL + `b` varchar(1024) AS (password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2791,7 +2791,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha1(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2806,7 +2806,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2821,7 +2821,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL + `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; @@ -2836,7 +2836,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (monthname(a)) VIRTUAL + `b` varchar(100) AS (monthname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2010-10-10',default); select * from t1; @@ -2851,7 +2851,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (dayname(a)) VIRTUAL + `b` varchar(100) AS (dayname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2011-11-11',default); select * from t1; @@ -2866,7 +2866,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (date_format(a, '%W %a %M %b')) VIRTUAL + `b` varchar(100) AS (date_format(`a`,'%W %a %M %b')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2012-12-12',default); select * from t1; @@ -2896,7 +2896,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (time_format(a,"%d.%m.%Y")) VIRTUAL + `b` varchar(10) AS (time_format(`a`,'%d.%m.%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2001-01-01 02:02:02',default); select * from t1; diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 8515d790359..14c376797d6 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -5,7 +5,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a+1) virtual); @@ -13,7 +13,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL + `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a+1) persistent); @@ -21,7 +21,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) PERSISTENT + `b` int(11) AS ((`a` + 1)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set session sql_mode='ORACLE'; @@ -30,7 +30,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (a+1) VIRTUAL + "b" int(11) AS (("a" + 1)) VIRTUAL ) drop table t1; create table t1 (a int, b int generated always as (a+1) virtual); @@ -38,7 +38,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (a+1) VIRTUAL + "b" int(11) AS (("a" + 1)) VIRTUAL ) drop table t1; create table t1 (a int, b int as (a+1) persistent); @@ -46,7 +46,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (a+1) PERSISTENT + "b" int(11) AS (("a" + 1)) PERSISTENT ) drop table t1; set session sql_mode=@OLD_SQL_MODE; diff --git a/mysql-test/suite/vcol/t/delayed.test b/mysql-test/suite/vcol/t/delayed.test new file mode 100644 index 00000000000..62065abdba8 --- /dev/null +++ b/mysql-test/suite/vcol/t/delayed.test @@ -0,0 +1,5 @@ +create table t (a int primary key, b int, c int as (b), index (c)); +insert t (a,b) values (10,1); +replace delayed t (a,b) values (10,5); +check table t; +drop table t; diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc index 492082af30c..708dbd42a8d 100644 --- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc @@ -345,7 +345,7 @@ eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long --disable_query_log let $tmp_long_string = `SELECT repeat('a',65535)`; ---error ER_TOO_MANY_FIELDS +--error ER_EXPRESSION_IS_TOO_BIG eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long_string'))); --enable_query_log diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 5f00debbc3a..6eca3a64562 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -448,11 +448,12 @@ DEALLOCATE PREPARE stmt; # We can't have an expression for prepared statements # -PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?+?))'; +prepare stmt from 'create table t1 (a int default(?+?))'; set @a=1; ---error ER_PARSE_ERROR execute stmt using @a,@a; -DEALLOCATE PREPARE stmt; +deallocate prepare stmt; +show create table t1; +drop table t1; --echo # --echo # Parenthesized Item_basic_constant @@ -1974,3 +1975,21 @@ DROP TABLE t1; --echo # end of 10.2 test + +# +# ANSI_QUOTES +# +set sql_mode=ansi_quotes; +create table t1 (a int, b int default (a+1)); +show create table t1; +insert t1 (a) values (10); +set sql_mode=''; +show create table t1; +insert t1 (a) values (20); +flush tables; +show create table t1; +insert t1 (a) values (30); +select * from t1; +drop table t1; +set sql_mode=default; + diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test index 75544f58ce8..720d483e8ed 100644 --- a/mysql-test/t/partition_bug18198.test +++ b/mysql-test/t/partition_bug18198.test @@ -163,7 +163,7 @@ create table t1 (col1 date) partition by range(unix_timestamp(col1)) (partition p0 values less than (10), partition p1 values less than (30)); --- error ER_PARSE_ERROR +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (col1 datetime) partition by range(week(col1)) (partition p0 values less than (10), partition p1 values less than (30)); diff --git a/sql/field.cc b/sql/field.cc index be6259e6a11..88af4f321dd 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4956,8 +4956,8 @@ Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg, this field will be automaticly updated on insert. */ flags|= TIMESTAMP_FLAG; - flags|= ON_UPDATE_NOW_FLAG; - DBUG_ASSERT(unireg_check == TIMESTAMP_UN_FIELD); + if (unireg_check != TIMESTAMP_DN_FIELD) + flags|= ON_UPDATE_NOW_FLAG; } } @@ -9773,35 +9773,32 @@ void Column_definition::create_length_to_internal_length(void) } -bool check_expression(Virtual_column_info *vcol, const char *type, - const char *name, bool must_be_determinstic) +bool check_expression(Virtual_column_info *vcol, const char *name, + enum_vcol_info_type type) + { bool ret; Item::vcol_func_processor_result res; - /* We use 2 bytes to store the expression length */ - if (vcol->expr_str.length > UINT_MAX32) - { - my_error(ER_EXPRESSION_IS_TOO_BIG, MYF(0), type, name); - return TRUE; - } + + if (!vcol->name.length) + vcol->name.str= const_cast(name); /* Walk through the Item tree checking if all items are valid to be part of the virtual column */ - res.errors= 0; ret= vcol->expr_item->walk(&Item::check_vcol_func_processor, 0, &res); vcol->flags= res.errors; uint filter= VCOL_IMPOSSIBLE; - if (must_be_determinstic) + if (type != VCOL_GENERATED_VIRTUAL && type != VCOL_DEFAULT) filter|= VCOL_NOT_STRICTLY_DETERMINISTIC; if (ret || (res.errors & filter)) { my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, - type, name); + vcol_type_name(type), name); return TRUE; } /* @@ -9826,20 +9823,19 @@ bool Column_definition::check(THD *thd) { DBUG_ASSERT(vcol_info->expr_item); vcol_info->set_field_type(sql_type); - if (check_expression(vcol_info, "GENERATED ALWAYS AS", field_name, - vcol_info->stored_in_db)) + if (check_expression(vcol_info, field_name, vcol_info->stored_in_db + ? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL)) DBUG_RETURN(TRUE); } if (check_constraint && - check_expression(check_constraint, "CHECK", field_name, 0)) - DBUG_RETURN(1); + check_expression(check_constraint, field_name, VCOL_CHECK_FIELD)) + DBUG_RETURN(1); if (default_value) { Item *def_expr= default_value->expr_item; - - if (check_expression(default_value, "DEFAULT", field_name, 0)) + if (check_expression(default_value, field_name, VCOL_DEFAULT)) DBUG_RETURN(TRUE); /* Constant's are stored in the 'empty_record', except for blobs */ @@ -10556,8 +10552,8 @@ Column_definition::Column_definition(THD *thd, Field *old_field, if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) && old_field->ptr != NULL && orig_field != NULL) { - if (orig_field->has_update_default_function()) - unireg_check= Field::TIMESTAMP_UN_FIELD; + if (orig_field->unireg_check != Field::NEXT_NUMBER) + unireg_check= orig_field->unireg_check; /* Get the value from default_values */ const uchar *dv= orig_field->table->s->default_values; @@ -10567,8 +10563,6 @@ Column_definition::Column_definition(THD *thd, Field *old_field, String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv)); char *pos= (char*) thd->strmake(res->ptr(), res->length()); default_value= new (thd->mem_root) Virtual_column_info(); - default_value->expr_str.str= pos; - default_value->expr_str.length= res->length(); default_value->expr_item= new (thd->mem_root) Item_string(thd, pos, res->length(), charset); default_value->utf8= 0; diff --git a/sql/field.h b/sql/field.h index c44463248a3..83997c70032 100644 --- a/sql/field.h +++ b/sql/field.h @@ -560,6 +560,28 @@ inline bool is_temporal_type_with_time(enum_field_types type) } } +enum enum_vcol_info_type +{ + VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED, + VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE +}; + +static inline const char *vcol_type_name(enum_vcol_info_type type) +{ + switch (type) + { + case VCOL_GENERATED_VIRTUAL: + case VCOL_GENERATED_STORED: + return "GENERATED ALWAYS AS"; + case VCOL_DEFAULT: + return "DEFAULT"; + case VCOL_CHECK_FIELD: + case VCOL_CHECK_TABLE: + return "CHECK"; + } + return 0; +} + /* Flags for Virtual_column_info. If none is set, the expression must be a constant with no side-effects, so it's calculated at CREATE TABLE time, @@ -599,10 +621,7 @@ public: /* Flag indicating that the field is physically stored in the database */ bool stored_in_db; bool utf8; /* Already in utf8 */ - /* The expression to compute the value of the virtual column */ Item *expr_item; - /* Text representation of the defining expression */ - LEX_STRING expr_str; LEX_STRING name; /* Name of constraint */ uint flags; @@ -611,7 +630,7 @@ public: in_partitioning_expr(FALSE), stored_in_db(FALSE), utf8(TRUE), expr_item(NULL), flags(0) { - expr_str.str= name.str= NULL; + name.str= NULL; name.length= 0; }; ~Virtual_column_info() {} @@ -640,13 +659,8 @@ public: { in_partitioning_expr= TRUE; } - bool is_equal(const Virtual_column_info* vcol) const - { - return field_type == vcol->get_real_type() - && stored_in_db == vcol->is_stored() - && expr_str.length == vcol->expr_str.length - && memcmp(expr_str.str, vcol->expr_str.str, expr_str.length) == 0; - } + inline bool is_equal(const Virtual_column_info* vcol) const; + void print(String*); }; class Field: public Value_source @@ -920,7 +934,12 @@ public: bool has_update_default_function() const { - return unireg_check == TIMESTAMP_UN_FIELD; + return flags & ON_UPDATE_NOW_FLAG; + } + bool has_default_now_unireg_check() const + { + return unireg_check == TIMESTAMP_DN_FIELD + || unireg_check == TIMESTAMP_DNUN_FIELD; } /* @@ -940,14 +959,6 @@ public: } virtual void set_explicit_default(Item *value); - /** - Evaluates the @c INSERT default function and stores the result in the - field. If no such function exists for the column, or the function is not - valid for the column's data type, invoking this function has no effect. - */ - virtual int evaluate_insert_default_function() { return 0; } - - /** Evaluates the @c UPDATE default function, if one exists, and stores the result in the record buffer. If no such function exists for the column, @@ -2785,7 +2796,11 @@ public: const char *field_name_arg) :Field_temporal_with_date(ptr_arg, length_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg) - {} + { + if (unireg_check == TIMESTAMP_UN_FIELD || + unireg_check == TIMESTAMP_DNUN_FIELD) + flags|= ON_UPDATE_NOW_FLAG; + } enum_field_types type() const { return MYSQL_TYPE_DATETIME;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; } double val_real(void); @@ -3779,8 +3794,7 @@ public: bool has_default_function() const { - return (unireg_check == Field::TIMESTAMP_UN_FIELD || - unireg_check == Field::NEXT_NUMBER); + return unireg_check != Field::NONE; } Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, @@ -3801,6 +3815,12 @@ public: } /* Return true if default is an expression that must be saved explicitely */ bool has_default_expression(); + + bool has_default_now_unireg_check() const + { + return unireg_check == Field::TIMESTAMP_DN_FIELD + || unireg_check == Field::TIMESTAMP_DNUN_FIELD; + } }; @@ -3897,8 +3917,8 @@ uint32 calc_pack_length(enum_field_types type,uint32 length); int set_field_to_null(Field *field); int set_field_to_null_with_conversions(Field *field, bool no_conversions); int convert_null_to_field_value_or_error(Field *field); -bool check_expression(Virtual_column_info *vcol, const char *type, - const char *name, bool must_be_deterministic); +bool check_expression(Virtual_column_info *vcol, const char *name, + enum_vcol_info_type type); /* The following are for the interface with the .frm file diff --git a/sql/item.cc b/sql/item.cc index 04c573ee8b4..c8cff0859c0 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2638,16 +2638,50 @@ void Item_ident::print(String *str, enum_query_type query_type) THD *thd= current_thd; char d_name_buff[MAX_ALIAS_NAME], t_name_buff[MAX_ALIAS_NAME]; const char *d_name= db_name, *t_name= table_name; + bool use_table_name= table_name && table_name[0]; + bool use_db_name= use_table_name && db_name && db_name[0] && !alias_name_used; + + if (use_db_name && (query_type & QT_ITEM_IDENT_SKIP_DB_NAMES)) + use_db_name= !thd->db || strcmp(thd->db, db_name); + + if (use_db_name) + use_db_name= !(cached_table && cached_table->belong_to_view && + cached_table->belong_to_view->compact_view_format); + + if (!use_db_name && use_table_name && + (query_type & QT_ITEM_IDENT_SKIP_TABLE_NAMES)) + { + /* + Don't print the table name if it's the only table in the context + XXX technically, that's a sufficient, but too strong condition + */ + if (!context) + use_table_name= false; + else if (context->outer_context) + use_table_name= true; + else if (context->last_name_resolution_table == context->first_name_resolution_table) + use_table_name= false; + else if (!context->last_name_resolution_table && + !context->first_name_resolution_table->next_name_resolution_table) + use_table_name= false; + } + + if (!field_name || !field_name[0]) + { + append_identifier(thd, str, STRING_WITH_LEN("tmp_field")); + return; + } + if (lower_case_table_names== 1 || (lower_case_table_names == 2 && !alias_name_used)) { - if (table_name && table_name[0]) + if (use_table_name) { strmov(t_name_buff, table_name); my_casedn_str(files_charset_info, t_name_buff); t_name= t_name_buff; } - if (db_name && db_name[0]) + if (use_db_name) { strmov(d_name_buff, db_name); my_casedn_str(files_charset_info, d_name_buff); @@ -2655,43 +2689,18 @@ void Item_ident::print(String *str, enum_query_type query_type) } } - if (!table_name || !field_name || !field_name[0]) + if (use_db_name) { - const char *nm= (field_name && field_name[0]) ? - field_name : name ? name : "tmp_field"; - append_identifier(thd, str, nm, (uint) strlen(nm)); - return; - } - if (db_name && db_name[0] && !alias_name_used) - { - /* - When printing EXPLAIN, don't print database name when it's the same as - current database. - */ - bool skip_db= (query_type & QT_ITEM_IDENT_SKIP_CURRENT_DATABASE) && - thd->db && !strcmp(thd->db, db_name); - if (!skip_db && - !(cached_table && cached_table->belong_to_view && - cached_table->belong_to_view->compact_view_format)) - { - append_identifier(thd, str, d_name, (uint)strlen(d_name)); - str->append('.'); - } - append_identifier(thd, str, t_name, (uint)strlen(t_name)); + append_identifier(thd, str, d_name, (uint)strlen(d_name)); str->append('.'); - append_identifier(thd, str, field_name, (uint)strlen(field_name)); + DBUG_ASSERT(use_table_name); } - else + if (use_table_name) { - if (table_name[0]) - { - append_identifier(thd, str, t_name, (uint) strlen(t_name)); - str->append('.'); - append_identifier(thd, str, field_name, (uint) strlen(field_name)); - } - else - append_identifier(thd, str, field_name, (uint) strlen(field_name)); + append_identifier(thd, str, t_name, (uint) strlen(t_name)); + str->append('.'); } + append_identifier(thd, str, field_name, (uint) strlen(field_name)); } /* ARGSUSED */ @@ -10442,3 +10451,12 @@ void Item::register_in(THD *thd) next= thd->free_list; thd->free_list= this; } + +void Virtual_column_info::print(String *str) +{ + expr_item->print(str, (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF | + QT_ITEM_IDENT_SKIP_DB_NAMES | + QT_ITEM_IDENT_SKIP_TABLE_NAMES | + QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | + QT_TO_SYSTEM_CHARSET)); +} diff --git a/sql/item.h b/sql/item.h index 1aa613a25b8..c3128b35c52 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2583,6 +2583,7 @@ public: bool update_vcol_processor(void *arg); bool check_vcol_func_processor(void *arg) { + context= 0; return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF); } void cleanup(); @@ -5783,5 +5784,11 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str, bool escape_used_in_parsing, CHARSET_INFO *cmp_cs, int *escape); +inline bool Virtual_column_info::is_equal(const Virtual_column_info* vcol) const +{ + return field_type == vcol->get_real_type() + && stored_in_db == vcol->is_stored() + && expr_item->eq(vcol->expr_item, true); +} #endif /* SQL_ITEM_INCLUDED */ diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c35606781ec..a9aaf5dd241 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1651,6 +1651,15 @@ bool Item_func_curtime::get_date(MYSQL_TIME *res, return 0; } +void Item_func_curtime::print(String *str, enum_query_type query_type) +{ + str->append(func_name()); + str->append('('); + if (decimals) + str->append_ulonglong(decimals); + str->append(')'); +} + static void set_sec_part(ulong sec_part, MYSQL_TIME *ltime, Item *item) { DBUG_ASSERT(item->decimals == AUTO_SEC_PART_DIGITS || @@ -1704,6 +1713,15 @@ bool Item_func_now::fix_fields(THD *thd, Item **items) return Item_temporal_func::fix_fields(thd, items); } +void Item_func_now::print(String *str, enum_query_type query_type) +{ + str->append(func_name()); + str->append('('); + if (decimals) + str->append_ulonglong(decimals); + str->append(')'); +} + /** Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole NOW function. @@ -2336,7 +2354,7 @@ void Item_temporal_typecast::print(String *str, enum_query_type query_type) args[0]->print(str, query_type); str->append(STRING_WITH_LEN(" as ")); str->append(cast_type()); - if (decimals) + if (decimals && decimals != NOT_FIXED_DEC) { str->append('('); str->append(llstr(decimals, buf)); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 07b4ef92b2e..949401e19fd 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -655,6 +655,7 @@ public: { return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } + void print(String *str, enum_query_type query_type); }; @@ -740,6 +741,7 @@ public: */ return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } + void print(String *str, enum_query_type query_type); }; @@ -747,7 +749,7 @@ class Item_func_now_local :public Item_func_now { public: Item_func_now_local(THD *thd, uint dec): Item_func_now(thd, dec) {} - const char *func_name() const { return "now"; } + const char *func_name() const { return "current_timestamp"; } virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); virtual enum Functype functype() const { return NOW_FUNC; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) diff --git a/sql/mysqld.h b/sql/mysqld.h index 02bbdf839c1..96944c012ce 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -662,13 +662,15 @@ enum enum_query_type QT_WITHOUT_INTRODUCERS= (1 << 1), /// view internal representation (like QT_ORDINARY except ORDER BY clause) QT_VIEW_INTERNAL= (1 << 2), - /// If identifiers should not include database names for the current database - QT_ITEM_IDENT_SKIP_CURRENT_DATABASE= (1 << 3), + /// If identifiers should not include database names, where unambiguous + QT_ITEM_IDENT_SKIP_DB_NAMES= (1 << 3), + /// If identifiers should not include table names, where unambiguous + QT_ITEM_IDENT_SKIP_TABLE_NAMES= (1 << 4), /// If Item_cache_wrapper should not print - QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS= (1 << 4), + QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS= (1 << 5), /// If Item_subselect should print as just "(subquery#1)" /// rather than display the subquery body - QT_ITEM_SUBSELECT_ID_ONLY= (1 << 5), + QT_ITEM_SUBSELECT_ID_ONLY= (1 << 6), /// If NULLIF(a,b) should print itself as /// CASE WHEN a_for_comparison=b THEN NULL ELSE a_for_return_value END /// when "a" was replaced to two different items @@ -678,11 +680,11 @@ enum enum_query_type /// a_for_return_value is not the same as a_for_comparison. /// SHOW CREATE {VIEW|PROCEDURE|FUNCTION} and other cases where the /// original representation is required, should set this flag. - QT_ITEM_ORIGINAL_FUNC_NULLIF= (1 <<6), + QT_ITEM_ORIGINAL_FUNC_NULLIF= (1 << 7), /// This value means focus on readability, not on ability to parse back, etc. QT_EXPLAIN= QT_TO_SYSTEM_CHARSET | - QT_ITEM_IDENT_SKIP_CURRENT_DATABASE | + QT_ITEM_IDENT_SKIP_DB_NAMES | QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | QT_ITEM_SUBSELECT_ID_ONLY, diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 8f81d23816e..1fc22fa415f 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7395,9 +7395,9 @@ ER_CONSTRAINT_FAILED 23000 rus "проверка CONSTRAINT %`s Ð´Ð»Ñ %`-.192s.%`-.192s провалилаÑÑŒ" ukr "Перевірка CONSTRAINT %`s Ð´Ð»Ñ %`-.192s.%`-.192s не пройшла" ER_EXPRESSION_IS_TOO_BIG - eng "%s expression in the %s clause is too big" + eng "Expression in the %s clause is too big" ER_ERROR_EVALUATING_EXPRESSION - eng "Got an error evaluating stored expression %`s" + eng "Got an error evaluating stored expression %s" ER_CALCULATING_DEFAULT_VALUE eng "Got an error when calculating default value for %`s" ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 01000 diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 003fe4f5366..f918e547148 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2353,6 +2353,12 @@ end_create: DBUG_RETURN(thd->is_error()); } +#define memdup_vcol(thd, vcol) \ + if (vcol) \ + { \ + (vcol)= (Virtual_column_info*)(thd)->memdup((vcol), sizeof(*(vcol))); \ + (vcol)->expr_item= NULL; \ + } /** As we can't let many client threads modify the same TABLE @@ -2374,7 +2380,6 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) { my_ptrdiff_t adjust_ptrs; Field **field,**org_field, *found_next_number_field; - Field **vfield= 0, **dfield_ptr= 0; TABLE *copy; TABLE_SHARE *share; uchar *bitmap; @@ -2437,14 +2442,6 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) if (!copy_tmp) goto error; - if (share->virtual_fields) - { - vfield= (Field **) client_thd->alloc((share->virtual_fields+1)* - sizeof(Field*)); - if (!vfield) - goto error; - } - /* Copy the TABLE object. */ copy= new (copy_tmp) TABLE; *copy= *table; @@ -2463,7 +2460,14 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) sizeof(Field*)); if (!copy->default_field) goto error; - dfield_ptr= copy->default_field; + } + + if (share->virtual_fields) + { + copy->vfield= (Field **) client_thd->alloc((share->virtual_fields+1)* + sizeof(Field*)); + if (!copy->vfield) + goto error; } copy->expr_arena= NULL; @@ -2481,12 +2485,14 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) found_next_number_field= table->found_next_number_field; for (org_field= table->field; *org_field; org_field++, field++) { - if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, - 1))) + if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, 1))) goto error; (*field)->unireg_check= (*org_field)->unireg_check; (*field)->orig_table= copy; // Remove connection (*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0] + memdup_vcol(client_thd, (*field)->vcol_info); + memdup_vcol(client_thd, (*field)->default_value); + memdup_vcol(client_thd, (*field)->check_constraint); if (*org_field == found_next_number_field) (*field)->table->found_next_number_field= *field; } @@ -2499,42 +2505,9 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) if (!(copy->def_vcol_set= (MY_BITMAP*) alloc_root(client_thd->mem_root, sizeof(MY_BITMAP)))) goto error; - copy->vfield= vfield; - for (field= copy->field; *field; field++) - { - Virtual_column_info *vcol; - if ((*field)->vcol_info) - { - if (!(vcol= unpack_vcol_info_from_frm(client_thd, - client_thd->mem_root, - copy, - 0, - (*field)->vcol_info, - &error_reported))) - goto error; - (*field)->vcol_info= vcol; - *vfield++= *field; - } - if ((*field)->default_value) - { - if (!(vcol= unpack_vcol_info_from_frm(client_thd, - client_thd->mem_root, - copy, - 0, - (*field)->default_value, - &error_reported))) - goto error; - (*field)->default_value= vcol; - *dfield_ptr++= *field; - } - else - if ((*field)->has_update_default_function()) - *dfield_ptr++= *field; - } - if (vfield) - *vfield= 0; - if (dfield_ptr) - *dfield_ptr= 0; + + if (parse_vcol_defs(client_thd, client_thd->mem_root, copy, &error_reported)) + goto error; } switch_defaults_to_nullable_trigger_fields(copy); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 273615e1489..e2f9e9432af 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1635,9 +1635,11 @@ static bool print_on_update_clause(Field *field, String *val, bool lcase) val->append(STRING_WITH_LEN("on update ")); else val->append(STRING_WITH_LEN("ON UPDATE ")); - val->append(STRING_WITH_LEN("CURRENT_TIMESTAMP")); + val->append(STRING_WITH_LEN("current_timestamp")); if (field->decimals() > 0) val->append_parenthesized(field->decimals()); + else + val->append(STRING_WITH_LEN("()")); return true; } return false; @@ -1657,51 +1659,42 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, def_value->length(0); if (has_default) { + StringBuffer str(field->charset()); if (field->default_value) { + field->default_value->print(&str); if (field->default_value->expr_item->need_parentheses_in_default()) { def_value->set_charset(&my_charset_utf8mb4_general_ci); def_value->append('('); - def_value->append(field->default_value->expr_str.str, - field->default_value->expr_str.length); + def_value->append(str); def_value->append(')'); } - else if (field->unireg_check) - def_value->append(field->default_value->expr_str.str, - field->default_value->expr_str.length); else - def_value->set(field->default_value->expr_str.str, - field->default_value->expr_str.length, - &my_charset_utf8mb4_general_ci); + def_value->append(str); } else if (!field->is_null()) { // Not null by default - char tmp[MAX_FIELD_WIDTH]; - String type(tmp, sizeof(tmp), field->charset()); if (field_type == MYSQL_TYPE_BIT) { - longlong dec= field->val_int(); - char *ptr= longlong2str(dec, tmp + 2, 2); - uint32 length= (uint32) (ptr - tmp); - tmp[0]= 'b'; - tmp[1]= '\''; - tmp[length]= '\''; - type.length(length + 1); + str.qs_append('b'); + str.qs_append('\''); + str.qs_append(field->val_int(), 2); + str.qs_append('\''); quoted= 0; } else { - field->val_str(&type); + field->val_str(&str); if (!field->str_needs_quotes()) quoted= 0; } - if (type.length()) + if (str.length()) { - String def_val; + StringBuffer def_val; uint dummy_errors; /* convert to system_charset_info == utf8 */ - def_val.copy(type.ptr(), type.length(), field->charset(), + def_val.copy(str.ptr(), str.length(), field->charset(), system_charset_info, &dummy_errors); if (quoted) append_unescaped(def_value, def_val.ptr(), def_val.length()); @@ -1918,10 +1911,10 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, if (field->vcol_info) { + StringBuffer str(&my_charset_utf8mb4_general_ci); + field->vcol_info->print(&str); packet->append(STRING_WITH_LEN(" AS (")); - packet->append(field->vcol_info->expr_str.str, - field->vcol_info->expr_str.length, - &my_charset_utf8mb4_general_ci); + packet->append(str); packet->append(STRING_WITH_LEN(")")); if (field->vcol_info->stored_in_db) packet->append(STRING_WITH_LEN(" PERSISTENT")); @@ -1961,10 +1954,10 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, } if (field->check_constraint) { + StringBuffer str(&my_charset_utf8mb4_general_ci); + field->check_constraint->print(&str); packet->append(STRING_WITH_LEN(" CHECK (")); - packet->append(field->check_constraint->expr_str.str, - field->check_constraint->expr_str.length, - &my_charset_utf8mb4_general_ci); + packet->append(str); packet->append(STRING_WITH_LEN(")")); } @@ -2062,7 +2055,9 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, for (uint i= share->field_check_constraints; i < share->table_check_constraints ; i++) { + StringBuffer str(&my_charset_utf8mb4_general_ci); Virtual_column_info *check= table->check_constraints[i]; + check->print(&str); packet->append(STRING_WITH_LEN(",\n ")); if (check->name.length) @@ -2071,9 +2066,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, append_identifier(thd, packet, check->name.str, check->name.length); } packet->append(STRING_WITH_LEN(" CHECK (")); - packet->append(check->expr_str.str, - check->expr_str.length, - &my_charset_utf8mb4_general_ci); + packet->append(str); packet->append(STRING_WITH_LEN(")")); } } @@ -8447,7 +8440,7 @@ ST_FIELD_INFO columns_fields_info[]= OPEN_FRM_ONLY}, {"COLUMN_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, "Type", OPEN_FRM_ONLY}, {"COLUMN_KEY", 3, MYSQL_TYPE_STRING, 0, 0, "Key", OPEN_FRM_ONLY}, - {"EXTRA", 27, MYSQL_TYPE_STRING, 0, 0, "Extra", OPEN_FRM_ONLY}, + {"EXTRA", 30, MYSQL_TYPE_STRING, 0, 0, "Extra", OPEN_FRM_ONLY}, {"PRIVILEGES", 80, MYSQL_TYPE_STRING, 0, 0, "Privileges", OPEN_FRM_ONLY}, {"COLUMN_COMMENT", COLUMN_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0, "Comment", OPEN_FRM_ONLY}, diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 49442260704..62473e082c3 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -733,7 +733,7 @@ void String::qs_append(int i) void String::qs_append(ulonglong i) { char *buff= Ptr + str_length; - char *end= longlong10_to_str(i, buff,10); + char *end= longlong10_to_str(i, buff, 10); str_length+= (int) (end-buff); } diff --git a/sql/sql_string.h b/sql/sql_string.h index 8be23184741..4b70675dca4 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -584,6 +584,12 @@ public: qs_append((ulonglong)i); } void qs_append(ulonglong i); + void qs_append(longlong i, int radix) + { + char *buff= Ptr + str_length; + char *end= ll2str(i, buff, radix, 0); + str_length+= (int) (end-buff); + } /* Inline (general) functions used by the protocol functions */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5e93fac1ddd..1e985bc240b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3339,45 +3339,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (prepare_blob_field(thd, sql_field)) DBUG_RETURN(TRUE); - if (sql_field->default_value) - { - Virtual_column_info *def= sql_field->default_value; - - if (!sql_field->has_default_expression()) - def->expr_str= null_lex_str; - - if (!def->expr_item->basic_const_item() && !def->flags) - { - Item *expr= def->expr_item; - int err= !expr->fixed && // may be already fixed if ALTER TABLE - expr->fix_fields(thd, &expr); - if (!err) - { - if (expr->result_type() == REAL_RESULT) - { // don't convert floats to string and back, it can be lossy - double res= expr->val_real(); - if (expr->null_value) - expr= new (thd->mem_root) Item_null(thd); - else - expr= new (thd->mem_root) Item_float(thd, res, expr->decimals); - } - else - { - StringBuffer buf; - String *res= expr->val_str(&buf); - if (expr->null_value) - expr= new (thd->mem_root) Item_null(thd); - else - { - char *str= (char*) thd->strmake(res->ptr(), res->length()); - expr= new (thd->mem_root) Item_string(thd, str, res->length(), res->charset()); - } - } - thd->change_item_tree(&def->expr_item, expr); - } - } - } - /* Convert the default value from client character set into the column character set if necessary. @@ -4205,11 +4166,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (check_string_char_length(&check->name, 0, NAME_CHAR_LEN, system_charset_info, 1)) { - my_error(ER_TOO_LONG_IDENT, MYF(0), key->name.str); + my_error(ER_TOO_LONG_IDENT, MYF(0), check->name.str); DBUG_RETURN(TRUE); } - if (check_expression(check, "CONSTRAINT CHECK", - check->name.str ? check->name.str : "", 0)) + if (check_expression(check, check->name.str, VCOL_CHECK_TABLE)) DBUG_RETURN(TRUE); } } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6c6895434e4..1885c2e5aa5 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -910,27 +910,14 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) MYSQL_YYABORT; \ } while(0) -Virtual_column_info *add_virtual_expression(THD *thd, const char *txt, - size_t size, Item *expr) +Virtual_column_info *add_virtual_expression(THD *thd, Item *expr) { - CHARSET_INFO *cs= thd->charset(); Virtual_column_info *v= new (thd->mem_root) Virtual_column_info(); if (!v) { mem_alloc_error(sizeof(Virtual_column_info)); return 0; } - /* - We have to remove white space as remember_cur_pos may have pointed to end - of previous expression. - */ - while (cs->state_map[*(uchar*)txt] == MY_LEX_SKIP) - { - txt++; - size--; - } - v->expr_str.str= (char* ) thd->strmake(txt, size); - v->expr_str.length= size; v->expr_item= expr; v->utf8= 0; /* connection charset */ return v; @@ -1761,7 +1748,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); table_ident_opt_wild create_like %type - remember_name remember_end opt_db remember_tok_start remember_cur_pos + remember_name remember_end opt_db remember_tok_start wild_and_where field_length opt_field_length opt_field_length_default_1 @@ -2005,7 +1992,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); definer_opt no_definer definer get_diagnostics parse_vcol_expr vcol_opt_specifier vcol_opt_attribute vcol_opt_attribute_list vcol_attribute - explainable_command opt_impossible_action + explainable_command END_OF_INPUT %type call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt @@ -6120,10 +6107,10 @@ opt_check_constraint: ; check_constraint: - CHECK_SYM '(' remember_name expr remember_end ')' + CHECK_SYM '(' expr ')' { Virtual_column_info *v= - add_virtual_expression(thd, $3+1, (uint)($5 - $3) - 1, $4); + add_virtual_expression(thd, $3); if (!v) { MYSQL_YYABORT; @@ -6264,10 +6251,10 @@ parenthesized_expr: ; virtual_column_func: - '(' remember_cur_pos parenthesized_expr remember_end ')' + '(' parenthesized_expr ')' { Virtual_column_info *v= - add_virtual_expression(thd, $2, (uint)($4 - $2), $3); + add_virtual_expression(thd, $2); if (!v) { MYSQL_YYABORT; @@ -6280,19 +6267,13 @@ expr_or_literal: column_default_non_parenthesized_expr | signed_literal ; column_default_expr: virtual_column_func - | remember_name expr_or_literal opt_impossible_action remember_end + | expr_or_literal { - if (!($$= add_virtual_expression(thd, $1, (uint) ($4- $1), $2))) + if (!($$= add_virtual_expression(thd, $1))) MYSQL_YYABORT; } ; -/* This is to force remember_end to look at next token */ -opt_impossible_action: - IMPOSSIBLE_ACTION {} - | /* empty */ {} - - field_type: int_type opt_field_length field_options { $$.set($1, $2); } | real_type opt_precision field_options { $$.set($1, $2); } @@ -8747,12 +8728,6 @@ remember_tok_start: } ; -remember_cur_pos: - { - $$= (char*) YYLIP->get_cpp_ptr(); - } - ; - remember_name: { $$= (char*) YYLIP->get_cpp_tok_start(); diff --git a/sql/table.cc b/sql/table.cc index 6e54b6800e7..848352419d5 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -47,6 +47,9 @@ #define MYSQL57_GENERATED_FIELD 128 #define MYSQL57_GCOL_HEADER_SIZE 4 +static Virtual_column_info * unpack_vcol_info_from_frm(THD *, MEM_ROOT *, + TABLE *, const uchar *, size_t, Virtual_column_info *, bool *); +static bool check_vcol_forward_refs(Field *, Virtual_column_info *); /* INFORMATION_SCHEMA name */ LEX_STRING INFORMATION_SCHEMA_NAME= {C_STRING_WITH_LEN("information_schema")}; @@ -957,6 +960,159 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share, } } + +/** Parse TABLE_SHARE::vcol_defs + + unpack_vcol_info_from_frm + 5.7 + byte 1 = 1 + byte 2,3 = expr length + byte 4 = stored_in_db + expression + 10.1- + byte 1 = 1 | 2 + byte 2 = sql_type + byte 3 = stored_in_db + [byte 4] = optional interval_id for sql_type (if byte 1 == 2) + expression + 10.2+ + byte 1 = type + byte 2,3 = field_number + byte 4,5 = length of expression + byte 6 = length of name + name + expression +*/ +bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, + bool *error_reported) +{ + const uchar *pos= table->s->vcol_defs.str; + const uchar *end= pos + table->s->vcol_defs.length; + Field **field_ptr= table->field - 1; + Field **vfield_ptr= table->vfield; + Field **dfield_ptr= table->default_field; + Virtual_column_info **check_constraint_ptr= table->check_constraints; + Virtual_column_info *vcol; + DBUG_ENTER("parse_vcol_defs"); + + if (check_constraint_ptr) + memcpy(table->check_constraints + table->s->field_check_constraints, + table->s->check_constraints, + table->s->table_check_constraints * sizeof(Virtual_column_info*)); + + while (pos < end) + { + uint type, expr_length; + if (table->s->mysql_version >= 100202) + { + uint field_nr, name_length; + /* see pack_expression() for how data is stored */ + type= pos[0]; + field_nr= uint2korr(pos+1); + expr_length= uint2korr(pos+3); + name_length= pos[5]; + pos+= FRM_VCOL_NEW_HEADER_SIZE + name_length; + field_ptr= table->field + field_nr; + } + else + { + /* + see below in ::init_from_binary_frm_image for how data is stored + in versions below 10.2 (that includes 5.7 too) + */ + while (*++field_ptr && !(*field_ptr)->vcol_info) /* no-op */; + if (!*field_ptr) + { + open_table_error(table->s, OPEN_FRM_CORRUPTED, 1); + DBUG_RETURN(1); + } + type= (*field_ptr)->vcol_info->stored_in_db + ? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL; + expr_length= uint2korr(pos+1); + if (table->s->mysql_version > 50700 && table->s->mysql_version < 100000) + pos+= 4; // MySQL from 5.7 + else + pos+= pos[0] == 2 ? 4 : 3; // MariaDB from 5.2 to 10.1 + } + switch (type) { + case VCOL_GENERATED_VIRTUAL: + case VCOL_GENERATED_STORED: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, + (*field_ptr)->vcol_info, error_reported); + DBUG_ASSERT((*field_ptr)->vcol_info->expr_item == NULL); + (*field_ptr)->vcol_info= vcol; + *(vfield_ptr++)= *field_ptr; + break; + case VCOL_DEFAULT: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, + (*field_ptr)->default_value, + error_reported); + DBUG_ASSERT((*field_ptr)->default_value->expr_item == NULL); + (*field_ptr)->default_value= vcol; + *(dfield_ptr++)= *field_ptr; + break; + case VCOL_CHECK_FIELD: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, + (*field_ptr)->check_constraint, + error_reported); + DBUG_ASSERT((*field_ptr)->check_constraint->expr_item == NULL); + (*field_ptr)->check_constraint= vcol; + *check_constraint_ptr++= vcol; + break; + case VCOL_CHECK_TABLE: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, + *check_constraint_ptr, error_reported); + *check_constraint_ptr++= vcol; + break; + } + if (!vcol) + DBUG_RETURN(1); + pos+= expr_length; + } + + /* Now, initialize CURRENT_TIMESTAMP fields */ + for (field_ptr= table->field; *field_ptr; field_ptr++) + { + Field *field= *field_ptr; + if (field->has_default_now_unireg_check()) + { + char buf[256]; + size_t len= my_snprintf(buf, sizeof(buf), "current_timestamp(%u)", field->decimals()); + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, (uchar*)buf, len, + (*field_ptr)->default_value, + error_reported); + DBUG_ASSERT((*field_ptr)->default_value->expr_item == NULL); + (*field_ptr)->default_value= vcol; + *(dfield_ptr++)= *field_ptr; + if (!field->default_value->expr_item) + DBUG_RETURN(1); + } + else if (field->has_update_default_function() && !field->default_value) + *(dfield_ptr++)= *field_ptr; + } + + if (vfield_ptr) + *vfield_ptr= 0; + + if (dfield_ptr) + *dfield_ptr= 0; + + if (check_constraint_ptr) + *check_constraint_ptr= 0; + + /* Check that expressions aren't refering to not yet initialized fields */ + for (field_ptr= table->field; *field_ptr; field_ptr++) + { + Field *field= *field_ptr; + if (check_vcol_forward_refs(field, field->vcol_info) || + check_vcol_forward_refs(field, field->check_constraint) || + check_vcol_forward_refs(field, field->default_value)) + DBUG_RETURN(1); + } + + DBUG_RETURN(0); +} + /** Read data from a binary .frm file image into a TABLE_SHARE @@ -1452,6 +1608,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!interval_count) share->intervals= 0; // For better debugging + share->vcol_defs.str= vcol_screen_pos; + share->vcol_defs.length= vcol_screen_length; + memcpy(names, strpos+(share->fields*field_pack_length), n_length+int_length); memcpy(comment_pos, disk_buff+read_length-com_length-vcol_screen_length, com_length); @@ -1535,8 +1694,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, mysql57_vcol_null_bit_pos= null_bit_pos; mysql57_calculate_null_position(share, &mysql57_vcol_null_pos, &mysql57_vcol_null_bit_pos, - strpos, - vcol_screen_pos); + strpos, vcol_screen_pos); } for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++) @@ -1631,18 +1789,20 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, { unireg_type&= MYSQL57_GENERATED_FIELD; + /* + MySQL 5.7 generated fields + + byte 1 = 1 + byte 2,3 = expr length + byte 4 = stored_in_db + byte 5.. = expr + */ if ((uint)(vcol_screen_pos)[0] != 1) goto err; vcol_info= new (&share->mem_root) Virtual_column_info(); vcol_info_length= uint2korr(vcol_screen_pos + 1); DBUG_ASSERT(vcol_info_length); vcol_info->stored_in_db= vcol_screen_pos[3]; - if (!(vcol_info->expr_str.str= - (char *)memdup_root(&share->mem_root, - vcol_screen_pos + MYSQL57_GCOL_HEADER_SIZE, - vcol_info_length))) - goto err; - vcol_info->expr_str.length= vcol_info_length; vcol_info->utf8= 0; vcol_screen_pos+= vcol_info_length + MYSQL57_GCOL_HEADER_SIZE;; share->virtual_fields++; @@ -1657,8 +1817,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, Get virtual column data stored in the .frm file as follows: byte 1 = 1 | 2 byte 2 = sql_type - byte 3 = flags (as of now, 0 - no flags, - 1 - field is physically stored) + byte 3 = flags. 1 for stored_in_db [byte 4] = optional interval_id for sql_type (if byte 1 == 2) next byte ... = virtual column expression (text data) */ @@ -1670,20 +1829,11 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, interval_nr= (uint)vcol_screen_pos[3]; else if ((uint)vcol_screen_pos[0] != 1) goto err; - - vcol_info->stored_in_db= vcol_screen_pos[2]; + vcol_info->stored_in_db= vcol_screen_pos[2] & 1; vcol_expr_length= vcol_info_length - (uint)(FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id)); - if (!(vcol_info->expr_str.str= - (char *)memdup_root(&share->mem_root, - vcol_screen_pos + - (uint) FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id), - vcol_expr_length))) - goto err; - if (opt_interval_id) - interval_nr= (uint) vcol_screen_pos[3]; - vcol_info->expr_str.length= vcol_expr_length; vcol_info->utf8= 0; // before 10.2.1 the charset was unknown + int2store(vcol_screen_pos+1, vcol_expr_length); // for parse_vcol_defs() vcol_screen_pos+= vcol_info_length; share->virtual_fields++; } @@ -1768,11 +1918,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, /* Convert pre-10.2.2 timestamps to use Field::default_value */ unireg_check= (Field::utype) MTYP_TYPENR(unireg_type); - if (unireg_check == Field::TIMESTAMP_DNUN_FIELD) - unireg_check= Field::TIMESTAMP_UN_FIELD; - if (unireg_check == Field::TIMESTAMP_DN_FIELD) - unireg_check= Field::NONE; - *field_ptr= reg_field= make_field(share, &share->mem_root, record+recpos, (uint32) field_length, null_pos, null_bit_pos, pack_flag, field_type, charset, @@ -1782,17 +1927,11 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!reg_field) // Not supported field type goto err; - if (unireg_check != (Field::utype) MTYP_TYPENR(unireg_type)) + if (unireg_check == Field::TIMESTAMP_DNUN_FIELD || + unireg_check == Field::TIMESTAMP_DN_FIELD) { - char buf[32]; - if (reg_field->decimals()) - my_snprintf(buf, sizeof(buf), "CURRENT_TIMESTAMP(%d)", reg_field->decimals()); - else - strmov(buf, "CURRENT_TIMESTAMP"); - reg_field->default_value= new (&share->mem_root) Virtual_column_info(); reg_field->default_value->stored_in_db= 1; - thd->make_lex_string(®_field->default_value->expr_str, buf, strlen(buf)); share->default_expressions++; } @@ -1814,11 +1953,15 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, null_pos++; } - if (mysql57_null_bits && vcol_info && !vcol_info->stored_in_db) + if (vcol_info) { - /* MySQL 5.7 has null bits last */ - swap_variables(uchar*, null_pos, mysql57_vcol_null_pos); - swap_variables(uint, null_bit_pos, mysql57_vcol_null_bit_pos); + vcol_info->name.str= const_cast(reg_field->field_name); + if (mysql57_null_bits && !vcol_info->stored_in_db) + { + /* MySQL 5.7 has null bits last */ + swap_variables(uchar*, null_pos, mysql57_vcol_null_pos); + swap_variables(uint, null_bit_pos, mysql57_vcol_null_bit_pos); + } } if (f_no_default(pack_flag)) @@ -2169,6 +2312,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, /* Skip header */ vcol_screen_pos+= FRM_VCOL_NEW_BASE_SIZE; + share->vcol_defs.str+= FRM_VCOL_NEW_BASE_SIZE; + share->vcol_defs.length-= FRM_VCOL_NEW_BASE_SIZE; /* Read virtual columns, default values and check constraints @@ -2181,40 +2326,28 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint field_nr= uint2korr(vcol_screen_pos+1); uint expr_length= uint2korr(vcol_screen_pos+3); uint name_length= (uint) vcol_screen_pos[5]; - LEX_STRING name; - char *expr; - vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE; - - name.str= 0; - if ((name.length= name_length)) - { - if (!(name.str= strmake_root(&share->mem_root, - (char*) vcol_screen_pos, - name_length))) - goto err; - } - vcol_screen_pos+= name_length; - if (!(vcol_info= new (&share->mem_root) Virtual_column_info()) || - !(expr= (char *) strmake_root(&share->mem_root, - (char*) vcol_screen_pos, - expr_length))) + if (!(vcol_info= new (&share->mem_root) Virtual_column_info())) goto err; - vcol_info->name= name; - /* The following can only be true for check_constraints */ + if (field_nr != UINT_MAX16) { DBUG_ASSERT(field_nr < share->fields); reg_field= share->field[field_nr]; } - vcol_info->expr_str.str= expr; - vcol_info->expr_str.length= expr_length; - vcol_screen_pos+= expr_length; + vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE; + vcol_info->name.length= name_length; + if (name_length) + vcol_info->name.str= strmake_root(&share->mem_root, + (char*)vcol_screen_pos, name_length); + else + vcol_info->name.str= const_cast(reg_field->field_name); + vcol_screen_pos+= name_length + expr_length; switch (type) { - case 0: // Generated virtual field + case VCOL_GENERATED_VIRTUAL: { uint recpos; reg_field->vcol_info= vcol_info; @@ -2226,24 +2359,24 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->stored_rec_length= recpos-1; break; } - case 1: // Generated stored field + case VCOL_GENERATED_STORED: vcol_info->stored_in_db= 1; DBUG_ASSERT(!reg_field->vcol_info); reg_field->vcol_info= vcol_info; share->virtual_fields++; break; - case 2: // Default expression + case VCOL_DEFAULT: vcol_info->stored_in_db= 1; DBUG_ASSERT(!reg_field->default_value); reg_field->default_value= vcol_info; share->default_expressions++; break; - case 3: // Field check constraint + case VCOL_CHECK_FIELD: DBUG_ASSERT(!reg_field->check_constraint); reg_field->check_constraint= vcol_info; share->field_check_constraints++; break; - case 4: // Table check constraint + case VCOL_CHECK_TABLE: *(table_check_constraints++)= vcol_info; break; } @@ -2537,7 +2670,9 @@ static bool fix_vcol_expr(THD *thd, Virtual_column_info *vcol) if (unlikely(error)) { - my_error(ER_ERROR_EVALUATING_EXPRESSION, MYF(0), vcol->expr_str); + StringBuffer str; + vcol->print(&str); + my_error(ER_ERROR_EVALUATING_EXPRESSION, MYF(0), str.c_ptr()); DBUG_RETURN(1); } @@ -2609,7 +2744,7 @@ bool fix_session_vcol_expr_for_read(THD *thd, Field *field, FALSE Otherwise */ -static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, +static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Virtual_column_info *vcol) { Item* func_expr= vcol->expr_item; @@ -2647,7 +2782,7 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, if (error || (res.errors & VCOL_IMPOSSIBLE)) { // this can only happen if the frm was corrupted my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, - "???", field ? field->field_name : "?????"); + "???", "?????"); DBUG_RETURN(1); } vcol->flags= res.errors; @@ -2697,12 +2832,10 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, @retval NULL Error */ -Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, - MEM_ROOT *mem_root, - TABLE *table, - Field *field, - Virtual_column_info *vcol, - bool *error_reported) +static Virtual_column_info * +unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, TABLE *table, + const uchar *expr_str, size_t expr_str_length, + Virtual_column_info *vcol, bool *error_reported) { char *vcol_expr_str; int str_len; @@ -2713,12 +2846,10 @@ Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, Create_field vcol_storage; // placeholder for vcol_info Parser_state parser_state; Virtual_column_info *vcol_info= 0; - LEX_STRING *vcol_expr= &vcol->expr_str; LEX *old_lex= thd->lex; LEX lex; bool error; DBUG_ENTER("unpack_vcol_info_from_frm"); - DBUG_ASSERT(vcol_expr); save_character_set_client= thd->variables.character_set_client; save_collation= thd->variables.collation_connection; @@ -2731,14 +2862,14 @@ Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, */ if (!(vcol_expr_str= (char*) alloc_root(mem_root, - vcol_expr->length + + expr_str_length + parse_vcol_keyword.length + 3))) DBUG_RETURN(0); memcpy(vcol_expr_str, parse_vcol_keyword.str, parse_vcol_keyword.length); str_len= parse_vcol_keyword.length; vcol_expr_str[str_len++]= '('; - memcpy(vcol_expr_str + str_len, vcol_expr->str, vcol_expr->length); - str_len+= vcol_expr->length; + memcpy(vcol_expr_str + str_len, expr_str, expr_str_length); + str_len+= expr_str_length; vcol_expr_str[str_len++]= ')'; vcol_expr_str[str_len++]= 0; @@ -2787,7 +2918,7 @@ Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, vcol_storage.vcol_info->stored_in_db= vcol->stored_in_db; vcol_storage.vcol_info->name= vcol->name; vcol_storage.vcol_info->utf8= vcol->utf8; - if (!fix_and_check_vcol_expr(thd, table, field, vcol_storage.vcol_info)) + if (!fix_and_check_vcol_expr(thd, table, vcol_storage.vcol_info)) { vcol_info= vcol_storage.vcol_info; // Expression ok goto end; @@ -3023,104 +3154,14 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, if (share->table_check_constraints || share->field_check_constraints) outparam->check_constraints= check_constraint_ptr; - /* Reuse the same loop both for virtual, default and check fields */ - for (field_ptr= outparam->field; *field_ptr; field_ptr++) + if (parse_vcol_defs(thd, &outparam->mem_root, outparam, &error_reported)) { - Field *field= *field_ptr; - if (field->vcol_info) - { - Virtual_column_info *vcol; - field->vcol_info->name.str= (char*) field->field_name; - if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, - outparam, *field_ptr, - field->vcol_info, - &error_reported))) - { - error= OPEN_FRM_CORRUPTED; - goto err; - } - field->vcol_info= vcol; - *(vfield_ptr++)= *field_ptr; - } - - if (field->check_constraint) - { - Virtual_column_info *vcol; - field->check_constraint->name.str= - (char*) field->field_name; - if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, - outparam, 0, - field->check_constraint, - &error_reported))) - { - error= OPEN_FRM_CORRUPTED; - goto err; - } - field->check_constraint= vcol; - *(check_constraint_ptr++)= vcol; - } - - if (field->default_value) - { - Virtual_column_info *vcol; - field->default_value->name.str= - (char*) field->field_name; - if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, - outparam, *field_ptr, - field->default_value, - &error_reported))) - { - error= OPEN_FRM_CORRUPTED; - goto err; - } - field->default_value= vcol; - *(dfield_ptr++)= *field_ptr; - } - else - if (field->has_update_default_function()) - *(dfield_ptr++)= *field_ptr; - - } - *vfield_ptr= 0; // End marker - *dfield_ptr= 0; // End marker - - /* Check that expressions aren't refering to not yet initialized fields */ - for (field_ptr= outparam->field; *field_ptr; field_ptr++) - { - Field *field= *field_ptr; - if (check_vcol_forward_refs(field, field->vcol_info) || - check_vcol_forward_refs(field, field->check_constraint) || - check_vcol_forward_refs(field, field->default_value)) - { - error= OPEN_FRM_CORRUPTED; - goto err; - } + error= OPEN_FRM_CORRUPTED; + goto err; } /* Update to use trigger fields */ switch_defaults_to_nullable_trigger_fields(outparam); - - /* Copy table level constraints to check_constraint_ptr */ - for (i= 0 ; - i < share->table_check_constraints - share->field_check_constraints; - i++) - { - if (!(*check_constraint_ptr= - unpack_vcol_info_from_frm(thd, - &outparam->mem_root, - outparam, - 0, - share->check_constraints[i], - &error_reported))) - { - error= OPEN_FRM_CORRUPTED; - goto err; - } - (*check_constraint_ptr)->name= share->check_constraints[i]->name; - check_constraint_ptr++; - } - - *check_constraint_ptr= 0; // End marker } #ifdef WITH_PARTITION_STORAGE_ENGINE @@ -3776,8 +3817,8 @@ rename_file_ext(const char * from,const char * to,const char * ext) bool get_field(MEM_ROOT *mem, Field *field, String *res) { - char buff[MAX_FIELD_WIDTH], *to; - String str(buff,sizeof(buff),&my_charset_bin); + char *to; + StringBuffer str; bool rc; THD *thd= field->get_thd(); sql_mode_t sql_mode_backup= thd->variables.sql_mode; @@ -4060,13 +4101,11 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def) is backward compatible. */ } - char buffer[1024]; + StringBuffer<1024> sql_type(system_charset_info); + sql_type.extra_allocation(256); // Allocate min 256 characters at once for (i=0 ; i < table_def->count; i++, field_def++) { - String sql_type(buffer, sizeof(buffer), system_charset_info); sql_type.length(0); - /* Allocate min 256 characters at once */ - sql_type.extra_allocation(256); if (i < table->s->fields) { Field *field= table->field[i]; @@ -7390,7 +7429,7 @@ int TABLE::update_virtual_field(Field *vf) int TABLE::update_default_fields(bool update_command, bool ignore_errors) { - DBUG_ENTER("update_default_fields"); + DBUG_ENTER("TABLE::update_default_fields"); Field **field_ptr; int res= 0; DBUG_ASSERT(default_field); @@ -7412,8 +7451,6 @@ int TABLE::update_default_fields(bool update_command, bool ignore_errors) if (field->default_value && (field->default_value->flags || field->flags & BLOB_FLAG)) res|= (field->default_value->expr_item->save_in_field(field, 0) < 0); - else - res|= field->evaluate_insert_default_function(); } else res|= field->evaluate_update_default_function(); diff --git a/sql/table.h b/sql/table.h index 4ecc8f89b9e..c2c523181a0 100644 --- a/sql/table.h +++ b/sql/table.h @@ -582,6 +582,7 @@ struct TABLE_SHARE KEY *key_info; /* data of keys in database */ Virtual_column_info **check_constraints; uint *blob_field; /* Index to blobs in Field arrray*/ + LEX_CUSTRING vcol_defs; /* definitions of generated columns */ TABLE_STATISTICS_CB stats_cb; @@ -2668,11 +2669,8 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol); bool fix_session_vcol_expr_for_read(THD *thd, Field *field, Virtual_column_info *vcol); -Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, - TABLE *table, - Field *field, - Virtual_column_info *vcol, - bool *error_reported); +bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, + bool *error_reported); TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, const char *key, uint key_length); void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key, diff --git a/sql/unireg.cc b/sql/unireg.cc index 66fde186b5b..c102835a7bb 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -42,13 +42,11 @@ static uint pack_keys(uchar *,uint, KEY *, ulong); static bool pack_header(THD *, uchar *, List &, HA_CREATE_INFO *, ulong, handler *); +static bool pack_vcols(String *, List &, List *); static uint get_interval_id(uint *,List &, Create_field *); static bool pack_fields(uchar **, List &, HA_CREATE_INFO*, ulong); -static void pack_constraints(uchar **buff, List *constr); static size_t packed_fields_length(List &); -static size_t packed_constraints_length(THD *, HA_CREATE_INFO*, - List *); static bool make_empty_rec(THD *, uchar *, uint, List &, uint, ulong); @@ -120,6 +118,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, int error; uchar *frm_ptr, *pos; LEX_CUSTRING frm= {0,0}; + StringBuffer vcols; DBUG_ENTER("build_frm_image"); /* If fixed row records, we need one bit to check for deleted rows */ @@ -127,9 +126,19 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, create_info->null_bits++; data_offset= (create_info->null_bits + 7) / 8; + sql_mode_t save_sql_mode= thd->variables.sql_mode; + thd->variables.sql_mode &= ~MODE_ANSI_QUOTES; + error= pack_vcols(&vcols, create_fields, create_info->check_constraint_list); + thd->variables.sql_mode= save_sql_mode; + + if (error) + DBUG_RETURN(frm); + + if (vcols.length()) + create_info->expression_length= vcols.length() + FRM_VCOL_NEW_BASE_SIZE; + error= pack_header(thd, forminfo, create_fields, create_info, data_offset, db_file); - if (error) DBUG_RETURN(frm); @@ -336,6 +345,15 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, if (pack_fields(&pos, create_fields, create_info, data_offset)) goto err; + if (vcols.length()) + { + /* Store header for packed fields (extra space for future) */ + bzero(pos, FRM_VCOL_NEW_BASE_SIZE); + pos+= FRM_VCOL_NEW_BASE_SIZE; + memcpy(pos, vcols.ptr(), vcols.length()); + pos+= vcols.length(); + } + { /* Restore all UCS2 intervals. @@ -496,92 +514,73 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, /** - Calculate and check length of stored expression (virtual, def, check) + Pack the expression (for GENERATED ALWAYS AS, DEFAULT, CHECK) - Convert string to utf8, if it isn't already - - @param thd Thread handler. Used for memory allocation - @param v_col Virtual expression. Can be 0 - @param CREATE INFO For characterset - @param length Sum total lengths here - - Note to make calls easier, one can call this with v_col == 0 + The data is stored as: + 1 byte type (enum_vcol_info_type) + 2 bytes field_number + 2 bytes length of expression + 1 byte length of name + name + next bytes column expression (text data) @return 0 ok @return 1 error (out of memory or wrong characters in expression) */ -static bool add_expr_length(THD *thd, Virtual_column_info **v_col_ptr, - size_t *length) +static bool pack_expression(String *buf, Virtual_column_info *vcol, + uint field_nr, enum_vcol_info_type type) { - Virtual_column_info *v_col= *v_col_ptr; - if (!v_col) - return 0; + if (buf->reserve(FRM_VCOL_NEW_HEADER_SIZE + vcol->name.length)) + return 1; - /* - Convert string to utf8 for storage. - */ - if (!v_col->utf8) + buf->q_append((char) type); + buf->q_append2b(field_nr); + size_t len_off= buf->length(); + buf->q_append2b(0); // to be added later + buf->q_append((char)vcol->name.length); + buf->q_append(vcol->name.str, vcol->name.length); + size_t expr_start= buf->length(); + vcol->print(buf); + size_t expr_len= buf->length() - expr_start; + if (expr_len >= 65536) { - /* - This v_col comes from the parser (e.g. CREATE TABLE) or - from old (before 10.2.1) frm. - - We have to create a new Virtual_column_info as for alter table, - the current one may be shared with the original table. - */ - Virtual_column_info *new_vcol= new (thd->mem_root) Virtual_column_info(); - LEX_STRING to; - if (thd->copy_with_error(&my_charset_utf8mb4_general_ci, - &to, - thd->variables.character_set_client, - v_col->expr_str.str, v_col->expr_str.length)) - return 1; - *new_vcol= *v_col; - new_vcol->expr_str= to; - new_vcol->utf8= 1; - *v_col_ptr= new_vcol; - v_col= new_vcol; + my_error(ER_EXPRESSION_IS_TOO_BIG, MYF(0), vcol_type_name(type)); + return 1; } - - /* - Sum up the length of the expression string, it's optional name - and the header. - */ - (*length)+= (FRM_VCOL_NEW_HEADER_SIZE + v_col->name.length + - v_col->expr_str.length); + int2store(buf->ptr() + len_off, expr_len); return 0; } -/* - pack_expression - - The data is stored as: - 1 byte type (0 virtual, 1 virtual stored, 2 def, 3 check) - 2 bytes field_number - 2 bytes length of expression - 1 byte length of name - name - next bytes column expression (text data) -*/ - -static void pack_expression(uchar **buff, Virtual_column_info *vcol, - uint offset, uint type) +static bool pack_vcols(String *buf, List &create_fields, + List *check_constraint_list) { - (*buff)[0]= (uchar) type; - int2store((*buff)+1, offset); - /* - expr_str.length < 64K as we have checked that the total size of the - frm file is < 64K - */ - int2store((*buff)+3, vcol->expr_str.length); - (*buff)[5]= vcol->name.length; - (*buff)+= FRM_VCOL_NEW_HEADER_SIZE; - memcpy((*buff), vcol->name.str, vcol->name.length); - (*buff)+= vcol->name.length; - memcpy((*buff), vcol->expr_str.str, vcol->expr_str.length); - (*buff)+= vcol->expr_str.length; + List_iterator it(create_fields); + Create_field *field; + + for (uint field_nr=0; (field= it++); field_nr++) + { + if (field->vcol_info) + if (pack_expression(buf, field->vcol_info, field_nr, + field->vcol_info->stored_in_db + ? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL)) + return 1; + if (field->has_default_expression() && !field->has_default_now_unireg_check()) + if (pack_expression(buf, field->default_value, field_nr, VCOL_DEFAULT)) + return 1; + if (field->check_constraint) + if (pack_expression(buf, field->check_constraint, field_nr, + VCOL_CHECK_FIELD)) + return 1; + } + + List_iterator cit(*check_constraint_list); + Virtual_column_info *check; + while ((check= cit++)) + if (pack_expression(buf, check, UINT_MAX32, VCOL_CHECK_TABLE)) + return 1; + return 0; } @@ -592,10 +591,10 @@ static bool pack_header(THD *thd, uchar *forminfo, HA_CREATE_INFO *create_info, ulong data_offset, handler *file) { - uint length,int_count,int_length, int_parts; + uint int_count,int_length, int_parts; uint time_stamp_pos,null_fields; uint table_options= create_info->table_options; - size_t reclength, totlength, n_length, com_length, expression_length; + size_t length, reclength, totlength, n_length, com_length; DBUG_ENTER("pack_header"); if (create_fields.elements > MAX_FIELDS) @@ -611,16 +610,6 @@ static bool pack_header(THD *thd, uchar *forminfo, n_length=2L; create_info->field_check_constraints= 0; - if (create_info->check_constraint_list->elements) - { - expression_length= packed_constraints_length(thd, create_info, - create_info->check_constraint_list); - if (!expression_length) - DBUG_RETURN(1); // Wrong characterset - } - else - expression_length= 0; - /* Check fields */ List_iterator it(create_fields); Create_field *field; @@ -630,14 +619,6 @@ static bool pack_header(THD *thd, uchar *forminfo, ER_TOO_LONG_FIELD_COMMENT, field->field_name)) DBUG_RETURN(1); - if (add_expr_length(thd, &field->vcol_info, &expression_length)) - DBUG_RETURN(1); - if (field->default_value && field->default_value->expr_str.length) - if (add_expr_length(thd, &field->default_value, &expression_length)) - DBUG_RETURN(1); - if (add_expr_length(thd, &field->check_constraint, &expression_length)) - DBUG_RETURN(1); - totlength+= field->length; com_length+= field->comment.length; /* @@ -714,31 +695,22 @@ static bool pack_header(THD *thd, uchar *forminfo, DBUG_RETURN(1); } - if (expression_length) - { - expression_length+= FRM_VCOL_NEW_BASE_SIZE; - create_info->expression_length= expression_length; - } - /* Hack to avoid bugs with small static rows in MySQL */ - reclength=MY_MAX(file->min_record_length(table_options),reclength); - if ((ulong) create_fields.elements*FCOMP+FRM_FORMINFO_SIZE+ - n_length+int_length+com_length+expression_length > 65535L || - int_count > 255) + reclength= MY_MAX(file->min_record_length(table_options), reclength); + length= n_length + create_fields.elements*FCOMP + FRM_FORMINFO_SIZE + + int_length + com_length + create_info->expression_length; + if (length > 65535L || int_count > 255) { my_message(ER_TOO_MANY_FIELDS, "Table definition is too large", MYF(0)); DBUG_RETURN(1); } bzero((char*)forminfo,FRM_FORMINFO_SIZE); - length=(create_fields.elements*FCOMP+FRM_FORMINFO_SIZE+n_length+int_length+ - com_length+expression_length); int2store(forminfo,length); - forminfo[256] = 0; int2store(forminfo+258,create_fields.elements); - int2store(forminfo+260,0); // Screen length, not used anymore + // bytes 260-261 are unused int2store(forminfo+262,totlength); - int2store(forminfo+264,0); // unused + // bytes 264-265 are unused int2store(forminfo+266,reclength); int2store(forminfo+268,n_length); int2store(forminfo+270,int_count); @@ -749,7 +721,7 @@ static bool pack_header(THD *thd, uchar *forminfo, int2store(forminfo+280,22); /* Rows needed */ int2store(forminfo+282,null_fields); int2store(forminfo+284,com_length); - int2store(forminfo+286,expression_length); + int2store(forminfo+286,create_info->expression_length); DBUG_RETURN(0); } /* pack_header */ @@ -811,29 +783,6 @@ static size_t packed_fields_length(List &create_fields) DBUG_RETURN(length); } - -static size_t packed_constraints_length(THD *thd, HA_CREATE_INFO *info, - List *constr) -{ - List_iterator it(*constr); - size_t length= 0; - Virtual_column_info *check; - - while ((check= it++)) - if (add_expr_length(thd, it.ref(), &length)) - return 0; - return length; -} - -static void pack_constraints(uchar **buff, List *constr) -{ - List_iterator it(*constr); - Virtual_column_info *check; - while ((check= it++)) - pack_expression(buff, check, UINT_MAX32, 4); -} - - /* Save fields, fieldnames and intervals */ static bool pack_fields(uchar **buff_arg, List &create_fields, @@ -959,27 +908,6 @@ static bool pack_fields(uchar **buff_arg, List &create_fields, buff+= field->comment.length; } } - - if (create_info->expression_length) - { - /* Store header for packed fields (extra space for future) */ - bzero(buff, FRM_VCOL_NEW_BASE_SIZE); - buff+= FRM_VCOL_NEW_BASE_SIZE; - - /* Store expressions */ - it.rewind(); - for (uint field_nr=0 ; (field= it++) ; field_nr++) - { - if (field->vcol_info) - pack_expression(&buff, field->vcol_info, field_nr, - field->vcol_info->stored_in_db ? 1 : 0); - if (field->default_value && field->default_value->expr_str.length) - pack_expression(&buff, field->default_value, field_nr, 2); - if (field->check_constraint) - pack_expression(&buff, field->check_constraint, field_nr, 3); - } - pack_constraints(&buff, create_info->check_constraint_list); - } *buff_arg= buff; DBUG_RETURN(0); } @@ -1028,12 +956,9 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, field->sql_type, field->charset, field->geom_type, field->srid, - field->unireg_check == Field::TIMESTAMP_DNUN_FIELD - ? Field::TIMESTAMP_UN_FIELD - : field->unireg_check == Field::TIMESTAMP_DN_FIELD - ? Field::NONE : field->unireg_check, - field->save_interval ? field->save_interval : - field->interval, + field->unireg_check, + field->save_interval ? field->save_interval + : field->interval, field->field_name); if (!regfield) { @@ -1053,9 +978,14 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, if (field->sql_type == MYSQL_TYPE_BIT && !f_bit_as_char(field->pack_flag)) null_count+= field->length & 7; - if (field->default_value && !field->has_default_expression()) + if (field->default_value && !field->default_value->flags && + !(field->flags & BLOB_FLAG)) { - int res= field->default_value->expr_item->save_in_field(regfield, 1); + Item *expr= field->default_value->expr_item; + int res= !expr->fixed && // may be already fixed if ALTER TABLE + expr->fix_fields(thd, &expr); + if (!res) + res= expr->save_in_field(regfield, 1); /* If not ok or warning of level 'note' */ if (res != 0 && res != 3) { diff --git a/storage/connect/mysql-test/connect/r/mysql_new.result b/storage/connect/mysql-test/connect/r/mysql_new.result index 05071ef7be6..9236ee691e5 100644 --- a/storage/connect/mysql-test/connect/r/mysql_new.result +++ b/storage/connect/mysql-test/connect/r/mysql_new.result @@ -200,7 +200,7 @@ t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` datetime DEFAULT NULL, `c` time DEFAULT NULL, - `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `e` year(4) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23'); @@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` datetime DEFAULT NULL, `c` time DEFAULT NULL, - `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `e` year(4) DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT' `TABLE_TYPE`='MYSQL' SELECT * FROM t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result index 0190f4cdd30..cd75598a7ee 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` text DEFAULT NULL, - `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `created_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `updated_at` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', PRIMARY KEY (`id`), KEY `updated_at` (`updated_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result index 4690200c872..3f93ce03ca6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` text DEFAULT NULL, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `updated_at` (`updated_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result index d2a00b777ec..54a9a274835 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result @@ -64,7 +64,7 @@ drop table t1; create table t1 (c1 timestamp); desc t1; Field Type Null Key Default Extra -c1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +c1 timestamp NO current_timestamp() on update current_timestamp() drop table t1; create table t1 (c1 datetime); desc t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result index dc7127b7245..bdffb91739b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result @@ -6,7 +6,7 @@ title TEXT SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result index 3a782044128..6ad90fb4107 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result @@ -6,7 +6,7 @@ title TEXT SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result index b3814331038..49e5e0a1466 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result @@ -63,7 +63,7 @@ drop table t1; create table t1 (c1 timestamp primary key) COMMENT = 'engine "innodb"'; desc t1; Field Type Null Key Default Extra -c1 timestamp NO PRI CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +c1 timestamp NO PRI current_timestamp() on update current_timestamp() drop table t1; create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; desc t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result index f0ceb937a01..ab3e86baec3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result @@ -8,7 +8,7 @@ PRIMARY KEY (date, title) SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `title` varchar(100) NOT NULL, `content` text NOT NULL, PRIMARY KEY (`date`,`title`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result index 97428b768a6..0a9709a1d31 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result @@ -10,7 +10,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `title` varchar(100) NOT NULL, `content` text NOT NULL, PRIMARY KEY (`id`), diff --git a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result index d2f0b52c446..7ca36e07438 100644 --- a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result +++ b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result @@ -123,7 +123,7 @@ show create table t1; Table Create Table t1 CREATE TABLE t1 ( a int(11) NOT NULL DEFAULT 5, - b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + b timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), c tinyblob DEFAULT NULL, d decimal(5,2) DEFAULT NULL, e varchar(30) CHARACTER SET ascii DEFAULT NULL, diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result index e27a42a0af5..6caa51128f9 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result @@ -675,7 +675,7 @@ t16 CREATE TABLE `t16` ( `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, `c6` int(11) DEFAULT 1, - `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `c7` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 PARTITION BY KEY (c1) diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result index d8344e088e2..7b731bc785c 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result @@ -55,7 +55,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -69,7 +69,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -99,7 +99,7 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -113,7 +113,7 @@ show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result index 57e69bbb007..4858d5f099b 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result @@ -108,7 +108,7 @@ show create table test.byrange_tbl; Table byrange_tbl Create Table CREATE TABLE `byrange_tbl` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` longblob DEFAULT NULL, `fkid` mediumint(9) DEFAULT NULL, diff --git a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result index 12f1bcde3e2..07803071fe8 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result @@ -55,7 +55,7 @@ ushort smallint(5) unsigned zerofill NULL NO MUL 00000 # umedium mediumint(8) unsigned NULL NO MUL 0 # ulong int(11) unsigned NULL NO MUL 0 # ulonglong bigint(13) unsigned NULL NO MUL 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field date NULL YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # @@ -227,7 +227,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 # umedium mediumint(8) unsigned NULL NO MUL 0 # ulong int(11) unsigned NULL NO MUL 0 # ulonglong bigint(13) unsigned NULL NO MUL 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field char(10) latin1_swedish_ci YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # @@ -253,7 +253,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 # umedium mediumint(8) unsigned NULL NO 0 # ulong int(11) unsigned NULL NO 0 # ulonglong bigint(13) unsigned NULL NO 0 # -time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # +time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() # date_field char(10) latin1_swedish_ci YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # diff --git a/storage/tokudb/mysql-test/tokudb/r/type_timestamp.result b/storage/tokudb/mysql-test/tokudb/r/type_timestamp.result index c412620173c..c19bf85e2b1 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_timestamp.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_timestamp.result @@ -216,13 +216,13 @@ t1 t2 t3 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp(), `t2` datetime DEFAULT NULL, `t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=TokuDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() t2 datetime YES NULL t3 timestamp NO 0000-00-00 00:00:00 drop table t1; @@ -243,12 +243,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO 2003-01-01 00:00:00 on update CURRENT_TIMESTAMP +t1 timestamp NO 2003-01-01 00:00:00 on update current_timestamp() t2 datetime YES NULL drop table t1; create table t1 (t1 timestamp NOT NULL DEFAULT now() on update now(), t2 datetime); @@ -268,12 +268,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL drop table t1; create table t1 (t1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'); @@ -293,13 +293,13 @@ t1 t2 t3 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL, `t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=TokuDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL t3 timestamp NO 0000-00-00 00:00:00 drop table t1; @@ -320,12 +320,12 @@ t1 t2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `t2` datetime DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +t1 timestamp NO current_timestamp() on update current_timestamp() t2 datetime YES NULL truncate table t1; insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00'); @@ -390,7 +390,7 @@ create table t1 (a timestamp null default current_timestamp on update current_ti show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NULL DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 insert into t1 values (NULL, NULL); diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result index a3517e91b0c..58a82b8f684 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_datetime_tokudb.result @@ -7,7 +7,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 PARTITION BY KEY (a) @@ -37,7 +37,7 @@ partition by key (a) partitions 12; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 PARTITION BY KEY (a) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 54ac30861c1..228e3227649 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -7552,7 +7552,7 @@ static void test_explain_bug() verify_prepare_field(result, 5, "Extra", "EXTRA", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "information_schema", 27, 0); + 0, 0, "information_schema", 30, 0); mysql_free_result(result); mysql_stmt_close(stmt); From a72f1deb2d0fc4271072a8dc6f1f53e0f10d5af7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Nov 2016 23:18:03 +0100 Subject: [PATCH 085/135] rename Virtual_column_info::expr_item now, when expr_str is gone, expr_item can be unambiguously renamed to expr. --- sql/field.cc | 20 ++++++------ sql/field.h | 4 +-- sql/filesort.cc | 2 +- sql/item.cc | 18 +++++------ sql/item.h | 2 +- sql/item_func.cc | 2 +- sql/sql_base.cc | 2 +- sql/sql_insert.cc | 2 +- sql/sql_show.cc | 2 +- sql/sql_table.cc | 14 ++++---- sql/sql_yacc.yy | 2 +- sql/table.cc | 46 +++++++++++++-------------- sql/unireg.cc | 2 +- storage/innobase/handler/ha_innodb.cc | 2 +- 14 files changed, 60 insertions(+), 60 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 88af4f321dd..bd06314a8bb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2310,7 +2310,7 @@ void Field::set_default() if (default_value) { table->in_use->reset_arena_for_cached_items(table->expr_arena); - (void) default_value->expr_item->save_in_field(this, 0); + (void) default_value->expr->save_in_field(this, 0); table->in_use->reset_arena_for_cached_items(0); return; } @@ -9788,7 +9788,7 @@ bool check_expression(Virtual_column_info *vcol, const char *name, to be part of the virtual column */ res.errors= 0; - ret= vcol->expr_item->walk(&Item::check_vcol_func_processor, 0, &res); + ret= vcol->expr->walk(&Item::check_vcol_func_processor, 0, &res); vcol->flags= res.errors; uint filter= VCOL_IMPOSSIBLE; @@ -9805,7 +9805,7 @@ bool check_expression(Virtual_column_info *vcol, const char *name, Safe to call before fix_fields as long as vcol's don't include sub queries (which is now checked in check_vcol_func_processor) */ - if (vcol->expr_item->check_cols(1)) + if (vcol->expr->check_cols(1)) return TRUE; return FALSE; } @@ -9821,7 +9821,7 @@ bool Column_definition::check(THD *thd) /* Initialize data for a computed field */ if (vcol_info) { - DBUG_ASSERT(vcol_info->expr_item); + DBUG_ASSERT(vcol_info->expr); vcol_info->set_field_type(sql_type); if (check_expression(vcol_info, field_name, vcol_info->stored_in_db ? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL)) @@ -9834,7 +9834,7 @@ bool Column_definition::check(THD *thd) if (default_value) { - Item *def_expr= default_value->expr_item; + Item *def_expr= default_value->expr; if (check_expression(default_value, field_name, VCOL_DEFAULT)) DBUG_RETURN(TRUE); @@ -9859,15 +9859,15 @@ bool Column_definition::check(THD *thd) DBUG_RETURN(1); } - if (default_value && !default_value->expr_item->basic_const_item() && + if (default_value && !default_value->expr->basic_const_item() && mysql_type_to_time_type(sql_type) == MYSQL_TIMESTAMP_DATETIME && - default_value->expr_item->type() == Item::FUNC_ITEM) + default_value->expr->type() == Item::FUNC_ITEM) { /* Special case: NOW() for TIMESTAMP and DATETIME fields are handled as in MariaDB 10.1 by marking them in unireg_check. */ - Item_func *fn= static_cast(default_value->expr_item); + Item_func *fn= static_cast(default_value->expr); if (fn->functype() == Item_func::NOW_FUNC && (fn->decimals == 0 || fn->decimals >= length)) { @@ -10563,7 +10563,7 @@ Column_definition::Column_definition(THD *thd, Field *old_field, String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv)); char *pos= (char*) thd->strmake(res->ptr(), res->length()); default_value= new (thd->mem_root) Virtual_column_info(); - default_value->expr_item= + default_value->expr= new (thd->mem_root) Item_string(thd, pos, res->length(), charset); default_value->utf8= 0; } @@ -10627,7 +10627,7 @@ Create_field *Create_field::clone(MEM_ROOT *mem_root) const bool Column_definition::has_default_expression() { return (default_value && - (!default_value->expr_item->basic_const_item() || + (!default_value->expr->basic_const_item() || (flags & BLOB_FLAG))); } diff --git a/sql/field.h b/sql/field.h index 83997c70032..fd62218f144 100644 --- a/sql/field.h +++ b/sql/field.h @@ -621,14 +621,14 @@ public: /* Flag indicating that the field is physically stored in the database */ bool stored_in_db; bool utf8; /* Already in utf8 */ - Item *expr_item; + Item *expr; LEX_STRING name; /* Name of constraint */ uint flags; Virtual_column_info() : field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), in_partitioning_expr(FALSE), stored_in_db(FALSE), - utf8(TRUE), expr_item(NULL), flags(0) + utf8(TRUE), expr(NULL), flags(0) { name.str= NULL; name.length= 0; diff --git a/sql/filesort.cc b/sql/filesort.cc index a82f4871045..2210dc569df 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1272,7 +1272,7 @@ static void register_used_fields(Sort_param *param) { if (field->vcol_info) { - Item *vcol_item= field->vcol_info->expr_item; + Item *vcol_item= field->vcol_info->expr; vcol_item->walk(&Item::register_field_in_read_map, 1, 0); } bitmap_set_bit(bitmap, field->field_index); diff --git a/sql/item.cc b/sql/item.cc index c8cff0859c0..f8f776a2b28 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -905,7 +905,7 @@ bool Item_field::register_field_in_read_map(void *arg) if (field->vcol_info && !bitmap_fast_test_and_set(field->table->vcol_set, field->field_index)) { - res= field->vcol_info->expr_item->walk(&Item::register_field_in_read_map,1,arg); + res= field->vcol_info->expr->walk(&Item::register_field_in_read_map,1,arg); } if (field->table == table || !table) bitmap_set_bit(field->table->read_set, field->field_index); @@ -1000,8 +1000,8 @@ bool Item_field::update_vcol_processor(void *arg) if (field->vcol_info && !bitmap_fast_test_and_set(map, field->field_index)) { - field->vcol_info->expr_item->walk(&Item::update_vcol_processor, 0, arg); - field->vcol_info->expr_item->save_in_field(field, 0); + field->vcol_info->expr->walk(&Item::update_vcol_processor, 0, arg); + field->vcol_info->expr->save_in_field(field, 0); } return 0; } @@ -8642,7 +8642,7 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) { fix_session_vcol_expr_for_read(thd, field, field->default_value); if (thd->mark_used_columns != MARK_COLUMNS_NONE) - field->default_value->expr_item->walk(&Item::register_field_in_read_map, 1, 0); + field->default_value->expr->walk(&Item::register_field_in_read_map, 1, 0); IF_DBUG(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED } return FALSE; @@ -10454,9 +10454,9 @@ void Item::register_in(THD *thd) void Virtual_column_info::print(String *str) { - expr_item->print(str, (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF | - QT_ITEM_IDENT_SKIP_DB_NAMES | - QT_ITEM_IDENT_SKIP_TABLE_NAMES | - QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | - QT_TO_SYSTEM_CHARSET)); + expr->print(str, (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF | + QT_ITEM_IDENT_SKIP_DB_NAMES | + QT_ITEM_IDENT_SKIP_TABLE_NAMES | + QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | + QT_TO_SYSTEM_CHARSET)); } diff --git a/sql/item.h b/sql/item.h index c3128b35c52..9b7f43edb1b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5788,7 +5788,7 @@ inline bool Virtual_column_info::is_equal(const Virtual_column_info* vcol) const { return field_type == vcol->get_real_type() && stored_in_db == vcol->is_stored() - && expr_item->eq(vcol->expr_item, true); + && expr->eq(vcol->expr, true); } #endif /* SQL_ITEM_INCLUDED */ diff --git a/sql/item_func.cc b/sql/item_func.cc index b03e65a2431..64e4db80aa9 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4747,7 +4747,7 @@ bool Item_func_set_user_var::register_field_in_read_map(void *arg) bitmap_set_bit(result_field->table->read_set, result_field->field_index); if (result_field->vcol_info) return result_field->vcol_info-> - expr_item->walk(&Item::register_field_in_read_map, 1, arg); + expr->walk(&Item::register_field_in_read_map, 1, arg); } return 0; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 024e9fa1cc7..1ca7e9c1574 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7950,7 +7950,7 @@ void switch_defaults_to_nullable_trigger_fields(TABLE *table) for (Field **field_ptr= table->default_field; *field_ptr ; field_ptr++) { Field *field= (*field_ptr); - field->default_value->expr_item->walk(&Item::switch_to_nullable_fields_processor, 1, trigger_field); + field->default_value->expr->walk(&Item::switch_to_nullable_fields_processor, 1, trigger_field); *field_ptr= (trigger_field[field->field_index]); } } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f918e547148..901fd485390 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2357,7 +2357,7 @@ end_create: if (vcol) \ { \ (vcol)= (Virtual_column_info*)(thd)->memdup((vcol), sizeof(*(vcol))); \ - (vcol)->expr_item= NULL; \ + (vcol)->expr= NULL; \ } /** diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e2f9e9432af..c6a5222f7b0 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1663,7 +1663,7 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, if (field->default_value) { field->default_value->print(&str); - if (field->default_value->expr_item->need_parentheses_in_default()) + if (field->default_value->expr->need_parentheses_in_default()) { def_value->set_charset(&my_charset_utf8mb4_general_ci); def_value->append('('); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1e985bc240b..5ae8fd8270b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3345,8 +3345,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, We can only do this for constants as we have not yet run fix_fields. */ if (sql_field->default_value && - sql_field->default_value->expr_item->basic_const_item() && - save_cs != sql_field->default_value->expr_item->collation.collation && + sql_field->default_value->expr->basic_const_item() && + save_cs != sql_field->default_value->expr->collation.collation && (sql_field->sql_type == MYSQL_TYPE_VAR_STRING || sql_field->sql_type == MYSQL_TYPE_STRING || sql_field->sql_type == MYSQL_TYPE_SET || @@ -3357,7 +3357,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, sql_field->sql_type == MYSQL_TYPE_ENUM)) { Item *item; - if (!(item= sql_field->default_value->expr_item-> + if (!(item= sql_field->default_value->expr-> safe_charset_converter(thd, save_cs))) { /* Could not convert */ @@ -3365,16 +3365,16 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(TRUE); } /* Fix for prepare statement */ - thd->change_item_tree(&sql_field->default_value->expr_item, item); + thd->change_item_tree(&sql_field->default_value->expr, item); } if (sql_field->default_value && - sql_field->default_value->expr_item->basic_const_item() && + sql_field->default_value->expr->basic_const_item() && (sql_field->sql_type == MYSQL_TYPE_SET || sql_field->sql_type == MYSQL_TYPE_ENUM)) { StringBuffer str; - String *def= sql_field->default_value->expr_item->val_str(&str); + String *def= sql_field->default_value->expr->val_str(&str); bool not_found; if (def == NULL) /* SQL "NULL" maps to NULL */ { @@ -6412,7 +6412,7 @@ static bool fill_alter_inplace_info(THD *thd, uses DEFAULT() function. The check is kind of expensive, so don't do it if ALTER_COLUMN_VCOL is already set. */ - if (field->vcol_info->expr_item->walk( + if (field->vcol_info->expr->walk( &Item::check_func_default_processor, 0, 0)) { ha_alter_info->handler_flags|= alter_expr; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1885c2e5aa5..55c5767d636 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -918,7 +918,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, Item *expr) mem_alloc_error(sizeof(Virtual_column_info)); return 0; } - v->expr_item= expr; + v->expr= expr; v->utf8= 0; /* connection charset */ return v; } diff --git a/sql/table.cc b/sql/table.cc index 848352419d5..79f7a6d5d12 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1039,7 +1039,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, case VCOL_GENERATED_STORED: vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, (*field_ptr)->vcol_info, error_reported); - DBUG_ASSERT((*field_ptr)->vcol_info->expr_item == NULL); + DBUG_ASSERT((*field_ptr)->vcol_info->expr == NULL); (*field_ptr)->vcol_info= vcol; *(vfield_ptr++)= *field_ptr; break; @@ -1047,7 +1047,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, (*field_ptr)->default_value, error_reported); - DBUG_ASSERT((*field_ptr)->default_value->expr_item == NULL); + DBUG_ASSERT((*field_ptr)->default_value->expr == NULL); (*field_ptr)->default_value= vcol; *(dfield_ptr++)= *field_ptr; break; @@ -1055,7 +1055,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, (*field_ptr)->check_constraint, error_reported); - DBUG_ASSERT((*field_ptr)->check_constraint->expr_item == NULL); + DBUG_ASSERT((*field_ptr)->check_constraint->expr == NULL); (*field_ptr)->check_constraint= vcol; *check_constraint_ptr++= vcol; break; @@ -1081,10 +1081,10 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, vcol= unpack_vcol_info_from_frm(thd, mem_root, table, (uchar*)buf, len, (*field_ptr)->default_value, error_reported); - DBUG_ASSERT((*field_ptr)->default_value->expr_item == NULL); + DBUG_ASSERT((*field_ptr)->default_value->expr == NULL); (*field_ptr)->default_value= vcol; *(dfield_ptr++)= *field_ptr; - if (!field->default_value->expr_item) + if (!field->default_value->expr) DBUG_RETURN(1); } else if (field->has_update_default_function() && !field->default_value) @@ -2663,7 +2663,7 @@ static bool fix_vcol_expr(THD *thd, Virtual_column_info *vcol) const char *save_where= thd->where; thd->where= "virtual column function"; - int error= vcol->expr_item->fix_fields(thd, &vcol->expr_item); + int error= vcol->expr->fix_fields(thd, &vcol->expr); thd->mark_used_columns= save_mark_used_columns; thd->where= save_where; @@ -2690,8 +2690,8 @@ bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol) if (!(vcol->flags & (VCOL_TIME_FUNC|VCOL_SESSION_FUNC))) DBUG_RETURN(0); - vcol->expr_item->cleanup(); - DBUG_ASSERT(!vcol->expr_item->fixed); + vcol->expr->cleanup(); + DBUG_ASSERT(!vcol->expr->fixed); DBUG_RETURN(fix_vcol_expr(thd, vcol)); } @@ -2747,7 +2747,7 @@ bool fix_session_vcol_expr_for_read(THD *thd, Field *field, static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Virtual_column_info *vcol) { - Item* func_expr= vcol->expr_item; + Item* func_expr= vcol->expr; DBUG_ENTER("fix_and_check_vcol_expr"); DBUG_PRINT("info", ("vcol: %p", vcol)); DBUG_ASSERT(func_expr); @@ -2762,7 +2762,7 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, DBUG_RETURN(0); // already checked, no need to do it again /* fix_fields could've changed the expression */ - func_expr= vcol->expr_item; + func_expr= vcol->expr; /* this was checked in check_expression(), but the frm could be mangled... */ if (unlikely(func_expr->result_type() == ROW_RESULT)) @@ -2941,7 +2941,7 @@ end: static bool check_vcol_forward_refs(Field *field, Virtual_column_info *vcol) { bool res= vcol && - vcol->expr_item->walk(&Item::check_field_expression_processor, 0, + vcol->expr->walk(&Item::check_field_expression_processor, 0, field); return res; } @@ -5077,7 +5077,7 @@ int TABLE::verify_constraints(bool ignore_failure) { for (Virtual_column_info **chk= check_constraints ; *chk ; chk++) { - if ((*chk)->expr_item->val_int() == 0) + if ((*chk)->expr->val_int() == 0) { my_error(ER_CONSTRAINT_FAILED, MYF(ignore_failure ? ME_JUST_WARNING : 0), (*chk)->name.str, @@ -6187,9 +6187,9 @@ void TABLE::mark_columns_used_by_index_no_reset(uint index, { bitmap_set_bit(bitmap, key_part->fieldnr-1); if (key_part->field->vcol_info && - key_part->field->vcol_info->expr_item) + key_part->field->vcol_info->expr) key_part->field->vcol_info-> - expr_item->walk(&Item::register_field_in_bitmap, 1, bitmap); + expr->walk(&Item::register_field_in_bitmap, 1, bitmap); } } @@ -6553,7 +6553,7 @@ bool TABLE::mark_virtual_col(Field *field) DBUG_ASSERT(field->vcol_info); if (!(res= bitmap_fast_test_and_set(vcol_set, field->field_index))) { - Item *vcol_item= field->vcol_info->expr_item; + Item *vcol_item= field->vcol_info->expr; DBUG_ASSERT(vcol_item); vcol_item->walk(&Item::register_field_in_read_map, 1, 0); } @@ -6611,7 +6611,7 @@ bool TABLE::mark_virtual_columns_for_write(bool insert_fl) else { MY_BITMAP *save_read_set= read_set, *save_vcol_set= vcol_set; - Item *vcol_item= tmp_vfield->vcol_info->expr_item; + Item *vcol_item= tmp_vfield->vcol_info->expr; DBUG_ASSERT(vcol_item); bitmap_clear_all(&tmp_set); read_set= vcol_set= &tmp_set; @@ -6652,7 +6652,7 @@ void TABLE::mark_columns_used_by_check_constraints(void) read_set= s->check_set; for (Virtual_column_info **chk= check_constraints ; *chk ; chk++) - (*chk)->expr_item->walk(&Item::register_field_in_read_map, 1, 0); + (*chk)->expr->walk(&Item::register_field_in_read_map, 1, 0); read_set= save_read_set; s->check_set_initialized= 1; @@ -6680,7 +6680,7 @@ void TABLE::mark_default_fields_for_write(bool is_insert) if (is_insert && field->default_value) { bitmap_set_bit(write_set, field->field_index); - field->default_value->expr_item-> + field->default_value->expr-> walk(&Item::register_field_in_read_map, 1, 0); } else if (!is_insert && field->has_update_default_function()) @@ -7355,7 +7355,7 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) vf= (*vfield_ptr); Virtual_column_info *vcol_info= vf->vcol_info; DBUG_ASSERT(vcol_info); - DBUG_ASSERT(vcol_info->expr_item); + DBUG_ASSERT(vcol_info->expr); bool update; switch (update_mode) { @@ -7382,7 +7382,7 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) if (update) { /* Compute the actual value of the virtual fields */ - vcol_info->expr_item->save_in_field(vf, 0); + vcol_info->expr->save_in_field(vf, 0); DBUG_PRINT("info", ("field '%s' - updated", vf->field_name)); } else @@ -7400,8 +7400,8 @@ int TABLE::update_virtual_field(Field *vf) in_use->reset_arena_for_cached_items(expr_arena); bitmap_clear_all(&tmp_set); - vf->vcol_info->expr_item->walk(&Item::update_vcol_processor, 0, &tmp_set); - vf->vcol_info->expr_item->save_in_field(vf, 0); + vf->vcol_info->expr->walk(&Item::update_vcol_processor, 0, &tmp_set); + vf->vcol_info->expr->save_in_field(vf, 0); in_use->reset_arena_for_cached_items(0); DBUG_RETURN(0); } @@ -7450,7 +7450,7 @@ int TABLE::update_default_fields(bool update_command, bool ignore_errors) { if (field->default_value && (field->default_value->flags || field->flags & BLOB_FLAG)) - res|= (field->default_value->expr_item->save_in_field(field, 0) < 0); + res|= (field->default_value->expr->save_in_field(field, 0) < 0); } else res|= field->evaluate_update_default_function(); diff --git a/sql/unireg.cc b/sql/unireg.cc index c102835a7bb..959f8341a90 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -981,7 +981,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, if (field->default_value && !field->default_value->flags && !(field->flags & BLOB_FLAG)) { - Item *expr= field->default_value->expr_item; + Item *expr= field->default_value->expr; int res= !expr->fixed && // may be already fixed if ALTER TABLE expr->fix_fields(thd, &expr); if (!res) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a235195ae91..492e1a70602 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11811,7 +11811,7 @@ prepare_vcol_for_base_setup( field->table->read_set = field->table->vcol_set = &field->table->tmp_set; bitmap_clear_all(&field->table->tmp_set); - field->vcol_info->expr_item->walk( + field->vcol_info->expr->walk( &Item::register_field_in_read_map, 1, field->table); col->num_base= bitmap_bits_set(&field->table->tmp_set); if (col->num_base != 0) { From 6b0f4c24ab9ac078d09d93f6f4ed7c46213f1a08 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 12:09:05 +0100 Subject: [PATCH 086/135] cleanup: unpack_vcol_info_from_frm * do setup/cleanup for charset and arena only once per table not for every vcol * don't copy every vcol expression into table's memroot for parsing, do it in a temporary String buffer that is freed at the end * add asserts --- sql/sql_yacc.yy | 10 ++- sql/table.cc | 168 +++++++++++++++++++----------------------------- 2 files changed, 74 insertions(+), 104 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 55c5767d636..f172e086580 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6221,7 +6221,7 @@ vcol_attribute: ; parse_vcol_expr: - PARSE_VCOL_EXPR_SYM virtual_column_func + PARSE_VCOL_EXPR_SYM { /* "PARSE_VCOL_EXPR" can only be used by the SQL server @@ -6229,7 +6229,13 @@ parse_vcol_expr: Prevent the end user from invoking this command. */ MYSQL_YYABORT_UNLESS(Lex->parse_vcol_expr); - Lex->last_field->vcol_info= $2; + } + expr + { + Virtual_column_info *v= add_virtual_expression(thd, $3); + if (!v) + MYSQL_YYABORT; + Lex->last_field->vcol_info= v; } ; diff --git a/sql/table.cc b/sql/table.cc index 79f7a6d5d12..84e61ade53b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -48,7 +48,7 @@ #define MYSQL57_GCOL_HEADER_SIZE 4 static Virtual_column_info * unpack_vcol_info_from_frm(THD *, MEM_ROOT *, - TABLE *, const uchar *, size_t, Virtual_column_info *, bool *); + TABLE *, String *, Virtual_column_info **, bool *); static bool check_vcol_forward_refs(Field *, Virtual_column_info *); /* INFORMATION_SCHEMA name */ @@ -971,8 +971,8 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share, expression 10.1- byte 1 = 1 | 2 - byte 2 = sql_type - byte 3 = stored_in_db + byte 2 = sql_type ; but TABLE::init_from_binary_frm_image() + byte 3 = stored_in_db ; has put expr_length here [byte 4] = optional interval_id for sql_type (if byte 1 == 2) expression 10.2+ @@ -986,13 +986,19 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share, bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, bool *error_reported) { + CHARSET_INFO *save_character_set_client= thd->variables.character_set_client; + CHARSET_INFO *save_collation= thd->variables.collation_connection; + Query_arena *backup_stmt_arena_ptr= thd->stmt_arena; const uchar *pos= table->s->vcol_defs.str; const uchar *end= pos + table->s->vcol_defs.length; Field **field_ptr= table->field - 1; Field **vfield_ptr= table->vfield; Field **dfield_ptr= table->default_field; Virtual_column_info **check_constraint_ptr= table->check_constraints; + Query_arena backup_arena; Virtual_column_info *vcol; + StringBuffer expr_str; + bool res= 1; DBUG_ENTER("parse_vcol_defs"); if (check_constraint_ptr) @@ -1000,6 +1006,21 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, table->s->check_constraints, table->s->table_check_constraints * sizeof(Virtual_column_info*)); + DBUG_ASSERT(table->expr_arena == NULL); + /* + We need to use CONVENTIONAL_EXECUTION here to ensure that + any new items created by fix_fields() are not reverted. + */ + table->expr_arena= new (alloc_root(mem_root, sizeof(Query_arena))) + Query_arena(mem_root, Query_arena::STMT_CONVENTIONAL_EXECUTION); + if (!table->expr_arena) + DBUG_RETURN(1); + + thd->set_n_backup_active_arena(table->expr_arena, &backup_arena); + thd->stmt_arena= table->expr_arena; + thd->update_charset(&my_charset_utf8mb4_general_ci, table->s->table_charset); + expr_str.append(&parse_vcol_keyword); + while (pos < end) { uint type, expr_length; @@ -1024,7 +1045,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, if (!*field_ptr) { open_table_error(table->s, OPEN_FRM_CORRUPTED, 1); - DBUG_RETURN(1); + goto end; } type= (*field_ptr)->vcol_info->stored_in_db ? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL; @@ -1034,39 +1055,37 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, else pos+= pos[0] == 2 ? 4 : 3; // MariaDB from 5.2 to 10.1 } + + expr_str.length(parse_vcol_keyword.length); + expr_str.append((char*)pos, expr_length); + switch (type) { case VCOL_GENERATED_VIRTUAL: case VCOL_GENERATED_STORED: - vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, - (*field_ptr)->vcol_info, error_reported); - DBUG_ASSERT((*field_ptr)->vcol_info->expr == NULL); - (*field_ptr)->vcol_info= vcol; + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + &((*field_ptr)->vcol_info), error_reported); *(vfield_ptr++)= *field_ptr; break; case VCOL_DEFAULT: - vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, - (*field_ptr)->default_value, + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + &((*field_ptr)->default_value), error_reported); - DBUG_ASSERT((*field_ptr)->default_value->expr == NULL); - (*field_ptr)->default_value= vcol; *(dfield_ptr++)= *field_ptr; break; case VCOL_CHECK_FIELD: - vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, - (*field_ptr)->check_constraint, + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + &((*field_ptr)->check_constraint), error_reported); - DBUG_ASSERT((*field_ptr)->check_constraint->expr == NULL); - (*field_ptr)->check_constraint= vcol; - *check_constraint_ptr++= vcol; + *check_constraint_ptr++= (*field_ptr)->check_constraint; break; case VCOL_CHECK_TABLE: - vcol= unpack_vcol_info_from_frm(thd, mem_root, table, pos, expr_length, - *check_constraint_ptr, error_reported); - *check_constraint_ptr++= vcol; + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + check_constraint_ptr, error_reported); + check_constraint_ptr++; break; } if (!vcol) - DBUG_RETURN(1); + goto end; pos+= expr_length; } @@ -1076,16 +1095,16 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, Field *field= *field_ptr; if (field->has_default_now_unireg_check()) { - char buf[256]; - size_t len= my_snprintf(buf, sizeof(buf), "current_timestamp(%u)", field->decimals()); - vcol= unpack_vcol_info_from_frm(thd, mem_root, table, (uchar*)buf, len, - (*field_ptr)->default_value, + expr_str.length(parse_vcol_keyword.length); + expr_str.append(STRING_WITH_LEN("current_timestamp(")); + expr_str.append_ulonglong(field->decimals()); + expr_str.append(')'); + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + &((*field_ptr)->default_value), error_reported); - DBUG_ASSERT((*field_ptr)->default_value->expr == NULL); - (*field_ptr)->default_value= vcol; *(dfield_ptr++)= *field_ptr; if (!field->default_value->expr) - DBUG_RETURN(1); + goto end; } else if (field->has_update_default_function() && !field->default_value) *(dfield_ptr++)= *field_ptr; @@ -1107,10 +1126,16 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, if (check_vcol_forward_refs(field, field->vcol_info) || check_vcol_forward_refs(field, field->check_constraint) || check_vcol_forward_refs(field, field->default_value)) - DBUG_RETURN(1); + goto end; } - DBUG_RETURN(0); + res=0; +end: + thd->restore_active_arena(table->expr_arena, &backup_arena); + thd->stmt_arena= backup_stmt_arena_ptr; + if (save_character_set_client) + thd->update_charset(save_character_set_client, save_collation); + DBUG_RETURN(res); } /** @@ -2834,106 +2859,45 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, static Virtual_column_info * unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, TABLE *table, - const uchar *expr_str, size_t expr_str_length, - Virtual_column_info *vcol, bool *error_reported) + String *expr_str, Virtual_column_info **vcol_ptr, + bool *error_reported) { - char *vcol_expr_str; - int str_len; - CHARSET_INFO *save_character_set_client, *save_collation; - Query_arena *backup_stmt_arena_ptr; - Query_arena backup_arena; - Query_arena *vcol_arena= 0; Create_field vcol_storage; // placeholder for vcol_info Parser_state parser_state; - Virtual_column_info *vcol_info= 0; + Virtual_column_info *vcol= *vcol_ptr, *vcol_info= 0; LEX *old_lex= thd->lex; LEX lex; bool error; DBUG_ENTER("unpack_vcol_info_from_frm"); - save_character_set_client= thd->variables.character_set_client; - save_collation= thd->variables.collation_connection; - backup_stmt_arena_ptr= thd->stmt_arena; - - /* - Step 1: Construct the input string for the parser. - The string to be parsed has to be of the following format: - "PARSE_VCOL_EXPR ()". - */ + DBUG_ASSERT(vcol->expr == NULL); - if (!(vcol_expr_str= (char*) alloc_root(mem_root, - expr_str_length + - parse_vcol_keyword.length + 3))) - DBUG_RETURN(0); - memcpy(vcol_expr_str, parse_vcol_keyword.str, parse_vcol_keyword.length); - str_len= parse_vcol_keyword.length; - vcol_expr_str[str_len++]= '('; - memcpy(vcol_expr_str + str_len, expr_str, expr_str_length); - str_len+= expr_str_length; - vcol_expr_str[str_len++]= ')'; - vcol_expr_str[str_len++]= 0; - - if (parser_state.init(thd, vcol_expr_str, str_len)) - goto err; - - /* - Step 2: Setup thd for parsing. - */ - vcol_arena= table->expr_arena; - if (!vcol_arena) - { - /* - We need to use CONVENTIONAL_EXECUTION here to ensure that - any new items created by fix_fields() are not reverted. - */ - Query_arena expr_arena(mem_root, - Query_arena::STMT_CONVENTIONAL_EXECUTION); - if (!(vcol_arena= (Query_arena *) alloc_root(mem_root, - sizeof(Query_arena)))) - goto err; - *vcol_arena= expr_arena; - table->expr_arena= vcol_arena; - } - thd->set_n_backup_active_arena(vcol_arena, &backup_arena); - thd->stmt_arena= vcol_arena; + if (parser_state.init(thd, expr_str->c_ptr(), expr_str->length())) + goto end; if (init_lex_with_single_table(thd, table, &lex)) - goto err; + goto end; - lex.parse_vcol_expr= TRUE; + lex.parse_vcol_expr= true; lex.last_field= &vcol_storage; - /* - Step 3: Use the parser to build an Item object from vcol_expr_str. - */ - if (vcol->utf8) - { - thd->update_charset(&my_charset_utf8mb4_general_ci, - table->s->table_charset); - } error= parse_sql(thd, &parser_state, NULL); if (error) - goto err; + goto end; vcol_storage.vcol_info->stored_in_db= vcol->stored_in_db; vcol_storage.vcol_info->name= vcol->name; vcol_storage.vcol_info->utf8= vcol->utf8; if (!fix_and_check_vcol_expr(thd, table, vcol_storage.vcol_info)) { - vcol_info= vcol_storage.vcol_info; // Expression ok + *vcol_ptr= vcol_info= vcol_storage.vcol_info; // Expression ok + DBUG_ASSERT(vcol_info->expr); goto end; } *error_reported= TRUE; -err: - thd->free_items(); end: - thd->stmt_arena= backup_stmt_arena_ptr; - if (vcol_arena) - thd->restore_active_arena(vcol_arena, &backup_arena); end_lex_with_single_table(thd, table, old_lex); - if (vcol->utf8) - thd->update_charset(save_character_set_client, save_collation); DBUG_RETURN(vcol_info); } From d1f3763323ff597e702f36e75633392dd52b60c1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 14:57:43 +0100 Subject: [PATCH 087/135] bugfix: non-deterministic vcols in indexes --- mysql-test/suite/vcol/inc/vcol_keys.inc | 25 +++++++++++++++++-- .../suite/vcol/r/vcol_keys_innodb.result | 20 +++++++++++++-- .../suite/vcol/r/vcol_keys_myisam.result | 20 +++++++++++++-- sql/sql_table.cc | 17 ++++++++++--- 4 files changed, 73 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/vcol/inc/vcol_keys.inc b/mysql-test/suite/vcol/inc/vcol_keys.inc index 95fd8a6488d..42510588f34 100644 --- a/mysql-test/suite/vcol/inc/vcol_keys.inc +++ b/mysql-test/suite/vcol/inc/vcol_keys.inc @@ -157,6 +157,27 @@ drop table t1; --echo # - vcol_ins_upd.inc --echo # - vcol_select.inc ---echo # ---echo # TODO: CHECK +# +# Restrictions when indexed: +# +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b timestamp as (now()), key (b)); +create table t1 (a int, b timestamp as (now())); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add index (b); +drop table t1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b varchar(100) as (user()), key (b)); +create table t1 (a int, b varchar(100) as (user())); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add index (b); +drop table t1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b double as (rand()), key (b)); +create table t1 (a int, b double as (rand())); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add index (b); +drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 843bd6efc8e..c9c95e912df 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -150,5 +150,21 @@ drop table t1; # on virtual columns can be found in: # - vcol_ins_upd.inc # - vcol_select.inc -# -# TODO: CHECK +create table t1 (a int, b timestamp as (now()), key (b)); +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b timestamp as (now())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +create table t1 (a int, b varchar(100) as (user()), key (b)); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b varchar(100) as (user())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +create table t1 (a int, b double as (rand()), key (b)); +ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b double as (rand())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index 2a551956173..17f6fba7e89 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -260,5 +260,21 @@ drop table t1; # on virtual columns can be found in: # - vcol_ins_upd.inc # - vcol_select.inc -# -# TODO: CHECK +create table t1 (a int, b timestamp as (now()), key (b)); +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b timestamp as (now())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +create table t1 (a int, b varchar(100) as (user()), key (b)); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b varchar(100) as (user())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +create table t1 (a int, b double as (rand()), key (b)); +ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create table t1 (a int, b double as (rand())); +alter table t1 add index (b); +ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5ae8fd8270b..11abeac90d0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3877,10 +3877,21 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } #endif - if (key->type == Key::PRIMARY && sql_field->vcol_info) + if (sql_field->vcol_info) { - my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0)); - DBUG_RETURN(TRUE); + if (key->type == Key::PRIMARY) + { + my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0)); + DBUG_RETURN(TRUE); + } + if (sql_field->vcol_info->flags & VCOL_NOT_STRICTLY_DETERMINISTIC) + { + /* use check_expression() to report an error */ + check_expression(sql_field->vcol_info, sql_field->field_name, + VCOL_GENERATED_STORED); + DBUG_ASSERT(thd->is_error()); + DBUG_RETURN(TRUE); + } } if (!(sql_field->flags & NOT_NULL_FLAG)) { From 2a0f7a34d6ab31aa23522a78ea9fefdf871ea63a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Nov 2016 17:24:42 +0100 Subject: [PATCH 088/135] bugfix: non-deterministic vcols in partitioning --- mysql-test/suite/vcol/inc/vcol_partition.inc | 11 +++++++++++ mysql-test/suite/vcol/r/vcol_partition_innodb.result | 6 ++++++ mysql-test/suite/vcol/r/vcol_partition_myisam.result | 6 ++++++ sql/item.cc | 8 ++++++++ sql/item.h | 1 + sql/table.cc | 2 ++ 6 files changed, 34 insertions(+) diff --git a/mysql-test/suite/vcol/inc/vcol_partition.inc b/mysql-test/suite/vcol/inc/vcol_partition.inc index b2c0c90ff69..8a667b6e149 100644 --- a/mysql-test/suite/vcol/inc/vcol_partition.inc +++ b/mysql-test/suite/vcol/inc/vcol_partition.inc @@ -126,3 +126,14 @@ select * from t1; select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; drop table t1; + +# +# Restrictions when partitioned +# + +--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR +create table t1 (a int, b datetime as (now())) partition by hash(b+1) partitions 3; +--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR +create table t1 (a int, b varchar(100) as (user())) partition by hash(b+1) partitions 3; +--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR +create table t1 (a int, b double as (rand())) partition by hash(b+1) partitions 3; diff --git a/mysql-test/suite/vcol/r/vcol_partition_innodb.result b/mysql-test/suite/vcol/r/vcol_partition_innodb.result index 6a7978a8bf4..4c869a0a37d 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_partition_innodb.result @@ -81,3 +81,9 @@ p0 1 16384 p1 1 16384 p2 0 16384 drop table t1; +create table t1 (a int, b datetime as (now())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +create table t1 (a int, b varchar(100) as (user())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +create table t1 (a int, b double as (rand())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed diff --git a/mysql-test/suite/vcol/r/vcol_partition_myisam.result b/mysql-test/suite/vcol/r/vcol_partition_myisam.result index cb6f7fe1eca..aeeaec2ac22 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_partition_myisam.result @@ -81,3 +81,9 @@ p0 1 7 p1 1 7 p2 0 0 drop table t1; +create table t1 (a int, b datetime as (now())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +create table t1 (a int, b varchar(100) as (user())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +create table t1 (a int, b double as (rand())) partition by hash(b+1) partitions 3; +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed diff --git a/sql/item.cc b/sql/item.cc index f8f776a2b28..9d244954b85 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5576,6 +5576,14 @@ bool Item_field::vcol_in_partition_func_processor(void *int_arg) return FALSE; } +bool Item_field::check_valid_arguments_processor(void *bool_arg) +{ + Virtual_column_info *vcol= field->vcol_info; + if (!vcol) + return FALSE; + return vcol->expr->walk(&Item::check_partition_func_processor, 0, NULL) + || vcol->expr->walk(&Item::check_valid_arguments_processor, 0, NULL); +} void Item_field::cleanup() { diff --git a/sql/item.h b/sql/item.h index 9b7f43edb1b..313cec8173d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2576,6 +2576,7 @@ public: bool register_field_in_bitmap(void *arg); bool check_partition_func_processor(void *int_arg) {return FALSE;} bool vcol_in_partition_func_processor(void *bool_arg); + bool check_valid_arguments_processor(void *bool_arg); bool check_field_expression_processor(void *arg); bool enumerate_field_refs_processor(void *arg); bool update_table_bitmaps_processor(void *arg); diff --git a/sql/table.cc b/sql/table.cc index 84e61ade53b..1496d1b8c46 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3339,6 +3339,8 @@ partititon_err: outparam->file= 0; // For easier error checking outparam->db_stat=0; thd->lex->context_analysis_only= save_context_analysis_only; + if (outparam->expr_arena) + outparam->expr_arena->free_items(); free_root(&outparam->mem_root, MYF(0)); // Safe to call on bzero'd root outparam->alias.free(); DBUG_RETURN (error); From 44ca4993b85461a4bdc5f53fd6fdedcc116f2e8b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 16 Nov 2016 21:53:35 +0100 Subject: [PATCH 089/135] bugfix: partitioning and keyread on an indexed vcol --- mysql-test/suite/vcol/r/partition.result | 20 ++++++++++++++++++++ mysql-test/suite/vcol/t/partition.test | 20 ++++++++++++++++++++ sql/ha_partition.cc | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/vcol/r/partition.result create mode 100644 mysql-test/suite/vcol/t/partition.test diff --git a/mysql-test/suite/vcol/r/partition.result b/mysql-test/suite/vcol/r/partition.result new file mode 100644 index 00000000000..349deed653d --- /dev/null +++ b/mysql-test/suite/vcol/r/partition.result @@ -0,0 +1,20 @@ +CREATE TABLE t1 ( +id INT NOT NULL, +store_id INT NOT NULL, +x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( +PARTITION p0 VALUES LESS THAN (6), +PARTITION p1 VALUES LESS THAN (11), +PARTITION p2 VALUES LESS THAN (16), +PARTITION p3 VALUES LESS THAN (21) +); +INSERT t1 (id, store_id) VALUES(1, 2), (3, 4), (3, 12), (4, 18); +CREATE INDEX idx ON t1(x); +SELECT x FROM t1; +x +3 +7 +15 +22 +DROP TABLE t1; diff --git a/mysql-test/suite/vcol/t/partition.test b/mysql-test/suite/vcol/t/partition.test new file mode 100644 index 00000000000..67cda6b6d8b --- /dev/null +++ b/mysql-test/suite/vcol/t/partition.test @@ -0,0 +1,20 @@ +# +# test keyread on an indexed vcol +# +--source include/have_partition.inc + +CREATE TABLE t1 ( + id INT NOT NULL, + store_id INT NOT NULL, + x INT GENERATED ALWAYS AS (id + store_id) +) +PARTITION BY RANGE (store_id) ( + PARTITION p0 VALUES LESS THAN (6), + PARTITION p1 VALUES LESS THAN (11), + PARTITION p2 VALUES LESS THAN (16), + PARTITION p3 VALUES LESS THAN (21) +); +INSERT t1 (id, store_id) VALUES(1, 2), (3, 4), (3, 12), (4, 18); +CREATE INDEX idx ON t1(x); +SELECT x FROM t1; +DROP TABLE t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index a54d406f9eb..d1a5a7bb0ea 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3434,7 +3434,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) } m_start_key.length= 0; m_rec0= table->record[0]; - m_rec_length= table_share->stored_rec_length; + m_rec_length= table_share->reclength; if (!m_part_ids_sorted_by_num_of_records) { if (!(m_part_ids_sorted_by_num_of_records= From 6eaa5fd21081c23f3d4da5be71a32886d98de5e9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 17 Nov 2016 15:47:27 +0100 Subject: [PATCH 090/135] bugfix: InnoDB doesn't support ICP on vcols --- mysql-test/suite/gcol/r/innodb_virtual_basic.result | 2 ++ mysql-test/suite/gcol/t/innodb_virtual_basic.test | 2 ++ storage/innobase/handler/ha_innodb.cc | 3 +++ 3 files changed, 7 insertions(+) diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result index bcd969c84fb..1d40e93cd09 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result @@ -1504,6 +1504,8 @@ NULL NULL NULL 0 +SELECT * FROM t WHERE d > 0; +a b d SELECT * FROM t; a b d 0 0 0 diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test index 342d9e42976..d0df2dc9762 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test @@ -1415,6 +1415,8 @@ ALTER TABLE t DROP COLUMN c, ADD INDEX vidx(d), ALGORITHM=INPLACE; SELECT d FROM t; +SELECT * FROM t WHERE d > 0; + SELECT * FROM t; DROP TABLE t; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 492e1a70602..d4446aaa960 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8455,6 +8455,8 @@ ha_innobase::build_template( if (innobase_is_v_fld(table->field[i])) { index_contains = dict_index_contains_col_or_prefix( index, num_v, true); + if (index_contains) + goto no_icp; } else { index_contains = dict_index_contains_col_or_prefix( index, i - num_v, false); @@ -8637,6 +8639,7 @@ ha_innobase::build_template( m_prebuilt->idx_cond = this; } else { +no_icp: mysql_row_templ_t* templ; ulint num_v = 0; /* No index condition pushdown */ From 1db438c83386e0e58487056d6ea25a0f5e97f4d9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 24 Nov 2016 09:49:12 +0100 Subject: [PATCH 091/135] MDEV-11066 use MySQL terminology for "virtual columns" --- include/mysql.h | 6 + mysql-test/r/cast.result | 2 +- mysql-test/r/create.result | 6 +- mysql-test/r/mysql57_virtual.result | 12 +- .../gcol/inc/gcol_blocked_sql_funcs_main.inc | 72 ++-- .../gcol/inc/gcol_column_def_options.inc | 20 +- mysql-test/suite/gcol/inc/gcol_keys.inc | 12 +- .../gcol/inc/gcol_non_stored_columns.inc | 4 +- .../inc/gcol_unsupported_storage_engines.inc | 4 +- mysql-test/suite/gcol/r/gcol_archive.result | 4 +- mysql-test/suite/gcol/r/gcol_blackhole.result | 4 +- mysql-test/suite/gcol/r/gcol_bugfixes.result | 4 +- .../r/gcol_column_def_options_innodb.result | 66 ++-- .../r/gcol_column_def_options_myisam.result | 66 ++-- .../suite/gcol/r/gcol_ins_upd_innodb.result | 12 +- .../suite/gcol/r/gcol_ins_upd_myisam.result | 12 +- .../suite/gcol/r/gcol_keys_innodb.result | 28 +- .../suite/gcol/r/gcol_keys_myisam.result | 42 +- mysql-test/suite/gcol/r/gcol_memory.result | 4 +- mysql-test/suite/gcol/r/gcol_merge.result | 2 +- .../r/gcol_non_stored_columns_innodb.result | 14 +- .../r/gcol_non_stored_columns_myisam.result | 14 +- .../r/gcol_supported_sql_funcs_innodb.result | 366 +++++++++--------- .../r/gcol_supported_sql_funcs_myisam.result | 366 +++++++++--------- .../suite/gcol/r/innodb_virtual_basic.result | 88 ++--- .../suite/gcol/r/innodb_virtual_debug.result | 8 +- .../gcol/r/innodb_virtual_debug_purge.result | 4 +- mysql-test/suite/gcol/r/rpl_gcol.result | 2 +- mysql-test/suite/gcol/t/gcol_bugfixes.test | 2 +- mysql-test/suite/gcol/t/gcol_merge.test | 2 +- .../suite/gcol/t/innodb_virtual_basic.test | 8 +- .../innodb/r/innodb-virtual-columns.result | 50 +-- mysql-test/suite/rpl/t/rpl_gtid_basic.test | 2 +- mysql-test/suite/vcol/inc/vcol_keys.inc | 24 +- .../vcol/inc/vcol_non_stored_columns.inc | 4 +- .../inc/vcol_unsupported_storage_engines.inc | 4 +- .../suite/vcol/r/innodb_autoinc_vcol.result | 2 +- mysql-test/suite/vcol/r/rpl_vcol.result | 2 +- mysql-test/suite/vcol/r/update.result | 8 +- mysql-test/suite/vcol/r/vcol_archive.result | 4 +- mysql-test/suite/vcol/r/vcol_blackhole.result | 4 +- .../r/vcol_column_def_options_innodb.result | 20 +- .../r/vcol_column_def_options_myisam.result | 20 +- mysql-test/suite/vcol/r/vcol_csv.result | 4 +- .../suite/vcol/r/vcol_ins_upd_innodb.result | 20 +- .../suite/vcol/r/vcol_ins_upd_myisam.result | 20 +- .../suite/vcol/r/vcol_keys_innodb.result | 28 +- .../suite/vcol/r/vcol_keys_myisam.result | 28 +- mysql-test/suite/vcol/r/vcol_memory.result | 4 +- mysql-test/suite/vcol/r/vcol_merge.result | 2 +- mysql-test/suite/vcol/r/vcol_misc.result | 44 +-- .../r/vcol_non_stored_columns_innodb.result | 16 +- .../r/vcol_non_stored_columns_myisam.result | 16 +- .../suite/vcol/r/vcol_select_myisam.result | 6 +- .../vcol/r/vcol_supported_sql_funcs.result | 354 ++++++++--------- mysql-test/suite/vcol/r/vcol_syntax.result | 12 +- mysql-test/suite/vcol/t/not_supported.test | 10 +- .../vcol/t/vcol_blocked_sql_funcs_main.inc | 134 +++---- mysql-test/suite/vcol/t/vcol_merge.test | 2 +- mysql-test/suite/vcol/t/vcol_misc.test | 4 +- mysql-test/t/default.test | 64 +-- mysql-test/t/gis-debug.test | 2 +- sql/field.cc | 2 +- sql/share/errmsg-utf8.txt | 40 +- sql/sql_show.cc | 8 +- sql/sql_table.cc | 4 +- storage/innobase/handler/ha_innodb.cc | 2 +- 67 files changed, 1116 insertions(+), 1110 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index eab859270f7..80e75c264e8 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -138,6 +138,12 @@ typedef unsigned long long my_ulonglong; #define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED #define WARN_PLUGIN_DELETE_BUILTIN ER_PLUGIN_DELETE_BUILTIN #define ER_FK_DUP_NAME ER_DUP_CONSTRAINT_NAME +#define ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +#define ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN +#define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN +#define ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN +#define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN +#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS typedef struct st_mysql_rows { struct st_mysql_rows *next; /* list of rows */ diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index ac90a6ec68b..3871dcd11ea 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -804,7 +804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` char(5) AS ((cast('a' as char(10) charset latin1) + `a`)) VIRTUAL + `b` char(5) GENERATED ALWAYS AS ((cast('a' as char(10) charset latin1) + `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select collation(cast("a" as char(10) binary)); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 4baa254a966..d7b8974e014 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1866,8 +1866,8 @@ Thinkpad Laptop black ttt show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `color` char(32) AS (column_get(`dynamic_cols`,1 as char charset latin1)) PERSISTENT, - `cl` char(32) AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 ),2,'ttt'),`i` as char charset latin1)) PERSISTENT, + `color` char(32) GENERATED ALWAYS AS (column_get(`dynamic_cols`,1 as char charset latin1)) STORED, + `cl` char(32) GENERATED ALWAYS AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 ),2,'ttt'),`i` as char charset latin1)) STORED, `item_name` varchar(32) NOT NULL, `i` int(11) DEFAULT NULL, `dynamic_cols` blob DEFAULT NULL, @@ -1888,7 +1888,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) DEFAULT NULL, - `c` char(32) AS (cast(cast(`n` as char charset latin1) as char charset latin1)) PERSISTENT + `c` char(32) GENERATED ALWAYS AS (cast(cast(`n` as char charset latin1) as char charset latin1)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set @@session.collation_server=filename; diff --git a/mysql-test/r/mysql57_virtual.result b/mysql-test/r/mysql57_virtual.result index 6f337c8e7d7..3d5ba5f99cf 100644 --- a/mysql-test/r/mysql57_virtual.result +++ b/mysql-test/r/mysql57_virtual.result @@ -5,8 +5,8 @@ SHOW CREATE TABLE mysql57_virtual; Table Create Table mysql57_virtual CREATE TABLE `mysql57_virtual` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` int(11) AS ((`a` + 3)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into mysql57_virtual (a) values (1),(2); select * from mysql57_virtual; @@ -20,8 +20,8 @@ SHOW CREATE TABLE mysql57_virtual; Table Create Table mysql57_virtual CREATE TABLE `mysql57_virtual` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` int(11) AS ((`a` + 3)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='I am now a MariaDB table' DROP TABLE mysql57_virtual; # @@ -32,7 +32,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) PERSISTENT, - `c` int(11) AS ((`a` + 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) STORED, + `c` int(11) GENERATED ALWAYS AS ((`a` + 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc index b1774490958..88091ce42a4 100644 --- a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc @@ -55,62 +55,62 @@ drop table t1; # --echo # LOAD_FILE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual); --echo # MATCH() if (!$skip_full_text_check) { - -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED + -- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(32), b bool generated always as (match a against ('sample text')) virtual); } --echo # BENCHMARK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual); --echo # FOUND_ROWS() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual); --echo # GET_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual); --echo # IS_FREE_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual); --echo # IS_USED_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual); --echo # LAST_INSERT_ID() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int generated always as (last_insert_id()) virtual); --echo # MASTER_POS_WAIT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(32), b int generated always as (master_pos_wait(a,0,2)) virtual); --echo # NAME_CONST() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual); --echo # RELEASE_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual); --echo # ROW_COUNT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int generated always as (row_count()) virtual); --echo # SLEEP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (sleep(a)) virtual); --echo # VALUES() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual); --echo # Stored procedures @@ -129,16 +129,16 @@ end // delimiter ;// --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int generated always as (p1()) virtual); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int generated always as (f1()) virtual); drop procedure p1; drop function f1; --echo # Unknown functions --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int generated always as (f1()) virtual); --echo # @@ -146,71 +146,71 @@ create table t1 (a int generated always as (f1()) virtual); --echo # --echo # AVG() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (avg(a)) virtual); --echo # BIT_AND() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (bit_and(a)) virtual); --echo # BIT_OR() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (bit_or(a)) virtual); --echo # BIT_XOR() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (bit_xor(a)) virtual); --echo # COUNT(DISTINCT) --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (count(distinct a)) virtual); --echo # COUNT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (count(a)) virtual); --echo # GROUP_CONCAT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual); --echo # MAX() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (max(a)) virtual); --echo # MIN() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (min(a)) virtual); --echo # STD() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (std(a)) virtual); --echo # STDDEV_POP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (stddev_pop(a)) virtual); --echo # STDDEV_SAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (stddev_samp(a)) virtual); --echo # STDDEV() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (stddev(a)) virtual); --echo # SUM() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (sum(a)) virtual); --echo # VAR_POP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (var_pop(a)) virtual); --echo # VAR_SAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (var_samp(a)) virtual); --echo # VARIANCE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b int generated always as (variance(a)) virtual); --echo # @@ -218,7 +218,7 @@ create table t1 (a int, b int generated always as (variance(a)) virtual); --echo # create table t1 (a int); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t2 (a int, b int generated always as (select count(*) virtual from t1)); drop table t1; @@ -243,7 +243,7 @@ drop table t1; --echo # ASSERTION FAILED: TR && TR->TABLE->FILE --echo # create table t1 (a int); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED alter table t1 add column r blob generated always as (match(a) against ('' in boolean mode)) virtual; drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc index c975cfe22fe..bd84ace62ec 100644 --- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -154,11 +154,11 @@ if ($support_virtual_foreign) --error ER_CANT_CREATE_TABLE alter table t1 add constraint foreign key fk(b) references t2(a); } ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; drop table t1; drop table t2; @@ -213,7 +213,7 @@ if (!$support_virtual_index) { --echo # Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON --echo # VIRTUAL GC FOR MYISAM ---error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +--error ER_KEY_BASED_ON_GENERATED_GENERATED_COLUMN CREATE TABLE A ( pk INTEGER, col_int_nokey INTEGER, @@ -231,7 +231,7 @@ CREATE TABLE t1(a bigint AS (a between 1 and 1)); --echo # IN FIND_FIELD_IN_TABLE --echo # CREATE TABLE t1(a int); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS ( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; DROP TABLE t1; @@ -318,12 +318,12 @@ DROP TABLE t1; --echo # IN FIND_FIELD_IN_TABLE --echo # CREATE TABLE t1(a int); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS ( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col))); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual))); DROP TABLE t1; @@ -482,11 +482,11 @@ SELECT * FROM t1 order by col1; SELECT sgc1 FROM t1 order by sgc1; # Change virtual generated column to become stored ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; # Change stored generated column to become virtual ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; # Change base column to become stored generated column: diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc index cd5ae4ea2dd..7f888ef54a5 100644 --- a/mysql-test/suite/gcol/inc/gcol_keys.inc +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -130,22 +130,22 @@ if (!$skip_spatial_index_check) --echo # FOREIGN KEY --echo # Rejected FK options. ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update set null); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update cascade); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on delete set null); create table t1 (a int, b int generated always as (a+1) stored); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on update set null; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on update cascade; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on delete set null; drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc b/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc index bc82512aa21..f32487d20a1 100644 --- a/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc +++ b/mysql-test/suite/gcol/inc/gcol_non_stored_columns.inc @@ -74,14 +74,14 @@ drop table t1; --echo # Case 7. ALTER. Modify virtual stored -> virtual non-stored eval create $opt_tmp table t1 (a int, b int generated always as (a % 2) stored); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN alter table t1 modify b int generated always as (a % 2) virtual; show create table t1; drop table t1; --echo # Case 8. ALTER. Modify virtual non-stored -> virtual stored eval create $opt_tmp table t1 (a int, b int generated always as (a % 2) virtual); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN alter table t1 modify b int generated always as (a % 2) stored; show create table t1; drop table t1; diff --git a/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc b/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc index c6aed0253f6..2b85a2c205a 100644 --- a/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc +++ b/mysql-test/suite/gcol/inc/gcol_unsupported_storage_engines.inc @@ -13,9 +13,9 @@ # Change: # ################################################################################ ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS create table t1 (a int, b int generated always as (a+1) virtual); create table t1 (a int); ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS alter table t1 add column b int generated always as (a+1) virtual; drop table t1; diff --git a/mysql-test/suite/gcol/r/gcol_archive.result b/mysql-test/suite/gcol/r/gcol_archive.result index 0d8072943b7..fb6fd544204 100644 --- a/mysql-test/suite/gcol/r/gcol_archive.result +++ b/mysql-test/suite/gcol/r/gcol_archive.result @@ -1,9 +1,9 @@ SET @@session.default_storage_engine = 'archive'; create table t1 (a int, b int generated always as (a+1) virtual); -ERROR HY000: ARCHIVE storage engine does not support computed columns +ERROR HY000: ARCHIVE storage engine does not support generated columns create table t1 (a int); alter table t1 add column b int generated always as (a+1) virtual; -ERROR HY000: ARCHIVE storage engine does not support computed columns +ERROR HY000: ARCHIVE storage engine does not support generated columns drop table t1; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; diff --git a/mysql-test/suite/gcol/r/gcol_blackhole.result b/mysql-test/suite/gcol/r/gcol_blackhole.result index 2d448566114..3ee4f4e91a4 100644 --- a/mysql-test/suite/gcol/r/gcol_blackhole.result +++ b/mysql-test/suite/gcol/r/gcol_blackhole.result @@ -1,9 +1,9 @@ SET @@session.default_storage_engine = 'blackhole'; create table t1 (a int, b int generated always as (a+1) virtual); -ERROR HY000: BLACKHOLE storage engine does not support computed columns +ERROR HY000: BLACKHOLE storage engine does not support generated columns create table t1 (a int); alter table t1 add column b int generated always as (a+1) virtual; -ERROR HY000: BLACKHOLE storage engine does not support computed columns +ERROR HY000: BLACKHOLE storage engine does not support generated columns drop table t1; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index 5deeeb23baa..6586393a236 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -486,7 +486,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, - `c` char(2) AS (((`a` <> 0) or (`b` <> 0))) VIRTUAL + `c` char(2) GENERATED ALWAYS AS (((`a` <> 0) or (`b` <> 0))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; @@ -507,7 +507,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, - `c` char(2) AS (concat(`a`,`b`)) VIRTUAL + `c` char(2) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index d271edd37cf..9cce19f49b0 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -81,12 +81,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); alter table t1 modify b int generated always as (a % 2) virtual comment 'my comment'; @@ -94,12 +94,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -114,12 +114,12 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t2 (a) values (1); select * from t2; a b @@ -136,12 +136,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -178,11 +178,11 @@ create table t2 (a int); alter table t1 add constraint foreign key fk(d) references t2(a); ERROR 42000: Key column 'd' doesn't exist in table alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column drop table t1; drop table t2; Generated always is optional @@ -191,24 +191,24 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int as (a % 2) stored); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; Default should be non-stored column create table t1 (a int, b int as (a % 2)); @@ -216,12 +216,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; Expression can be constant create table t1 (a int, b int as (5 * 2)); @@ -229,12 +229,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((5 * 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((5 * 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; Test generated columns referencing other generated columns create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual); @@ -294,9 +294,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` varchar(12) AS ('aaaabb') PERSISTENT, - `d` blob AS (`c`) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, + `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1 order by a; a b c d @@ -307,9 +307,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` varchar(12) AS ('aaaabb') PERSISTENT, - `d` blob AS (`c`) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, + `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 CREATE TABLE t3 AS SELECT * FROM t1; SHOW CREATE TABLE t3; @@ -356,13 +356,13 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2; Warnings: -Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +Warning 1906 The value specified for generated column 'c2' in table 't1' ignored CREATE TABLE t2 (a int); INSERT INTO t2 values(1); DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2; Warnings: -Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +Warning 1906 The value specified for generated column 'c2' in table 't1' ignored DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5; SELECT * FROM t1; @@ -572,9 +572,9 @@ sgc1 1000 4000 ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns ALTER TABLE t1 MODIFY COLUMN col4 INTEGER AS (col1 + col2 + col3) STORED; SELECT * FROM t1 order by col1; col1 col2 col3 col4 vgc1 sgc1 @@ -604,7 +604,7 @@ Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) NOT NULL, "b" varchar(10) DEFAULT NULL, - "c" char(3) AS (substr("b",1,3)) VIRTUAL, + "c" char(3) GENERATED ALWAYS AS (substr("b",1,3)) VIRTUAL, PRIMARY KEY ("a"), KEY "c" ("c") ) @@ -619,7 +619,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(10) DEFAULT NULL, - `c` char(3) AS (substr(`b`,1,3)) VIRTUAL, + `c` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, PRIMARY KEY (`a`), KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index 37cdc82710d..a8cd61b413b 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -81,12 +81,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); alter table t1 modify b int generated always as (a % 2) virtual comment 'my comment'; @@ -94,12 +94,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -114,12 +114,12 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t2 (a) values (1); select * from t2; a b @@ -136,12 +136,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -178,11 +178,11 @@ create table t2 (a int); alter table t1 add constraint foreign key fk(d) references t2(a); ERROR 42000: Key column 'd' doesn't exist in table alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column alter table t1 add constraint foreign key fk(c) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add constraint foreign key fk(c) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column drop table t1; drop table t2; Generated always is optional @@ -191,24 +191,24 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int as (a % 2) stored); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; Default should be non-stored column create table t1 (a int, b int as (a % 2)); @@ -216,12 +216,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; Expression can be constant create table t1 (a int, b int as (5 * 2)); @@ -229,12 +229,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((5 * 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((5 * 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; Test generated columns referencing other generated columns create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual); @@ -294,9 +294,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` varchar(12) AS ('aaaabb') PERSISTENT, - `d` blob AS (`c`) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, + `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t1 order by a; a b c d @@ -307,9 +307,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL, - `c` varchar(12) AS ('aaaabb') PERSISTENT, - `d` blob AS (`c`) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, + `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t3 AS SELECT * FROM t1; SHOW CREATE TABLE t3; @@ -356,13 +356,13 @@ DROP TABLE t1; # CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2; Warnings: -Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +Warning 1906 The value specified for generated column 'c2' in table 't1' ignored CREATE TABLE t2 (a int); INSERT INTO t2 values(1); DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2; Warnings: -Warning 1906 The value specified for computed column 'c2' in table 't1' ignored +Warning 1906 The value specified for generated column 'c2' in table 't1' ignored DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5; SELECT * FROM t1; @@ -572,9 +572,9 @@ sgc1 1000 4000 ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) STORED; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns ALTER TABLE t1 MODIFY COLUMN col4 INTEGER AS (col1 + col2 + col3) STORED; SELECT * FROM t1 order by col1; col1 col2 col3 col4 vgc1 sgc1 @@ -604,7 +604,7 @@ Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) NOT NULL, "b" varchar(10) DEFAULT NULL, - "c" char(3) AS (substr("b",1,3)) VIRTUAL, + "c" char(3) GENERATED ALWAYS AS (substr("b",1,3)) VIRTUAL, PRIMARY KEY ("a"), KEY "c" ("c") ) @@ -619,7 +619,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(10) DEFAULT NULL, - `c` char(3) AS (substr(`b`,1,3)) VIRTUAL, + `c` char(3) GENERATED ALWAYS AS (substr(`b`,1,3)) VIRTUAL, PRIMARY KEY (`a`), KEY `c` (`c`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result index 924b8b8d7d9..192016ba8df 100644 --- a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against gcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -153,7 +153,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1 order by a; a b c 1 -1 -1 @@ -183,7 +183,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1 order by a; a b c 1 -1 -1 diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result index 12e296972eb..b30eb709c47 100644 --- a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against gcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -153,7 +153,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1 order by a; a b c 1 -1 -1 @@ -183,7 +183,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1 order by a; a b c 1 -1 -1 diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index 3f73b44607c..12918988a5f 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -11,26 +11,26 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored, unique (b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored); alter table t1 add unique key (b); @@ -46,26 +46,26 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL PERSISTENT +b int(11) YES MUL NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored, index (a,b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored); alter table t1 add index (b); @@ -85,20 +85,20 @@ drop table t1; # Rejected FK options. create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update set null); -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update cascade); -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on delete set null); -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column create table t1 (a int, b int generated always as (a+1) stored); alter table t1 add foreign key (b) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add foreign key (b) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column alter table t1 add foreign key (b) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column drop table t1; # Allowed FK options. create table t2 (a int primary key, b char(5)); diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index 7a45008b9a2..cd29d7d02ef 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -11,52 +11,52 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored unique); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) virtual, unique key (b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored, unique (b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) virtual); alter table t1 add unique key (b); @@ -75,13 +75,13 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL VIRTUAL +b int(11) YES MUL NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) virtual, index (a,b)); drop table t1; @@ -90,26 +90,26 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL PERSISTENT +b int(11) YES MUL NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) stored, index (a,b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; create table t1 (a int, b int generated always as (a*2) virtual); alter table t1 add index (b); @@ -140,20 +140,20 @@ drop table t1; # Rejected FK options. create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update set null); -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on update cascade); -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column create table t1 (a int, b int generated always as (a+1) stored, foreign key (b) references t2(a) on delete set null); -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column create table t1 (a int, b int generated always as (a+1) stored); alter table t1 add foreign key (b) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add foreign key (b) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column alter table t1 add foreign key (b) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column drop table t1; # Allowed FK options. create table t2 (a int primary key, b char(5)); @@ -300,7 +300,7 @@ DESC t1; Field Type Null Key Default Extra pk int(11) NO PRI NULL col_int_nokey int(11) YES NULL -col_int_key int(11) YES UNI NULL VIRTUAL +col_int_key int(11) YES UNI NULL VIRTUAL GENERATED DROP TABLE t1; # # Bug#21346132: WL8149:INNODB: FAILING ASSERTION: diff --git a/mysql-test/suite/gcol/r/gcol_memory.result b/mysql-test/suite/gcol/r/gcol_memory.result index 7ede64807f0..b7ce08b6376 100644 --- a/mysql-test/suite/gcol/r/gcol_memory.result +++ b/mysql-test/suite/gcol/r/gcol_memory.result @@ -1,9 +1,9 @@ SET @@session.default_storage_engine = 'memory'; create table t1 (a int, b int generated always as (a+1) virtual); -ERROR HY000: MEMORY storage engine does not support computed columns +ERROR HY000: MEMORY storage engine does not support generated columns create table t1 (a int); alter table t1 add column b int generated always as (a+1) virtual; -ERROR HY000: MEMORY storage engine does not support computed columns +ERROR HY000: MEMORY storage engine does not support generated columns drop table t1; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; diff --git a/mysql-test/suite/gcol/r/gcol_merge.result b/mysql-test/suite/gcol/r/gcol_merge.result index 5a9f3ad8770..bffe62655a1 100644 --- a/mysql-test/suite/gcol/r/gcol_merge.result +++ b/mysql-test/suite/gcol/r/gcol_merge.result @@ -4,7 +4,7 @@ create table t2 (a int, b int generated always as (a % 10) virtual); insert into t1 values (1,default); insert into t2 values (2,default); create table t3 (a int, b int generated always as (a % 10) virtual) engine=MERGE UNION=(t1,t2); -ERROR HY000: MRG_MyISAM storage engine does not support computed columns +ERROR HY000: MRG_MyISAM storage engine does not support generated columns drop table t1,t2; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result index 30d3abb3df0..b6b18b7df70 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result @@ -85,23 +85,23 @@ drop table t1; # Case 7. ALTER. Modify virtual stored -> virtual non-stored create table t1 (a int, b int generated always as (a % 2) stored); alter table t1 modify b int generated always as (a % 2) virtual; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored create table t1 (a int, b int generated always as (a % 2) virtual); alter table t1 modify b int generated always as (a % 2) stored; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -182,7 +182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) PERSISTENT, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -225,7 +225,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; DROP VIEW IF EXISTS v1,v2; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result index 2d3d57ab39d..cf5037461d8 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result @@ -85,23 +85,23 @@ drop table t1; # Case 7. ALTER. Modify virtual stored -> virtual non-stored create table t1 (a int, b int generated always as (a % 2) stored); alter table t1 modify b int generated always as (a % 2) virtual; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored create table t1 (a int, b int generated always as (a % 2) virtual); alter table t1 modify b int generated always as (a % 2) stored; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -182,7 +182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) PERSISTENT, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -225,7 +225,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; DROP VIEW IF EXISTS v1,v2; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result index e8d91e13e4d..d7b2de3ac8a 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result @@ -10,7 +10,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (abs(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -25,7 +25,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -44,7 +44,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -62,7 +62,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -78,7 +78,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(`a`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -96,7 +96,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -113,7 +113,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceiling(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ceiling(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -153,7 +153,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (12,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (crc32(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (crc32(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` bigint(20) AS (floor(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (floor(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(`a`,2)) VIRTUAL, - `c` int(11) AS (pow(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (round(`a`,0)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (round(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (sign(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(`a`,4)) VIRTUAL + `b` double GENERATED ALWAYS AS (truncate(`a`,4)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ascii(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (bit_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (bit_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL + `c` varbinary(10) GENERATED ALWAYS AS (char(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(`a`,2)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (format(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (locate(`b`,`a`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(`a`,5)) VIRTUAL + `b` varchar(5) GENERATED ALWAYS AS (left(`a`,5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ltrim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL + `d` varchar(30) GENERATED ALWAYS AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (ord(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (ord(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (quote(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (repeat(`a`,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(`a`)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (reverse(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(`a`,4)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (right(`a`,4)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rtrim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(`a`)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (soundex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (trim(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (unhex(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1479,7 +1479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (weight_string(`a`,0,4,65)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (weight_string(`a`,0,4,65)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1535,7 +1535,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL + `c` varchar(10) GENERATED ALWAYS AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1552,7 +1552,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1606,7 +1606,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL + `b` varbinary(10) GENERATED ALWAYS AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(`a`,'%W %M %D')) VIRTUAL + `b` varchar(64) GENERATED ALWAYS AS (date_format(`a`,'%W %M %D')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (cast(`a` as date)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (cast(`a` as date)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (dayname(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofweek(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2170,7 +2170,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofyear(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2185,7 +2185,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from `a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (extract(year from `a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2200,7 +2200,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_days(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_days(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2215,7 +2215,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_unixtime(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2230,7 +2230,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL + `b` varchar(32) GENERATED ALWAYS AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2245,7 +2245,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (hour(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (hour(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2260,7 +2260,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (last_day(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2279,7 +2279,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(`a`,1)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (makedate(`a`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2294,7 +2294,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(`a`,1,3)) VIRTUAL + `b` time GENERATED ALWAYS AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2309,7 +2309,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (microsecond(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (microsecond(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2326,7 +2326,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (minute(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2341,7 +2341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (month(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2356,7 +2356,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(`a`)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS (monthname(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2371,7 +2371,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (period_add(`a`,2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2387,7 +2387,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2402,7 +2402,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (quarter(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2417,7 +2417,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` time AS (sec_to_time(`a`)) VIRTUAL + `b` time GENERATED ALWAYS AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2432,7 +2432,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (second(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2447,7 +2447,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2477,7 +2477,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2492,7 +2492,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(`a`,'%r')) VIRTUAL + `b` varchar(32) GENERATED ALWAYS AS (time_format(`a`,'%r')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2507,7 +2507,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (time_to_sec(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2522,7 +2522,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (cast(`a` as time)) VIRTUAL + `b` time GENERATED ALWAYS AS (cast(`a` as time)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2538,7 +2538,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` time AS (timediff(`a`,`b`)) VIRTUAL + `c` time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2553,7 +2553,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (cast(`a` as datetime)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2583,7 +2583,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `c` bigint(20) AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL + `c` bigint(20) GENERATED ALWAYS AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01',default); select * from t1; @@ -2598,7 +2598,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (to_days(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (to_days(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2613,7 +2613,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (weekday(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2643,7 +2643,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`,3)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`,3)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2658,7 +2658,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (year(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2673,7 +2673,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2695,7 +2695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL + `b` bigint(20) unsigned GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL + `b` bigint(20) unsigned GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2740,7 +2740,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (extractvalue(`a`,'/b')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (extractvalue(`a`,'/b')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -2759,7 +2759,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2774,7 +2774,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (bit_count(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2789,7 +2789,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (charset(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (charset(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2804,7 +2804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` int(11) AS (coercibility(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (coercibility(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2819,7 +2819,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (collation(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (collation(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2834,7 +2834,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2849,7 +2849,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2864,7 +2864,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2878,7 +2878,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2893,7 +2893,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2908,7 +2908,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(`a`)) VIRTUAL + `b` varbinary(32) GENERATED ALWAYS AS (md5(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2923,7 +2923,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (password(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2938,7 +2938,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2953,7 +2953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2968,7 +2968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha2(`a`,224)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha2(`a`,224)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2983,7 +2983,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result index 905645f2972..6ec1c256eec 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result @@ -10,7 +10,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (abs(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -25,7 +25,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -44,7 +44,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -62,7 +62,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -78,7 +78,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(`a`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -96,7 +96,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -113,7 +113,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceiling(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ceiling(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -153,7 +153,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (12,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (crc32(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (crc32(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` bigint(20) AS (floor(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (floor(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(`a`,2)) VIRTUAL, - `c` int(11) AS (pow(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (round(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (round(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (sign(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(`a`,4)) VIRTUAL + `b` double GENERATED ALWAYS AS (truncate(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ascii(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (bit_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (bit_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL + `c` varbinary(10) GENERATED ALWAYS AS (char(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (char_length(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(`a`,2)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (format(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (locate(`b`,`a`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(`a`,5)) VIRTUAL + `b` varchar(5) GENERATED ALWAYS AS (left(`a`,5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ltrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL + `d` varchar(30) GENERATED ALWAYS AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` bigint(20) AS (ord(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (ord(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (quote(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (repeat(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(`a`)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (reverse(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(`a`,4)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (right(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rtrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(`a`)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (soundex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (trim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (unhex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1479,7 +1479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (weight_string(`a`,0,4,65)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (weight_string(`a`,0,4,65)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1535,7 +1535,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL + `c` varchar(10) GENERATED ALWAYS AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1552,7 +1552,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1606,7 +1606,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL + `b` varbinary(10) GENERATED ALWAYS AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(`a`,'%W %M %D')) VIRTUAL + `b` varchar(64) GENERATED ALWAYS AS (date_format(`a`,'%W %M %D')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (cast(`a` as date)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (cast(`a` as date)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (dayname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofweek(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2170,7 +2170,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofyear(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2185,7 +2185,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from `a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (extract(year from `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2200,7 +2200,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_days(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2215,7 +2215,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` datetime AS (from_unixtime(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2230,7 +2230,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL + `b` varchar(32) GENERATED ALWAYS AS (date_format(`a`,get_format(DATE, 'EUR'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2245,7 +2245,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (hour(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (hour(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2260,7 +2260,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (last_day(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2279,7 +2279,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(`a`,1)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (makedate(`a`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2294,7 +2294,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(`a`,1,3)) VIRTUAL + `b` time GENERATED ALWAYS AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2309,7 +2309,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (microsecond(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (microsecond(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2326,7 +2326,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (minute(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2341,7 +2341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (month(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2356,7 +2356,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(`a`)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS (monthname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2371,7 +2371,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (period_add(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2387,7 +2387,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2402,7 +2402,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (quarter(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2417,7 +2417,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` time AS (sec_to_time(`a`)) VIRTUAL + `b` time GENERATED ALWAYS AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2432,7 +2432,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (second(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2447,7 +2447,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2477,7 +2477,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2492,7 +2492,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(`a`,'%r')) VIRTUAL + `b` varchar(32) GENERATED ALWAYS AS (time_format(`a`,'%r')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2507,7 +2507,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` bigint(20) AS (time_to_sec(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2522,7 +2522,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (cast(`a` as time)) VIRTUAL + `b` time GENERATED ALWAYS AS (cast(`a` as time)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2538,7 +2538,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` time AS (timediff(`a`,`b`)) VIRTUAL + `c` time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2553,7 +2553,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (cast(`a` as datetime)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2583,7 +2583,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `c` bigint(20) AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL + `c` bigint(20) GENERATED ALWAYS AS (timestampdiff(MONTH,`a`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01',default); select * from t1; @@ -2598,7 +2598,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) AS (to_days(`a`)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (to_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2613,7 +2613,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (weekday(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2643,7 +2643,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`,3)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2658,7 +2658,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (year(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2673,7 +2673,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2695,7 +2695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL + `b` bigint(20) unsigned GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` bigint(20) unsigned AS (cast(`a` as unsigned)) VIRTUAL + `b` bigint(20) unsigned GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2740,7 +2740,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (extractvalue(`a`,'/b')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (extractvalue(`a`,'/b')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -2759,7 +2759,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2774,7 +2774,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (bit_count(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2789,7 +2789,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (charset(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (charset(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2804,7 +2804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` int(11) AS (coercibility(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (coercibility(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2819,7 +2819,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (collation(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (collation(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2834,7 +2834,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2849,7 +2849,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2864,7 +2864,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2878,7 +2878,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2893,7 +2893,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2908,7 +2908,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(`a`)) VIRTUAL + `b` varbinary(32) GENERATED ALWAYS AS (md5(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2923,7 +2923,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2938,7 +2938,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2953,7 +2953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2968,7 +2968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha2(`a`,224)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha2(`a`,224)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2983,7 +2983,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result index 1d40e93cd09..a79524691c2 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result @@ -222,10 +222,10 @@ pos base_pos 65537 0 DROP TABLE t1; CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a), fulltext INDEX idx (b)); -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a)); ALTER TABLE t ADD FULLTEXT INDEX (b); -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns DROP TABLE t; CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a), spatial INDEX idx (b)); ERROR 42000: All parts of a SPATIAL index must be NOT NULL @@ -386,9 +386,9 @@ Table Create Table t CREATE TABLE `t` ( `a` varchar(10000) DEFAULT NULL, `b` varchar(3000) DEFAULT NULL, - `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, - `d` varchar(5000) AS (`b`) VIRTUAL, - `e` int(11) AS (10) VIRTUAL, + `c` varchar(14000) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) GENERATED ALWAYS AS (`b`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (10) VIRTUAL, `h` int(11) NOT NULL, PRIMARY KEY (`h`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -546,9 +546,9 @@ t1 CREATE TABLE `t1` ( `col2` int(11) NOT NULL, `col3` int(11) NOT NULL, `col4` int(11) DEFAULT NULL, - `col5` int(11) AS ((`col2` % `col3`)) VIRTUAL, - `col7` int(11) AS ((`col5` * `col5`)) VIRTUAL, - `col8` int(11) AS ((`col5` % `col5`)) VIRTUAL, + `col5` int(11) GENERATED ALWAYS AS ((`col2` % `col3`)) VIRTUAL, + `col7` int(11) GENERATED ALWAYS AS ((`col5` * `col5`)) VIRTUAL, + `col8` int(11) GENERATED ALWAYS AS ((`col5` % `col5`)) VIRTUAL, `col9` text DEFAULT NULL, `col6` int(11) DEFAULT NULL, UNIQUE KEY `uidx` (`col5`) @@ -557,7 +557,7 @@ DROP TABLE t1; CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c point, d point GENERATED ALWAYS AS (c), spatial index idx (d)); ERROR 42000: All parts of a SPATIAL index must be NOT NULL CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d char(20) GENERATED ALWAYS AS (c), fulltext index idx (d)); -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); INSERT INTO t VALUES(11, 22, DEFAULT, "AAA", 8, DEFAULT, "XXX", DEFAULT); INSERT INTO t VALUES(1, 2, DEFAULT, "uuu", 9, DEFAULT, "uu", DEFAULT); @@ -757,9 +757,9 @@ Table Create Table t CREATE TABLE `t` ( `a` varchar(10000) DEFAULT NULL, `b` varchar(3000) DEFAULT NULL, - `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, - `d` varchar(5000) AS (`b`) VIRTUAL, - `e` int(11) AS (10) VIRTUAL, + `c` varchar(14000) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) GENERATED ALWAYS AS (`b`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (10) VIRTUAL, `h` int(11) NOT NULL, PRIMARY KEY (`h`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC @@ -806,9 +806,9 @@ Table Create Table t CREATE TABLE `t` ( `a` varchar(10000) DEFAULT NULL, `b` varchar(3000) DEFAULT NULL, - `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, - `d` varchar(5000) AS (`b`) VIRTUAL, - `e` int(11) AS (10) VIRTUAL, + `c` varchar(14000) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) GENERATED ALWAYS AS (`b`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (10) VIRTUAL, `h` int(11) NOT NULL, PRIMARY KEY (`h`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT @@ -855,9 +855,9 @@ Table Create Table t CREATE TABLE `t` ( `a` varchar(10000) DEFAULT NULL, `b` varchar(3000) DEFAULT NULL, - `c` varchar(14000) AS (concat(`a`,`b`)) VIRTUAL, - `d` varchar(5000) AS (`b`) VIRTUAL, - `e` int(11) AS (10) VIRTUAL, + `c` varchar(14000) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL, + `d` varchar(5000) GENERATED ALWAYS AS (`b`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (10) VIRTUAL, `h` int(11) NOT NULL, PRIMARY KEY (`h`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED @@ -968,20 +968,20 @@ SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( `col_int_nokey` int(11) DEFAULT NULL, - `col_int` int(11) AS ((`col_int_nokey` + `col_int_nokey`)) PERSISTENT, - `col_int_key` int(11) AS ((`col_int` + `col_int_nokey`)) VIRTUAL, + `col_int` int(11) GENERATED ALWAYS AS ((`col_int_nokey` + `col_int_nokey`)) STORED, + `col_int_key` int(11) GENERATED ALWAYS AS ((`col_int` + `col_int_nokey`)) VIRTUAL, `col_date_nokey` date DEFAULT NULL, - `col_date` date AS ((`col_date_nokey` + interval 30 day)) PERSISTENT, - `col_date_key` date AS ((`col_date` + interval 30 day)) VIRTUAL, + `col_date` date GENERATED ALWAYS AS ((`col_date_nokey` + interval 30 day)) STORED, + `col_date_key` date GENERATED ALWAYS AS ((`col_date` + interval 30 day)) VIRTUAL, `col_datetime_nokey` datetime DEFAULT NULL, `col_time_nokey` time DEFAULT NULL, - `col_datetime` datetime AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) PERSISTENT, - `col_time` time AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) PERSISTENT, - `col_datetime_key` datetime AS (addtime(`col_datetime`,`col_time_nokey`)) VIRTUAL, - `col_time_key` time AS (addtime(`col_datetime_nokey`,`col_time`)) VIRTUAL, + `col_datetime` datetime GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) STORED, + `col_time` time GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) STORED, + `col_datetime_key` datetime GENERATED ALWAYS AS (addtime(`col_datetime`,`col_time_nokey`)) VIRTUAL, + `col_time_key` time GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time`)) VIRTUAL, `col_varchar_nokey` varchar(1) DEFAULT NULL, - `col_varchar` varchar(2) AS (concat(`col_varchar_nokey`,`col_varchar_nokey`)) PERSISTENT, - `col_varchar_key` varchar(2) AS (concat(`col_varchar`,'x')) VIRTUAL, + `col_varchar` varchar(2) GENERATED ALWAYS AS (concat(`col_varchar_nokey`,`col_varchar_nokey`)) STORED, + `col_varchar_key` varchar(2) GENERATED ALWAYS AS (concat(`col_varchar`,'x')) VIRTUAL, UNIQUE KEY `pk` (`col_int_key`), UNIQUE KEY `col_int_key` (`col_int_key`), UNIQUE KEY `col_int_key_2` (`col_int_key`,`col_varchar_key`), @@ -1058,10 +1058,10 @@ ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `d` int(11) AS ((`a` + `b`)) VIRTUAL, + `d` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, `h` varchar(10) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1366,8 +1366,8 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `d` int(11) AS (((`a` + `b`) + `b`)) VIRTUAL, - `e` int(11) AS (`a`) VIRTUAL, + `d` int(11) GENERATED ALWAYS AS (((`a` + `b`) + `b`)) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx` (`d`), KEY `idx2` (`e`,`d`) @@ -1382,9 +1382,9 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `e` int(11) AS (`a`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, KEY `idx2` (`e`), KEY `idx` (`e`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -1394,10 +1394,10 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `e` int(11) AS (`a`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, - `x` varchar(10) AS (`h`) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, KEY `idx2` (`e`), KEY `idx4` (`c`,`e`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -1409,10 +1409,10 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `e` int(11) AS (`a`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, - `x` varchar(10) AS (`h`) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, `j` int(11) DEFAULT NULL, KEY `idx2` (`e`), KEY `idx4` (`c`,`e`), @@ -1426,12 +1426,12 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `e` int(11) AS (`a`) VIRTUAL, + `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, - `x` varchar(10) AS (`h`) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, `j` int(11) DEFAULT NULL, - `i` int(11) AS (((`a` + `a`) + `b`)) VIRTUAL, + `i` int(11) GENERATED ALWAYS AS (((`a` + `a`) + `b`)) VIRTUAL, KEY `idx2` (`e`), KEY `idx4` (`c`,`e`), KEY `x` (`x`), diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result index a54eda60c2d..75b31324e6b 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result @@ -43,7 +43,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -112,7 +112,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx_1` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -158,9 +158,9 @@ c SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` int(11) AS (1) VIRTUAL, + `a` int(11) GENERATED ALWAYS AS (1) VIRTUAL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (1) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (1) VIRTUAL, UNIQUE KEY `b` (`b`), UNIQUE KEY `c` (`c`), KEY `a` (`a`) diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result index a266952866a..eba83694c16 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -89,7 +89,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1; @@ -128,7 +128,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1; diff --git a/mysql-test/suite/gcol/r/rpl_gcol.result b/mysql-test/suite/gcol/r/rpl_gcol.result index 3174858faa6..de1fe9029da 100644 --- a/mysql-test/suite/gcol/r/rpl_gcol.result +++ b/mysql-test/suite/gcol/r/rpl_gcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test index c4a566c3c62..7ca50e62a7b 100644 --- a/mysql-test/suite/gcol/t/gcol_bugfixes.test +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -305,7 +305,7 @@ DROP TABLE t1; CREATE TABLE t(a int); ALTER TABLE t ADD COLUMN b int GENERATED ALWAYS AS ( date_sub(a,interval a month)) VIRTUAL; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED ALTER TABLE t ADD COLUMN c int GENERATED ALWAYS AS (sum(a)); DROP TABLE t; diff --git a/mysql-test/suite/gcol/t/gcol_merge.test b/mysql-test/suite/gcol/t/gcol_merge.test index fd90da42328..8e3ba476ae4 100644 --- a/mysql-test/suite/gcol/t/gcol_merge.test +++ b/mysql-test/suite/gcol/t/gcol_merge.test @@ -43,7 +43,7 @@ create table t1 (a int, b int generated always as (a % 10) virtual); create table t2 (a int, b int generated always as (a % 10) virtual); insert into t1 values (1,default); insert into t2 values (2,default); ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS create table t3 (a int, b int generated always as (a % 10) virtual) engine=MERGE UNION=(t1,t2); drop table t1,t2; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test index d0df2dc9762..4f88fb7f8f6 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test @@ -181,7 +181,7 @@ ALTER TABLE t1 add COLUMN (d INT generated always as (a+1) virtual, e INT as(5) SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; -#--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +#--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN ALTER TABLE t1 add COLUMN (f INT generated always as (a+1) virtual, g INT as(5) virtual), DROP COLUMN e; SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; @@ -226,10 +226,10 @@ SELECT pos, base_pos FROM informatiON_schema.innodb_sys_virtual; DROP TABLE t1; # We do not support Fulltext or Spatial INDEX ON Virtual Columns ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a), fulltext INDEX idx (b)); CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a)); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN ALTER TABLE t ADD FULLTEXT INDEX (b); DROP TABLE t; @@ -528,7 +528,7 @@ DROP TABLE t1; --error ER_SPATIAL_CANT_HAVE_NULL CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c point, d point GENERATED ALWAYS AS (c), spatial index idx (d)); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c CHAR(10), d char(20) GENERATED ALWAYS AS (c), fulltext index idx (d)); CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10), j INT, m INT GENERATED ALWAYS AS(b + j), n VARCHAR(10), p VARCHAR(20) GENERATED ALWAYS AS(CONCAT(n, h)), INDEX idx1(c), INDEX idx2 (m), INDEX idx3(p)); diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index b28c411fcc5..1a0225b344b 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -30,7 +30,7 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -136,14 +136,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -193,14 +193,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`), KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`) @@ -270,14 +270,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index 7a4659fb824..5266615a4b7 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -569,7 +569,7 @@ DROP TABLE t1; --echo # MDEV-10134 Add full support for DEFAULT --echo # ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600)); --echo # diff --git a/mysql-test/suite/vcol/inc/vcol_keys.inc b/mysql-test/suite/vcol/inc/vcol_keys.inc index 42510588f34..4d4773ec3a6 100644 --- a/mysql-test/suite/vcol/inc/vcol_keys.inc +++ b/mysql-test/suite/vcol/inc/vcol_keys.inc @@ -103,22 +103,22 @@ if (!$skip_spatial_index_check) --echo # FOREIGN KEY --echo # Rejected FK options. ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update set null); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update cascade); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on delete set null); create table t1 (a int, b int as (a+1) persistent); ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on update set null; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on update cascade; ---error ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN +--error ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN alter table t1 add foreign key (b) references t2(a) on delete set null; drop table t1; @@ -161,23 +161,23 @@ drop table t1; # Restrictions when indexed: # ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b timestamp as (now()), key (b)); create table t1 (a int, b timestamp as (now())); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED alter table t1 add index (b); drop table t1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b varchar(100) as (user()), key (b)); create table t1 (a int, b varchar(100) as (user())); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED alter table t1 add index (b); drop table t1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (a int, b double as (rand()), key (b)); create table t1 (a int, b double as (rand())); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED alter table t1 add index (b); drop table t1; diff --git a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc index 5074d672ec4..771053fad7e 100644 --- a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc +++ b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc @@ -71,14 +71,14 @@ drop table t1; --echo # Case 7. ALTER. Modify virtual stored -> virtual non-stored create table t1 (a int, b int as (a % 2) persistent); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN alter table t1 modify b int as (a % 2); show create table t1; drop table t1; --echo # Case 8. ALTER. Modify virtual non-stored -> virtual stored create table t1 (a int, b int as (a % 2)); ---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN alter table t1 modify b int as (a % 2) persistent; show create table t1; drop table t1; diff --git a/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc b/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc index 4ec98ebf3f4..f012ccf135d 100644 --- a/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc +++ b/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc @@ -13,9 +13,9 @@ # Change: Syntax changed ################################################################################ ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS create table t1 (a int, b int as (a+1)); create table t1 (a int not null); ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS alter table t1 add column b int as (a+1); drop table t1; diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result index 7bad8e9f6d4..602e588ff19 100644 --- a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result +++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result @@ -9,7 +9,7 @@ alter table t1 auto_increment = 3; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` int(11) AS ((1 + 1)) VIRTUAL, + `c2` int(11) GENERATED ALWAYS AS ((1 + 1)) VIRTUAL, `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index 2ec225b0ff6..f06711d053b 100644 --- a/mysql-test/suite/vcol/r/rpl_vcol.result +++ b/mysql-test/suite/vcol/r/rpl_vcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result index 333ebf842a3..1dd80ae92b4 100644 --- a/mysql-test/suite/vcol/r/update.result +++ b/mysql-test/suite/vcol/r/update.result @@ -61,10 +61,10 @@ b int, c blob as (b), index (c(57)), d blob, e blob as (d), index (e(57))) replace select * from t1; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't' ignored -Warning 1906 The value specified for computed column 'e' in table 't' ignored -Warning 1906 The value specified for computed column 'c' in table 't' ignored -Warning 1906 The value specified for computed column 'e' in table 't' ignored +Warning 1906 The value specified for generated column 'c' in table 't' ignored +Warning 1906 The value specified for generated column 'e' in table 't' ignored +Warning 1906 The value specified for generated column 'c' in table 't' ignored +Warning 1906 The value specified for generated column 'e' in table 't' ignored check table t; Table Op Msg_type Msg_text test.t check status OK diff --git a/mysql-test/suite/vcol/r/vcol_archive.result b/mysql-test/suite/vcol/r/vcol_archive.result index 5ed2f3768ca..ec743088ec2 100644 --- a/mysql-test/suite/vcol/r/vcol_archive.result +++ b/mysql-test/suite/vcol/r/vcol_archive.result @@ -1,7 +1,7 @@ SET @@session.storage_engine = 'archive'; create table t1 (a int, b int as (a+1)); -ERROR HY000: ARCHIVE storage engine does not support computed columns +ERROR HY000: ARCHIVE storage engine does not support generated columns create table t1 (a int not null); alter table t1 add column b int as (a+1); -ERROR HY000: ARCHIVE storage engine does not support computed columns +ERROR HY000: ARCHIVE storage engine does not support generated columns drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_blackhole.result b/mysql-test/suite/vcol/r/vcol_blackhole.result index 2d33937a2f1..52d40e9a2b8 100644 --- a/mysql-test/suite/vcol/r/vcol_blackhole.result +++ b/mysql-test/suite/vcol/r/vcol_blackhole.result @@ -1,7 +1,7 @@ SET @@session.storage_engine = 'blackhole'; create table t1 (a int, b int as (a+1)); -ERROR HY000: BLACKHOLE storage engine does not support computed columns +ERROR HY000: BLACKHOLE storage engine does not support generated columns create table t1 (a int not null); alter table t1 add column b int as (a+1); -ERROR HY000: BLACKHOLE storage engine does not support computed columns +ERROR HY000: BLACKHOLE storage engine does not support generated columns drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result index 42b852a7c6c..3c914c7da58 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result @@ -54,12 +54,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int as (a % 2)); alter table t1 modify b int as (a % 2) comment 'my comment'; @@ -67,12 +67,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -87,12 +87,12 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t2 (a) values (1); select * from t2; a b @@ -109,12 +109,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result index 7af1d35b67f..fbec411b486 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result @@ -54,12 +54,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED drop table t1; create table t1 (a int, b int as (a % 2)); alter table t1 modify b int as (a % 2) comment 'my comment'; @@ -67,12 +67,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -87,12 +87,12 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL VIRTUAL GENERATED insert into t2 (a) values (1); select * from t2; a b @@ -109,12 +109,12 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED insert into t1 (a) values (1); select * from t1; a b @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_csv.result b/mysql-test/suite/vcol/r/vcol_csv.result index 920e614c0b1..9a0a76576f6 100644 --- a/mysql-test/suite/vcol/r/vcol_csv.result +++ b/mysql-test/suite/vcol/r/vcol_csv.result @@ -1,7 +1,7 @@ SET @@session.storage_engine = 'CSV'; create table t1 (a int, b int as (a+1)); -ERROR HY000: CSV storage engine does not support computed columns +ERROR HY000: CSV storage engine does not support generated columns create table t1 (a int not null); alter table t1 add column b int as (a+1); -ERROR HY000: CSV storage engine does not support computed columns +ERROR HY000: CSV storage engine does not support generated columns drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result index af03cc4d482..d6793e22668 100644 --- a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against vcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -107,8 +107,8 @@ a b c create table t2 like t1; insert into t2 select * from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'c' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'c' in table 't2' ignored select * from t1; a b c 2 -2 -2 @@ -123,8 +123,8 @@ a b c create table t2 like t1; insert into t2 (a,b) select a,b from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored select * from t2; a b c 2 -2 -2 @@ -159,7 +159,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -189,7 +189,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result index 351dfd2858c..97f6b9be563 100644 --- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against vcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -107,8 +107,8 @@ a b c create table t2 like t1; insert into t2 select * from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'c' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'c' in table 't2' ignored select * from t1; a b c 2 -2 -2 @@ -123,8 +123,8 @@ a b c create table t2 like t1; insert into t2 (a,b) select a,b from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored select * from t2; a b c 2 -2 -2 @@ -159,7 +159,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -189,7 +189,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for generated column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index c9c95e912df..feab116e1b2 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -13,13 +13,13 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); drop table t1; @@ -28,13 +28,13 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); @@ -57,26 +57,26 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL PERSISTENT +b int(11) YES MUL NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2) persistent, index (a,b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); @@ -107,20 +107,20 @@ drop table t1; # Rejected FK options. create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update set null); -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update cascade); -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on delete set null); -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column create table t1 (a int, b int as (a+1) persistent); alter table t1 add foreign key (b) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add foreign key (b) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column alter table t1 add foreign key (b) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column drop table t1; create table t1 (a int, b int as (a+1), foreign key (b) references t2(a)); ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index 17f6fba7e89..ddc4954f272 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -129,13 +129,13 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); drop table t1; @@ -144,13 +144,13 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL PERSISTENT +b int(11) YES UNI NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); @@ -173,26 +173,26 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL PERSISTENT +b int(11) YES MUL NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2) persistent, index (a,b)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` * 2)) PERSISTENT, + `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL PERSISTENT +b int(11) YES NULL STORED GENERATED drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); @@ -223,20 +223,20 @@ drop table t1; # Rejected FK options. create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update set null); -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on update cascade); -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column create table t1 (a int, b int as (a+1) persistent, foreign key (b) references t2(a) on delete set null); -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column create table t1 (a int, b int as (a+1) persistent); alter table t1 add foreign key (b) references t2(a) on update set null; -ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE SET NULL clause on a generated column alter table t1 add foreign key (b) references t2(a) on update cascade; -ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a computed column +ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a generated column alter table t1 add foreign key (b) references t2(a) on delete set null; -ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column +ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a generated column drop table t1; # Allowed FK options. create table t2 (a int primary key, b char(5)); diff --git a/mysql-test/suite/vcol/r/vcol_memory.result b/mysql-test/suite/vcol/r/vcol_memory.result index 4503c51e39a..1324be82101 100644 --- a/mysql-test/suite/vcol/r/vcol_memory.result +++ b/mysql-test/suite/vcol/r/vcol_memory.result @@ -1,7 +1,7 @@ SET @@session.storage_engine = 'memory'; create table t1 (a int, b int as (a+1)); -ERROR HY000: MEMORY storage engine does not support computed columns +ERROR HY000: MEMORY storage engine does not support generated columns create table t1 (a int not null); alter table t1 add column b int as (a+1); -ERROR HY000: MEMORY storage engine does not support computed columns +ERROR HY000: MEMORY storage engine does not support generated columns drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_merge.result b/mysql-test/suite/vcol/r/vcol_merge.result index e127ec35e8c..2629c65f688 100644 --- a/mysql-test/suite/vcol/r/vcol_merge.result +++ b/mysql-test/suite/vcol/r/vcol_merge.result @@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10)); insert into t1 values (1,default); insert into t2 values (2,default); create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2); -ERROR HY000: MRG_MyISAM storage engine does not support computed columns +ERROR HY000: MRG_MyISAM storage engine does not support generated columns drop table t1,t2; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 4aeeda38cc1..9c84f21801b 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -108,10 +108,10 @@ DROP TABLE t1,t2; CREATE TABLE t1 (p int, a double NOT NULL, v double AS (ROUND(a,p)) VIRTUAL); INSERT INTO t1 VALUES (0,1,0); Warnings: -Warning 1906 The value specified for computed column 'v' in table 't1' ignored +Warning 1906 The value specified for generated column 'v' in table 't1' ignored INSERT INTO t1 VALUES (NULL,0,0); Warnings: -Warning 1906 The value specified for computed column 'v' in table 't1' ignored +Warning 1906 The value specified for generated column 'v' in table 't1' ignored SELECT a, p, v, ROUND(a,p), ROUND(a,p+NULL) FROM t1; a p v ROUND(a,p) ROUND(a,p+NULL) 1 0 1 1 NULL @@ -130,7 +130,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(32) DEFAULT NULL, - `v` char(32) CHARACTER SET ucs2 AS (`a`) VIRTUAL + `v` char(32) CHARACTER SET ucs2 GENERATED ALWAYS AS (`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a int, b int); @@ -144,7 +144,7 @@ SELECT table_schema, table_name, column_name, column_type, extra FROM information_schema.columns WHERE table_name = 't2'; table_schema table_name column_name column_type extra test t2 a int(11) -test t2 b int(11) VIRTUAL +test t2 b int(11) VIRTUAL GENERATED DROP TABLE t1,t2; create table t1 ( a int not null, b char(2) not null, @@ -155,7 +155,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` char(2) NOT NULL, - `c` enum('Y','N') AS ((case when (`b` = 'aa') then 'Y' else 'N' end)) PERSISTENT + `c` enum('Y','N') GENERATED ALWAYS AS ((case when (`b` = 'aa') then 'Y' else 'N' end)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1(a,b) values (1,'bb'), (2,'aa'), (3,'cc'); select * from t1; @@ -173,7 +173,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` set('y','n') AS (if((`a` = 0),if((`b` = 0),'n,n','n,y'),if((`b` = 0),'y,n','y,y'))) PERSISTENT + `c` set('y','n') GENERATED ALWAYS AS (if((`a` = 0),if((`b` = 0),'n,n','n,y'),if((`b` = 0),'y,n','y,y'))) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t2(a,b) values (7,0), (2,3), (0,1); select * from t2; @@ -227,7 +227,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) AS ((`a` > '2')) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS ((`a` > '2')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -244,7 +244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) AS ((`a` between 0 and 2)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -261,7 +261,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL, - `b` char(10) AS ((`a` between 0 and 2)) VIRTUAL + `b` char(10) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -284,33 +284,33 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(32) DEFAULT NULL, - `c` int(11) AS ((`a` % 10)) VIRTUAL, - `d` varchar(5) AS (left(`b`,5)) PERSISTENT + `c` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL, + `d` varchar(5) GENERATED ALWAYS AS (left(`b`,5)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra a int(11) NO NULL b varchar(32) YES NULL -c int(11) YES NULL VIRTUAL -d varchar(5) YES NULL PERSISTENT +c int(11) YES NULL VIRTUAL GENERATED +d varchar(5) YES NULL STORED GENERATED show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment a int(11) NULL NO NULL # b varchar(32) latin1_swedish_ci YES NULL # -c int(11) NULL YES NULL VIRTUAL # -d varchar(5) latin1_swedish_ci YES NULL PERSISTENT # +c int(11) NULL YES NULL VIRTUAL GENERATED # +d varchar(5) latin1_swedish_ci YES NULL STORED GENERATED # INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; Warnings: -Warning 1906 The value specified for computed column 'd' in table 't1' ignored +Warning 1906 The value specified for generated column 'd' in table 't1' ignored INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); Warnings: -Warning 1906 The value specified for computed column 'd' in table 't1' ignored +Warning 1906 The value specified for generated column 'd' in table 't1' ignored set sql_mode='strict_all_tables'; UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; -ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +ERROR HY000: The value specified for generated column 'd' in table 't1' ignored INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); -ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +ERROR HY000: The value specified for generated column 'd' in table 't1' ignored drop table t1; # # MDEV-5611: self-referencing virtual column @@ -324,7 +324,7 @@ create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=lat show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v1` varchar(255) AS (`c1`) PERSISTENT, + `v1` varchar(255) GENERATED ALWAYS AS (`c1`) STORED, `c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci drop table t1; @@ -339,7 +339,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (cast(`a` as datetime)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP); @@ -347,7 +347,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (cast(`a` as datetime)) VIRTUAL, + `b` timestamp GENERATED ALWAYS AS (cast(`a` as datetime)) VIRTUAL, `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result index c026637c0a5..feeec8c1e27 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result @@ -76,23 +76,23 @@ drop table t1; # Case 7. ALTER. Modify virtual stored -> virtual non-stored create table t1 (a int, b int as (a % 2) persistent); alter table t1 modify b int as (a % 2); -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored create table t1 (a int, b int as (a % 2)); alter table t1 modify b int as (a % 2) persistent; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -194,7 +194,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) PERSISTENT, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, `b` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; @@ -216,7 +216,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) PERSISTENT + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 15. ALTER. Changing the expression of a virtual non-stored column. @@ -237,7 +237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result index 172fc631f08..ad04084fbfa 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result @@ -76,23 +76,23 @@ drop table t1; # Case 7. ALTER. Modify virtual stored -> virtual non-stored create table t1 (a int, b int as (a % 2) persistent); alter table t1 modify b int as (a % 2); -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored create table t1 (a int, b int as (a % 2)); alter table t1 modify b int as (a % 2) persistent; -ERROR HY000: This is not yet supported for computed columns +ERROR HY000: This is not yet supported for generated columns show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) VIRTUAL, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -194,7 +194,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `c` int(11) AS (dayofyear(`b`)) PERSISTENT, + `c` int(11) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, `b` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -216,7 +216,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) PERSISTENT + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 15. ALTER. Changing the expression of a virtual non-stored column. @@ -237,7 +237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` int(11) AS (week(`b`,1)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (week(`b`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index d6d01150e0b..b69302aa0f3 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -273,9 +273,9 @@ INSERT INTO t1 VALUES (NULL),( 78), (185), (0), (154); CREATE TABLE t2 (a int, b int AS (a) VIRTUAL); INSERT INTO t2 VALUES (187,187), (9,9), (187,187); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored +Warning 1906 The value specified for generated column 'b' in table 't2' ignored EXPLAIN EXTENDED SELECT * FROM t1 JOIN t2 USING (b); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index 328184aabca..0c7a63c560f 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -9,7 +9,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (abs(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -43,7 +43,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -61,7 +61,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -77,7 +77,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(`a`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -95,7 +95,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -112,7 +112,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceiling(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ceiling(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -131,7 +131,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -152,7 +152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -167,7 +167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); insert into t1 values (1,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (crc32(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (crc32(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` mediumtext AS (floor(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (floor(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(`a`,`b`),6)) VIRTUAL + `c` double GENERATED ALWAYS AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(`a`,2)) VIRTUAL, - `c` int(11) AS (pow(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (pow(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (round(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (round(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (sign(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(`a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(`a`,4)) VIRTUAL + `b` double GENERATED ALWAYS AS (truncate(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (ascii(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (bit_length(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (bit_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (char_length(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL + `c` varbinary(10) GENERATED ALWAYS AS (char(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (char_length(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL + `d` varchar(10) GENERATED ALWAYS AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(`a`,2)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (format(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL + `c` varchar(20) GENERATED ALWAYS AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (locate(`b`,`a`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(`a`,5)) VIRTUAL + `b` varchar(5) GENERATED ALWAYS AS (left(`a`,5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` like 'H%!o' escape '!')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%!o' escape '!')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ltrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL + `d` varchar(30) GENERATED ALWAYS AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (ord(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (ord(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (quote(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (repeat(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(`a`)) VIRTUAL + `b` varchar(30) GENERATED ALWAYS AS (reverse(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(`a`,4)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (right(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (rtrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(`a`)) VIRTUAL + `b` varchar(20) GENERATED ALWAYS AS (soundex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (trim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (unhex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(`a`)) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1482,7 +1482,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1502,7 +1502,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1520,7 +1520,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL + `c` varchar(10) GENERATED ALWAYS AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1537,7 +1537,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1557,7 +1557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1574,7 +1574,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1591,7 +1591,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL + `b` varbinary(10) GENERATED ALWAYS AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1608,7 +1608,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1625,7 +1625,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1642,7 +1642,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1661,7 +1661,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1680,7 +1680,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1698,7 +1698,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1718,7 +1718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1736,7 +1736,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1754,7 +1754,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1771,7 +1771,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1788,7 +1788,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1805,7 +1805,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1823,7 +1823,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1843,7 +1843,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1862,7 +1862,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1880,7 +1880,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1900,7 +1900,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1919,7 +1919,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1936,7 +1936,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1953,7 +1953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1975,7 +1975,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (cast(`a` as date)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (cast(`a` as date)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofweek(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (dayofyear(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from `a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (extract(year from `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_days(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2171,7 +2171,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_unixtime(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2186,7 +2186,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (hour(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (hour(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2201,7 +2201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(`a`)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (last_day(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2220,7 +2220,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(`a`,1)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (makedate(`a`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2235,7 +2235,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(`a`,1,3)) VIRTUAL + `b` time GENERATED ALWAYS AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2250,7 +2250,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (microsecond(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (microsecond(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2267,7 +2267,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (minute(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2282,7 +2282,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (month(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2297,7 +2297,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(`a`,2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (period_add(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2313,7 +2313,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2328,7 +2328,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (quarter(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2343,7 +2343,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` time AS (sec_to_time(`a`)) VIRTUAL + `b` time GENERATED ALWAYS AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2358,7 +2358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (second(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2373,7 +2373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2388,7 +2388,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2403,7 +2403,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL + `b` datetime GENERATED ALWAYS AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2418,7 +2418,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (time_to_sec(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2433,7 +2433,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (cast(`a` as time)) VIRTUAL + `b` time GENERATED ALWAYS AS (cast(`a` as time)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2449,7 +2449,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` mediumtext AS (timediff(`a`,`b`)) VIRTUAL + `c` mediumtext GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2464,7 +2464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (cast(`a` as datetime)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (cast(`a` as datetime)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2479,7 +2479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2495,7 +2495,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c` mediumtext AS (timestampdiff(MONTH,`a`,`b`)) VIRTUAL + `c` mediumtext GENERATED ALWAYS AS (timestampdiff(MONTH,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01','2003-05-01',default); select * from t1; @@ -2510,7 +2510,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (to_days(`a`)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (to_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2525,7 +2525,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2540,7 +2540,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (weekday(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2555,7 +2555,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(`a`,3)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (week(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2570,7 +2570,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (year(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2585,7 +2585,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(`a`,0)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2607,7 +2607,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2656,7 +2656,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2671,7 +2671,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (bit_count(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2686,7 +2686,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2701,7 +2701,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2731,7 +2731,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2746,7 +2746,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(`a`)) VIRTUAL + `b` varbinary(32) GENERATED ALWAYS AS (md5(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2761,7 +2761,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (old_password(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (old_password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2776,7 +2776,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2791,7 +2791,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2806,7 +2806,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(`a`)) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2821,7 +2821,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL + `b` varchar(1024) GENERATED ALWAYS AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; @@ -2836,7 +2836,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (monthname(`a`)) VIRTUAL + `b` varchar(100) GENERATED ALWAYS AS (monthname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2010-10-10',default); select * from t1; @@ -2851,7 +2851,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (dayname(`a`)) VIRTUAL + `b` varchar(100) GENERATED ALWAYS AS (dayname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2011-11-11',default); select * from t1; @@ -2866,7 +2866,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (date_format(`a`,'%W %a %M %b')) VIRTUAL + `b` varchar(100) GENERATED ALWAYS AS (date_format(`a`,'%W %a %M %b')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2012-12-12',default); select * from t1; @@ -2881,7 +2881,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(32) AS (current_user()) VIRTUAL + `b` varchar(32) GENERATED ALWAYS AS (current_user()) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a', default); select * from t1; @@ -2896,7 +2896,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (time_format(`a`,'%d.%m.%Y')) VIRTUAL + `b` varchar(10) GENERATED ALWAYS AS (time_format(`a`,'%d.%m.%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2001-01-01 02:02:02',default); select * from t1; diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 14c376797d6..35920b1d7a9 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -5,7 +5,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a+1) virtual); @@ -13,7 +13,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a+1) persistent); @@ -21,7 +21,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS ((`a` + 1)) PERSISTENT + `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set session sql_mode='ORACLE'; @@ -30,7 +30,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (("a" + 1)) VIRTUAL + "b" int(11) GENERATED ALWAYS AS (("a" + 1)) VIRTUAL ) drop table t1; create table t1 (a int, b int generated always as (a+1) virtual); @@ -38,7 +38,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (("a" + 1)) VIRTUAL + "b" int(11) GENERATED ALWAYS AS (("a" + 1)) VIRTUAL ) drop table t1; create table t1 (a int, b int as (a+1) persistent); @@ -46,7 +46,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) AS (("a" + 1)) PERSISTENT + "b" int(11) GENERATED ALWAYS AS (("a" + 1)) STORED ) drop table t1; set session sql_mode=@OLD_SQL_MODE; diff --git a/mysql-test/suite/vcol/t/not_supported.test b/mysql-test/suite/vcol/t/not_supported.test index b6902780a02..b7544cb33a4 100644 --- a/mysql-test/suite/vcol/t/not_supported.test +++ b/mysql-test/suite/vcol/t/not_supported.test @@ -13,16 +13,16 @@ set time_zone='+10:00'; set div_precision_increment=20; create table t1 (a int, b int, v decimal(20,19) as (a/3)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t2 (a int, b int, v int as (a+@a)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t2 (a int, b int, v int as (a+@a) PERSISTENT); create table t3_ok (a int, b int, v int as (a+@@error_count)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t3 (a int, b int, v int as (a+@@error_count) PERSISTENT); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t4 (a int, b int, v int as (@a:=a)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t4 (a int, b int, v int as (@a:=a) PERSISTENT); create table t8 (a int, b int, v varchar(100) as (from_unixtime(a))); diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc index 708dbd42a8d..766d0c7410c 100644 --- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc @@ -21,85 +21,85 @@ --echo # RAND() create or replace table t1 (b double as (rand())); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (b double as (rand()) PERSISTENT); --echo # LOAD_FILE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(64), b varchar(1024) as (load_file(a))); --echo # CURDATE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (curdate()) PERSISTENT); --echo # CURRENT_DATE(), CURRENT_DATE --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_date) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_date()) PERSISTENT); --echo # CURRENT_TIME(), CURRENT_TIME --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_time) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_time()) PERSISTENT); --echo # CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_timestamp()) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (current_timestamp) PERSISTENT); --echo # CURTIME() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime as (curtime()) PERSISTENT); --echo # LOCALTIME(), LOCALTIME --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b varchar(10) as (localtime()) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b varchar(10) as (localtime) PERSISTENT); --echo # LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b varchar(10) as (localtimestamp()) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b varchar(10) as (localtimestamp) PERSISTENT); --echo # NOW() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b varchar(10) as (now()) PERSISTENT); --echo # SYSDATE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b varchar(10) as (sysdate()) PERSISTENT); --echo # UNIX_TIMESTAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b datetime as (unix_timestamp()) PERSISTENT); --echo # UTC_DATE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b datetime as (utc_date()) PERSISTENT); --echo # UTC_TIME() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b datetime as (utc_time()) PERSISTENT); --echo # UTC_TIMESTAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b datetime as (utc_timestamp()) PERSISTENT); --echo # WEEK() - one argument version --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a datetime, b datetime as (week(a)) PERSISTENT); --echo # MATCH() ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32), b bool as (match a against ('sample text')) PERSISTENT); --echo # BENCHMARK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); --echo # CHARSET() @@ -113,84 +113,84 @@ create or replace table t1 (a varchar(64), b varchar(64) as (collation(a)) PERSI --echo # CONNECTION_ID() create or replace table t1 (a int as (connection_id())); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (connection_id()) PERSISTENT); --echo # DATABASE() create or replace table t1 (a varchar(32) as (database())); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (database()) PERSISTENT); --echo # FOUND_ROWS() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (found_rows())); --echo # GET_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); --echo # IS_FREE_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); --echo # IS_USED_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); --echo # LAST_INSERT_ID() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (last_insert_id())); --echo # MASTER_POS_WAIT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); --echo # NAME_CONST() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32) as (name_const('test',1))); --echo # RELEASE_LOCK() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32), b int as (release_lock(a))); --echo # ROW_COUNT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (row_count())); --echo # SCHEMA() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32) as (schema()) PERSISTENT); --echo # SESSION_USER() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32) as (session_user()) PERSISTENT); --echo # SLEEP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (sleep(a))); --echo # SYSTEM_USER() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32) as (system_user()) PERSISTENT); --echo # USER() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (user()) PERSISTENT); --echo # UUID_SHORT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024) as (uuid_short()) PERSISTENT); --echo # UUID() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024) as (uuid()) PERSISTENT); --echo # VALUES() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (values(a))); --echo # VERSION() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(1024), b varchar(1024) as (version()) PERSISTENT); --echo # ENCRYPT() @@ -212,16 +212,16 @@ end // delimiter ;// --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (p1()) PERSISTENT); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (f1()) PERSISTENT); drop procedure p1; drop function f1; --echo # Unknown functions --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int as (f1()) PERSISTENT); --echo # @@ -229,71 +229,71 @@ create or replace table t1 (a int as (f1()) PERSISTENT); --echo # --echo # AVG() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (avg(a))); --echo # BIT_AND() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (bit_and(a))); --echo # BIT_OR() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (bit_or(a))); --echo # BIT_XOR() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (bit_xor(a))); --echo # COUNT(DISTINCT) --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (count(distinct a))); --echo # COUNT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (count(a))); --echo # GROUP_CONCAT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a varchar(32), b int as (group_concat(a,''))); --echo # MAX() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (max(a))); --echo # MIN() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (min(a))); --echo # STD() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (std(a))); --echo # STDDEV_POP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (stddev_pop(a))); --echo # STDDEV_SAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (stddev_samp(a))); --echo # STDDEV() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (stddev(a))); --echo # SUM() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (sum(a))); --echo # VAR_POP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (var_pop(a))); --echo # VAR_SAMP() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (var_samp(a))); --echo # VARIANCE() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (variance(a))); --echo # @@ -311,13 +311,13 @@ create or replace table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a --echo # create or replace table t1 (a int); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t2 (a int, b int as (select count(*) from t1)); drop table t1; --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as ((select 1))); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (a+(select 1))); --echo # @@ -330,7 +330,7 @@ drop function if exists sub1; create function sub1(i int) returns int deterministic return i+1; select sub1(1); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a int, b int as (a+sub3(1))); drop function sub1; diff --git a/mysql-test/suite/vcol/t/vcol_merge.test b/mysql-test/suite/vcol/t/vcol_merge.test index a1d3c628c8e..ee1511ee26f 100644 --- a/mysql-test/suite/vcol/t/vcol_merge.test +++ b/mysql-test/suite/vcol/t/vcol_merge.test @@ -48,7 +48,7 @@ create table t1 (a int, b int as (a % 10)); create table t2 (a int, b int as (a % 10)); insert into t1 values (1,default); insert into t2 values (2,default); ---error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS +--error ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2); drop table t1,t2; diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 4ca9562221c..2387000c3ef 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -269,9 +269,9 @@ INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); set sql_mode='strict_all_tables'; ---error ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN +--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; ---error ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN +--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); drop table t1; diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 6eca3a64562..d9d7f429848 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -321,9 +321,9 @@ drop table t1; --echo # Error handling --echo # ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a bigint default xxx()); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create or replace table t1 (a bigint default (select (1))); --error ER_OPERAND_COLUMNS create or replace table t1 (a bigint default (1,2,3)); @@ -338,13 +338,13 @@ CREATE TABLE t1 (a INT, b INT DEFAULT -a); --echo # Invalid DEFAULT expressions --echo # ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT ((SELECT 1))); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT (EXISTS (SELECT 1))); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT (1=ANY (SELECT 1))); --error ER_OPERAND_COLUMNS @@ -364,39 +364,39 @@ CREATE TABLE t1 (a INT DEFAULT(?)); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD CREATE TABLE t1 (a INT DEFAULT (b), b INT DEFAULT(a)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT @v); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT @v:=1); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT(NAME_CONST('xxx', 'yyy')); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT COUNT(*)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT COUNT(1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT AVG(1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT MIN(1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT GROUP_CONCAT(1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT ROW_NUMBER() OVER ()); CREATE FUNCTION f1() RETURNS INT RETURN 1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT f1()); DROP FUNCTION f1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE PROCEDURE p1(par INT) CREATE TABLE t1 (a INT DEFAULT par); --error ER_BAD_FIELD_ERROR @@ -407,18 +407,18 @@ CREATE PROCEDURE p1() CREATE TABLE t1 (a INT DEFAULT par); CALL p1; DROP PROCEDURE p1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT VALUES(a)); CREATE TABLE t1 (a INT); # "Explicit or implicit commit is not allowed in stored function or trigger # because the entire CREATE TABLE is actually not allowed in triggers! ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TABLE t2 (a INT DEFAULT NEW.a); # This is OK to return Function or expression is not allowed for 'DEFAULT' # because CREATE TEMPORARY TABLE is allowed in triggers ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TEMPORARY TABLE t2 (a INT DEFAULT NEW.a); DROP TABLE t1; @@ -930,37 +930,37 @@ INSERT INTO t1 VALUES (); SELECT a>0 FROM t1; DROP TABLE t1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT GET_LOCK('a',1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT RELEASE_LOCK('a')); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT IS_USED_LOCK('a')); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT IS_FREE_LOCK('a')); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT SLEEP(1)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT ROW_COUNT()); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT FOUND_ROWS()); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT MASTER_POS_WAIT('test',100)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT MASTER_GTID_WAIT('test')); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a VARCHAR(30), b DOUBLE DEFAULT MATCH (a) AGAINST('bbbb' IN BOOLEAN MODE)); --echo # @@ -1594,7 +1594,7 @@ INSERT INTO t1 VALUES (0x50006,'Y','N','',64,DEFAULT); SELECT * FROM t1; DROP TABLE t1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a VARCHAR(30), b BLOB DEFAULT LOAD_FILE(a)); --echo # @@ -1722,7 +1722,7 @@ DROP TABLE t1; --echo # # QQ: LAST_INSERT_ID() should probably be allowed ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( id SERIAL PRIMARY KEY, diff --git a/mysql-test/t/gis-debug.test b/mysql-test/t/gis-debug.test index 30fcb3661c4..4b36a8e20e0 100644 --- a/mysql-test/t/gis-debug.test +++ b/mysql-test/t/gis-debug.test @@ -14,7 +14,7 @@ SET @tmp=ST_GIS_DEBUG(1); --echo # MDEV-10134 Add full support for DEFAULT --echo # ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 (a INT DEFAULT ST_GIS_DEBUG(1)); --echo # diff --git a/sql/field.cc b/sql/field.cc index bd06314a8bb..673bf22a4a5 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -9797,7 +9797,7 @@ bool check_expression(Virtual_column_info *vcol, const char *name, if (ret || (res.errors & filter)) { - my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, + my_error(ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, vcol_type_name(type), name); return TRUE; } diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 1fc22fa415f..584cda9cb95 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6965,28 +6965,28 @@ ER_LAST_MYSQL_ERROR_MESSAGE # MariaDB error numbers starts from 1900 start-error-number 1900 -ER_VCOL_BASED_ON_VCOL - eng "A computed column cannot be based on a computed column" -ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +ER_UNUSED_18 + eng "" +ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED eng "Function or expression '%s' cannot be used in the %s clause of %`s" -ER_DATA_CONVERSION_ERROR_FOR_VIRTUAL_COLUMN - eng "Generated value for computed column '%s' cannot be converted to type '%s'" -ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN - eng "Primary key cannot be defined upon a computed column" +ER_UNUSED_19 + eng "" +ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN + eng "Primary key cannot be defined upon a generated column" ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN - eng "Key/Index cannot be defined on a non-stored computed column" -ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN - eng "Cannot define foreign key with %s clause on a computed column" -ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN - eng "The value specified for computed column '%s' in table '%s' ignored" -ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN - eng "This is not yet supported for computed columns" -ER_CONST_EXPR_IN_VCOL - eng "Constant expression in computed column function is not allowed" -ER_ROW_EXPR_FOR_VCOL - eng "Expression for computed column cannot return a row" -ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS - eng "%s storage engine does not support computed columns" + eng "Key/Index cannot be defined on a virtual generated column" +ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN + eng "Cannot define foreign key with %s clause on a generated column" +ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN + eng "The value specified for generated column '%s' in table '%s' ignored" +ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN + eng "This is not yet supported for generated columns" +ER_UNUSED_20 + eng "" +ER_UNUSED_21 + eng "" +ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS + eng "%s storage engine does not support generated columns" ER_UNKNOWN_OPTION eng "Unknown option '%-.64s'" ER_BAD_OPTION_VALUE diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c6a5222f7b0..0a2dab91c14 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1913,11 +1913,11 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, { StringBuffer str(&my_charset_utf8mb4_general_ci); field->vcol_info->print(&str); - packet->append(STRING_WITH_LEN(" AS (")); + packet->append(STRING_WITH_LEN(" GENERATED ALWAYS AS (")); packet->append(str); packet->append(STRING_WITH_LEN(")")); if (field->vcol_info->stored_in_db) - packet->append(STRING_WITH_LEN(" PERSISTENT")); + packet->append(STRING_WITH_LEN(" STORED")); else packet->append(STRING_WITH_LEN(" VIRTUAL")); } @@ -5508,9 +5508,9 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, if (field->vcol_info) { if (field->vcol_info->stored_in_db) - table->field[17]->store(STRING_WITH_LEN("PERSISTENT"), cs); + table->field[17]->store(STRING_WITH_LEN("STORED GENERATED"), cs); else - table->field[17]->store(STRING_WITH_LEN("VIRTUAL"), cs); + table->field[17]->store(STRING_WITH_LEN("VIRTUAL GENERATED"), cs); } table->field[19]->store(field->comment.str, field->comment.length, cs); if (schema_table_store_record(thd, table)) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 11abeac90d0..d2b6adc50ea 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3881,7 +3881,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, { if (key->type == Key::PRIMARY) { - my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0)); + my_error(ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN, MYF(0)); DBUG_RETURN(TRUE); } if (sql_field->vcol_info->flags & VCOL_NOT_STRICTLY_DETERMINISTIC) @@ -7625,7 +7625,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, new_create_list.push_back(def, thd->mem_root); if (field->stored_in_db() != def->stored_in_db()) { - my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN, MYF(0)); + my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0)); goto err; } if (!def->after) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d4446aaa960..d3745122959 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -13953,7 +13953,7 @@ create_table_info_t::gcols_in_fulltext_or_spatial() /* We do not support special (Fulltext or Spatial) index on virtual columns */ if (innobase_is_v_fld(key_part->field)) { - my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN, MYF(0)); + my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0)); return true; } } From 180065ebb0db78ea5c955b54c9f7997dbcba3121 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 27 Nov 2016 19:50:10 +0100 Subject: [PATCH 092/135] Item::print(): remove redundant parentheses by introducing new Item::precedence() method and using it to decide whether parentheses are required --- mysql-test/r/alter_table.result | 4 +- mysql-test/r/analyze_format_json.result | 40 +- mysql-test/r/analyze_stmt_orderby.result | 24 +- mysql-test/r/bigint.result | 8 +- mysql-test/r/case.result | 20 +- mysql-test/r/cast.result | 4 +- mysql-test/r/check_constraint.result | 54 +- mysql-test/r/compare.result | 4 +- mysql-test/r/compress.result | 2 +- mysql-test/r/constraints.result | 6 +- mysql-test/r/create_drop_view.result | 8 +- mysql-test/r/cte_nonrecursive.result | 8 +- mysql-test/r/cte_recursive.result | 24 +- mysql-test/r/ctype_binary.result | 20 +- mysql-test/r/ctype_collate.result | 2 +- mysql-test/r/ctype_cp1250_ch.result | 10 +- mysql-test/r/ctype_cp1251.result | 8 +- mysql-test/r/ctype_latin1.result | 38 +- mysql-test/r/ctype_latin2_ch.result | 10 +- mysql-test/r/ctype_tis620.result | 20 +- mysql-test/r/ctype_uca.result | 32 +- mysql-test/r/ctype_ucs.result | 24 +- mysql-test/r/ctype_utf8.result | 34 +- mysql-test/r/default.result | 126 +-- mysql-test/r/derived.result | 2 +- mysql-test/r/derived_cond_pushdown.result | 798 +++++++++--------- mysql-test/r/derived_view.result | 110 +-- mysql-test/r/distinct.result | 2 +- mysql-test/r/dyncol.result | 2 +- mysql-test/r/errors.result | 2 +- mysql-test/r/explain.result | 4 +- mysql-test/r/explain_json.result | 90 +- .../r/explain_json_format_partitions.result | 8 +- mysql-test/r/explain_json_innodb.result | 4 +- mysql-test/r/func_compress.result | 4 +- mysql-test/r/func_date_add.result | 46 + mysql-test/r/func_encrypt.result | 2 +- mysql-test/r/func_gconcat.result | 2 +- mysql-test/r/func_group.result | 12 +- mysql-test/r/func_if.result | 2 +- mysql-test/r/func_in.result | 14 +- mysql-test/r/func_like.result | 8 +- mysql-test/r/func_math.result | 104 +-- mysql-test/r/func_misc.result | 4 +- mysql-test/r/func_op.result | 4 +- mysql-test/r/func_set.result | 2 +- mysql-test/r/func_str.result | 30 +- mysql-test/r/func_test.result | 20 +- mysql-test/r/func_time.result | 2 +- mysql-test/r/func_time_hires.result | 4 +- mysql-test/r/func_weight_string.result | 6 +- mysql-test/r/grant.result | 4 +- mysql-test/r/group_by.result | 4 +- mysql-test/r/group_min_max.result | 22 +- mysql-test/r/having.result | 8 +- mysql-test/r/join.result | 4 +- mysql-test/r/join_cache.result | 6 +- mysql-test/r/join_nested.result | 26 +- mysql-test/r/join_nested_jcl6.result | 26 +- mysql-test/r/join_outer.result | 20 +- mysql-test/r/join_outer_jcl6.result | 20 +- mysql-test/r/lock_sync.result | 2 +- mysql-test/r/lowercase_view.result | 2 +- .../r/myisam_explain_non_select_all.result | 90 +- mysql-test/r/mysql57_virtual.result | 12 +- mysql-test/r/mysqldump.result | 10 +- mysql-test/r/named_pipe.result | 2 +- mysql-test/r/negation_elimination.result | 6 +- mysql-test/r/null.result | 20 +- mysql-test/r/order_by.result | 12 +- mysql-test/r/partition.result | 2 +- mysql-test/r/partition_pruning.result | 16 +- mysql-test/r/pool_of_threads.result | 2 +- mysql-test/r/ps.result | 16 +- mysql-test/r/ps_ddl.result | 2 +- mysql-test/r/range.result | 8 +- mysql-test/r/range_mrr_icp.result | 8 +- mysql-test/r/row.result | 14 +- mysql-test/r/select.result | 30 +- mysql-test/r/select_jcl6.result | 30 +- mysql-test/r/select_pkeycache.result | 30 +- mysql-test/r/selectivity.result | 74 +- mysql-test/r/selectivity_innodb.result | 78 +- mysql-test/r/selectivity_no_engine.result | 32 +- mysql-test/r/shm.result | 2 +- mysql-test/r/sp-code.result | 124 +-- mysql-test/r/sp.result | 6 +- mysql-test/r/ssl.result | 2 +- mysql-test/r/ssl_compress.result | 2 +- mysql-test/r/strict.result | 2 +- mysql-test/r/subselect.result | 88 +- mysql-test/r/subselect2.result | 4 +- mysql-test/r/subselect3.result | 28 +- mysql-test/r/subselect3_jcl6.result | 28 +- mysql-test/r/subselect4.result | 2 +- mysql-test/r/subselect_cache.result | 14 +- mysql-test/r/subselect_exists2in.result | 38 +- mysql-test/r/subselect_extra.result | 4 +- .../r/subselect_extra_no_semijoin.result | 8 +- mysql-test/r/subselect_mat.result | 116 +-- mysql-test/r/subselect_mat_cost_bugs.result | 2 +- mysql-test/r/subselect_no_exists_to_in.result | 92 +- mysql-test/r/subselect_no_mat.result | 88 +- mysql-test/r/subselect_no_opts.result | 82 +- mysql-test/r/subselect_no_scache.result | 88 +- mysql-test/r/subselect_no_semijoin.result | 86 +- mysql-test/r/subselect_partial_match.result | 2 +- mysql-test/r/subselect_sj.result | 40 +- mysql-test/r/subselect_sj2.result | 2 +- mysql-test/r/subselect_sj2_jcl6.result | 2 +- mysql-test/r/subselect_sj2_mat.result | 16 +- mysql-test/r/subselect_sj_jcl6.result | 40 +- mysql-test/r/subselect_sj_mat.result | 112 +-- mysql-test/r/table_elim.result | 16 +- mysql-test/r/type_date.result | 38 +- mysql-test/r/type_datetime.result | 30 +- mysql-test/r/type_enum.result | 4 +- mysql-test/r/type_float.result | 12 +- mysql-test/r/type_int.result | 4 +- mysql-test/r/type_newdecimal.result | 10 +- mysql-test/r/type_set.result | 4 +- mysql-test/r/type_time.result | 120 +-- mysql-test/r/type_time_6065.result | 166 ++-- mysql-test/r/type_timestamp.result | 22 +- mysql-test/r/type_year.result | 8 +- mysql-test/r/udf.result | 2 +- mysql-test/r/union.result | 4 +- mysql-test/r/upgrade.result | 2 +- mysql-test/r/variables.result | 10 +- mysql-test/r/view.result | 100 +-- mysql-test/r/view_alias.result | 2 +- mysql-test/r/view_grant.result | 12 +- mysql-test/r/win.result | 10 +- .../suite/funcs_1/r/innodb_func_view.result | 24 +- .../suite/funcs_1/r/innodb_views.result | 4 +- .../suite/funcs_1/r/memory_func_view.result | 24 +- .../suite/funcs_1/r/memory_views.result | 4 +- .../suite/funcs_1/r/myisam_func_view.result | 24 +- mysql-test/suite/funcs_1/r/storedproc.result | 190 ++--- mysql-test/suite/gcol/r/gcol_bugfixes.result | 2 +- .../r/gcol_column_def_options_innodb.result | 24 +- .../r/gcol_column_def_options_myisam.result | 24 +- .../suite/gcol/r/gcol_keys_innodb.result | 8 +- .../suite/gcol/r/gcol_keys_myisam.result | 14 +- .../r/gcol_non_stored_columns_innodb.result | 4 +- .../r/gcol_non_stored_columns_myisam.result | 4 +- .../r/gcol_supported_sql_funcs_innodb.result | 88 +- .../r/gcol_supported_sql_funcs_myisam.result | 88 +- .../suite/gcol/r/innodb_virtual_basic.result | 30 +- .../suite/gcol/r/innodb_virtual_debug.result | 4 +- .../gcol/r/innodb_virtual_debug_purge.result | 4 +- mysql-test/suite/gcol/r/rpl_gcol.result | 2 +- .../innodb/r/innodb-virtual-columns.result | 50 +- .../suite/innodb_fts/r/fulltext_misc.result | 4 +- .../innodb_gis/r/create_spatial_index.result | 2 +- mysql-test/suite/roles/definer.result | 22 +- mysql-test/suite/rpl/r/rpl_default.result | 2 +- .../suite/rpl/r/rpl_innodb_mixed_dml.result | 8 +- mysql-test/suite/rpl/r/rpl_view.result | 4 +- .../suite/vcol/r/innodb_autoinc_vcol.result | 2 +- mysql-test/suite/vcol/r/rpl_vcol.result | 2 +- .../r/vcol_column_def_options_innodb.result | 12 +- .../r/vcol_column_def_options_myisam.result | 12 +- .../suite/vcol/r/vcol_keys_innodb.result | 8 +- .../suite/vcol/r/vcol_keys_myisam.result | 8 +- mysql-test/suite/vcol/r/vcol_misc.result | 12 +- .../r/vcol_non_stored_columns_innodb.result | 4 +- .../r/vcol_non_stored_columns_myisam.result | 4 +- .../suite/vcol/r/vcol_select_myisam.result | 4 +- .../vcol/r/vcol_supported_sql_funcs.result | 88 +- mysql-test/suite/vcol/r/vcol_syntax.result | 12 +- .../suite/vcol/r/vcol_view_innodb.result | 2 +- .../suite/vcol/r/vcol_view_myisam.result | 2 +- mysql-test/t/func_date_add.test | 29 + sql/item.cc | 24 +- sql/item.h | 36 +- sql/item_cmpfunc.cc | 67 +- sql/item_cmpfunc.h | 20 +- sql/item_func.cc | 17 +- sql/item_func.h | 30 +- sql/item_strfunc.cc | 4 +- sql/item_strfunc.h | 1 + sql/item_timefunc.cc | 6 +- sql/item_timefunc.h | 1 + .../rpl/r/rpl_tokudb_mixed_dml.result | 8 +- .../mysql-test/tokudb/r/ctype_collate.result | 2 +- .../mysql-test/tokudb/r/type_datetime.result | 8 +- .../tokudb/r/type_newdecimal.result | 2 +- 188 files changed, 2684 insertions(+), 2553 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index dbfe2e8e162..97ac54472b2 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -2073,8 +2073,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), - CONSTRAINT `mini` CHECK (((`a` + `b`) > 100)) + CONSTRAINT `min` CHECK (`a` + `b` > 100), + CONSTRAINT `mini` CHECK (`a` + `b` > 100) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1(a INT, b INT, CONSTRAINT min check (a>5), diff --git a/mysql-test/r/analyze_format_json.result b/mysql-test/r/analyze_format_json.result index fadbe705f99..db28a2748aa 100644 --- a/mysql-test/r/analyze_format_json.result +++ b/mysql-test/r/analyze_format_json.result @@ -18,7 +18,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 30, - "attached_condition": "(t0.a < 3)" + "attached_condition": "t0.a < 3" } } } @@ -46,7 +46,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 0, - "attached_condition": "((t0.a > 9) and (t0.a is not null))" + "attached_condition": "t0.a > 9 and t0.a is not null" }, "table": { "table_name": "t1", @@ -86,7 +86,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" }, "table": { "table_name": "t1", @@ -102,7 +102,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 40, - "attached_condition": "(t1.b < 4)" + "attached_condition": "t1.b < 4" } } } @@ -128,7 +128,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 20, - "attached_condition": "(tbl1.b < 20)" + "attached_condition": "tbl1.b < 20" }, "block-nl-join": { "table": { @@ -140,7 +140,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 60, - "attached_condition": "(tbl2.b < 60)" + "attached_condition": "tbl2.b < 60" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -166,7 +166,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 20, - "attached_condition": "(tbl1.b < 20)" + "attached_condition": "tbl1.b < 20" }, "block-nl-join": { "table": { @@ -178,12 +178,12 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 60, - "attached_condition": "(tbl2.b < 60)" + "attached_condition": "tbl2.b < 60" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(tbl1.c > tbl2.c)", + "attached_condition": "tbl1.c > tbl2.c", "r_filtered": 15.833 } } @@ -213,7 +213,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(t1.a is not null)" + "attached_condition": "t1.a is not null" }, "table": { "table_name": "t2", @@ -263,7 +263,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 50, - "attached_condition": "(test.t1.a < 5)" + "attached_condition": "test.t1.a < 5" } } } @@ -320,8 +320,8 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 50, - "index_condition": "(t1.pk < 10)", - "attached_condition": "(t1.b > 4)" + "index_condition": "t1.pk < 10", + "attached_condition": "t1.b > 4" } } } @@ -344,7 +344,7 @@ ANALYZE "r_rows": 10, "r_filtered": 50, "r_total_time_ms": "REPLACED", - "attached_condition": "((t1.pk < 10) and (t1.b > 4))" + "attached_condition": "t1.pk < 10 and t1.b > 4" } } } @@ -444,7 +444,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 50, - "attached_condition": "(tbl1.a < 5)" + "attached_condition": "tbl1.a < 5" } } }, @@ -462,7 +462,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 20, - "attached_condition": "(tbl2.a in (2,3))" + "attached_condition": "tbl2.a in (2,3)" } } } @@ -492,7 +492,7 @@ ANALYZE "select_id": 1, "r_loops": 1, "volatile parameter": "REPLACED", - "having_condition": "(TOP > t2.a)", + "having_condition": "TOP > t2.a", "filesort": { "sort_key": "t2.a", "r_loops": 1, @@ -660,7 +660,7 @@ ANALYZE "buffer_type": "incremental", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.b = ``.a)", + "attached_condition": "t2.b = ``.a", "r_filtered": 0 } } @@ -722,7 +722,7 @@ ANALYZE "volatile parameter": "REPLACED", "filtered": 100, "r_filtered": 0, - "attached_condition": "(t3.f3 in (1,2))" + "attached_condition": "t3.f3 in (1,2)" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -758,7 +758,7 @@ ANALYZE "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.f2 = t3.f3)", + "attached_condition": "t2.f2 = t3.f3", "r_filtered": null } } diff --git a/mysql-test/r/analyze_stmt_orderby.result b/mysql-test/r/analyze_stmt_orderby.result index 37f0005148e..8d904a4419b 100644 --- a/mysql-test/r/analyze_stmt_orderby.result +++ b/mysql-test/r/analyze_stmt_orderby.result @@ -79,7 +79,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 8, - "attached_condition": "(t2.a < 10)" + "attached_condition": "t2.a < 10" } } } @@ -104,7 +104,7 @@ ANALYZE "r_rows": 10, "r_filtered": 100, "r_total_time_ms": "REPLACED", - "attached_condition": "(t2.a < 10)" + "attached_condition": "t2.a < 10" } } } @@ -179,7 +179,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" }, "table": { "table_name": "t2", @@ -221,7 +221,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" }, "table": { "table_name": "t2", @@ -264,7 +264,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" } } }, @@ -307,7 +307,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 1, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" } } }, @@ -365,7 +365,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 50, - "attached_condition": "((t2.a % 2) = 0)" + "attached_condition": "t2.a % 2 = 0" } } } @@ -428,7 +428,7 @@ ANALYZE "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t3.a = t0.a)", + "attached_condition": "t3.a = t0.a", "r_filtered": 10 } } @@ -483,7 +483,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 80, - "attached_condition": "((t6.b > 0) and (t6.a <= 5))" + "attached_condition": "t6.b > 0 and t6.a <= 5" }, "block-nl-join": { "table": { @@ -499,7 +499,7 @@ ANALYZE "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t5.a = t6.a)", + "attached_condition": "t5.a = t6.a", "r_filtered": 21.429 } } @@ -527,7 +527,7 @@ EXPLAIN "access_type": "ALL", "rows": 5, "filtered": 100, - "attached_condition": "((t6.b > 0) and (t6.a <= 5))" + "attached_condition": "t6.b > 0 and t6.a <= 5" }, "block-nl-join": { "table": { @@ -539,7 +539,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t5.a = t6.a)" + "attached_condition": "t5.a = t6.a" } } } diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 5fca4c82883..e58cce67d6a 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -420,22 +420,22 @@ UPDATE t1 SET b = a; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 18446744073709551615 AND TRIM(a) = b; SHOW WARNINGS; Level Code Message -Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and ('18446744073709551615' = `test`.`t1`.`b`)) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`a` = 18446744073709551615 and '18446744073709551615' = `test`.`t1`.`b` # 8000000000000000 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775808 AND TRIM(a) = b; SHOW WARNINGS; Level Code Message -Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775808) and ('9223372036854775808' = `test`.`t1`.`b`)) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`a` = 9223372036854775808 and '9223372036854775808' = `test`.`t1`.`b` # 7FFFFFFFFFFFFFFF EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775807 AND TRIM(a) = b; SHOW WARNINGS; Level Code Message -Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775807) and ('9223372036854775807' = `test`.`t1`.`b`)) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`a` = 9223372036854775807 and '9223372036854775807' = `test`.`t1`.`b` # 0 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 0 AND TRIM(a) = b; SHOW WARNINGS; Level Code Message -Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`)) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`a` = 0 and '0' = `test`.`t1`.`b` DROP TABLE t1; # End of 5.1 tests # diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 9ceb7efde64..5a02ca22392 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -27,7 +27,7 @@ explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" E id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (case 1 when 1 then 'one' when 2 then 'two' else 'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` +Note 1003 select case 1 when 1 then 'one' when 2 then 'two' else 'more' end AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END two @@ -66,7 +66,7 @@ explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort Warnings: -Note 1003 select (case `test`.`t1`.`a` when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from `test`.`t1` group by (case `test`.`t1`.`a` when 1 then 2 when 2 then 3 else 0 end) +Note 1003 select case `test`.`t1`.`a` when 1 then 2 when 2 then 3 else 0 end AS `fcase`,count(0) AS `count(*)` from `test`.`t1` group by case `test`.`t1`.`a` when 1 then 2 when 2 then 3 else 0 end select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; fcase count(*) nothing 2 @@ -147,7 +147,7 @@ COALESCE('a' COLLATE latin1_bin,'b'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce('a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,'1') AS `COALESCE(1,'1')`,coalesce(1.1,'1') AS `COALESCE(1.1,'1')`,coalesce(('a' collate latin1_bin),'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` +Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce('a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,'1') AS `COALESCE(1,'1')`,coalesce(1.1,'1') AS `COALESCE(1.1,'1')`,coalesce('a' collate latin1_bin,'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -270,7 +270,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '5') and (case `test`.`t1`.`a` when 1 then 1 else 0 end)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '5' and case `test`.`t1`.`a` when 1 then 1 else 0 end DROP TABLE t1; CREATE TABLE t1 (a ENUM('a','b','100')); INSERT INTO t1 VALUES ('a'),('b'),('100'); @@ -289,7 +289,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' SELECT * FROM t1 WHERE a=3; a 100 @@ -307,7 +307,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 else 0 end) and (`test`.`t1`.`a` = 3)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where case `test`.`t1`.`a` when 3 then 1 else 0 end and `test`.`t1`.`a` = 3 SELECT * FROM t1 WHERE a=3; a 100 @@ -323,7 +323,7 @@ SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where case `test`.`t1`.`a` when '100' then 1 else 0 end and `test`.`t1`.`a` = 3 SELECT * FROM t1 WHERE a='100'; a 100 @@ -339,7 +339,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 else 0 end)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '100' and case `test`.`t1`.`a` when 3 then 1 else 0 end SELECT * FROM t1 WHERE a='100'; a 100 @@ -355,7 +355,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '100' and case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end SELECT * FROM t1 WHERE a=3; a 100 @@ -371,7 +371,7 @@ SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end and `test`.`t1`.`a` = 3 DROP TABLE t1; # # End of MDEV-8752 diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 3871dcd11ea..2edacb6c7e9 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -33,7 +33,7 @@ explain extended select ~5, cast(~5 as signed); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` +Note 1003 select ~5 AS `~5`,cast(~5 as signed) AS `cast(~5 as signed)` select cast(18446744073709551615 as signed); cast(18446744073709551615 as signed) -1 @@ -804,7 +804,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` char(5) GENERATED ALWAYS AS ((cast('a' as char(10) charset latin1) + `a`)) VIRTUAL + `b` char(5) GENERATED ALWAYS AS (cast('a' as char(10) charset latin1) + `a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select collation(cast("a" as char(10) binary)); diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result index ddca2ea1393..db64eb7f89f 100644 --- a/mysql-test/r/check_constraint.result +++ b/mysql-test/r/check_constraint.result @@ -3,10 +3,10 @@ create table t1 (a int check(a>10), b int check (b > 20), constraint `min` check show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), - `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), - CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), - CONSTRAINT `max` CHECK (((`a` + `b`) < 500)) + `a` int(11) DEFAULT NULL CHECK (`a` > 10), + `b` int(11) DEFAULT NULL CHECK (`b` > 20), + CONSTRAINT `min` CHECK (`a` + `b` > 100), + CONSTRAINT `max` CHECK (`a` + `b` < 500) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (100,100); insert into t1 values (1,1); @@ -52,12 +52,12 @@ set check_constraint_checks=@save_check_constraint; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), - `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), - `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), - CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), - CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), - CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) + `a` int(11) DEFAULT NULL CHECK (`a` > 10), + `b` int(11) DEFAULT NULL CHECK (`b` > 20), + `c` int(11) DEFAULT 0 CHECK (`c` < 10), + CONSTRAINT `min` CHECK (`a` + `b` > 100), + CONSTRAINT `max` CHECK (`a` + `b` < 500), + CONSTRAINT `CONSTRAINT_1` CHECK (`a` + `b` + `c` < 500) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values(105,105,105); ERROR 23000: CONSTRAINT `c` failed for `test`.`t1` @@ -75,12 +75,12 @@ create table t2 like t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), - `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), - `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), - CONSTRAINT `min` CHECK (((`a` + `b`) > 100)), - CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), - CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) + `a` int(11) DEFAULT NULL CHECK (`a` > 10), + `b` int(11) DEFAULT NULL CHECK (`b` > 20), + `c` int(11) DEFAULT 0 CHECK (`c` < 10), + CONSTRAINT `min` CHECK (`a` + `b` > 100), + CONSTRAINT `max` CHECK (`a` + `b` < 500), + CONSTRAINT `CONSTRAINT_1` CHECK (`a` + `b` + `c` < 500) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t2 drop constraint c; ERROR 42000: Can't DROP CONSTRAINT `c`; check that it exists @@ -91,11 +91,11 @@ alter table t2 drop constraint min; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT NULL CHECK ((`a` > 10)), - `b` int(11) DEFAULT NULL CHECK ((`b` > 20)), - `c` int(11) DEFAULT 0 CHECK ((`c` < 10)), - CONSTRAINT `max` CHECK (((`a` + `b`) < 500)), - CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500)) + `a` int(11) DEFAULT NULL CHECK (`a` > 10), + `b` int(11) DEFAULT NULL CHECK (`b` > 20), + `c` int(11) DEFAULT 0 CHECK (`c` < 10), + CONSTRAINT `max` CHECK (`a` + `b` < 500), + CONSTRAINT `CONSTRAINT_1` CHECK (`a` + `b` + `c` < 500) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create or replace table t1 (a int, b int, constraint check (a>b)); @@ -104,7 +104,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`)) + CONSTRAINT `CONSTRAINT_1` CHECK (`a` > `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a int, b int, constraint CONSTRAINT_1 check (a>1), @@ -114,8 +114,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)), - CONSTRAINT `CONSTRAINT_2` CHECK ((`b` > 1)) + CONSTRAINT `CONSTRAINT_1` CHECK (`a` > 1), + CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a int, b int, constraint CONSTRAINT_1 check (a>1), @@ -126,8 +126,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)), - CONSTRAINT `CONSTRAINT_3` CHECK ((`b` > 1)), - CONSTRAINT `CONSTRAINT_2` CHECK ((`a` > `b`)) + CONSTRAINT `CONSTRAINT_1` CHECK (`a` > 1), + CONSTRAINT `CONSTRAINT_3` CHECK (`b` > 1), + CONSTRAINT `CONSTRAINT_2` CHECK (`a` > `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index a5654fb3160..ea8111cc3ce 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -64,7 +64,7 @@ EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101')) +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 1 and concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101' SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; b c 01 01 @@ -88,7 +88,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`>((select count(0) from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01'))))) AS `x` from `test`.`t2` order by `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`>((select count(0) from `test`.`t1` where `test`.`t1`.`b` = `test`.`t2`.`a` and concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01'))) AS `x` from `test`.`t2` order by `test`.`t2`.`a` DROP TABLE t1,t2; CREATE TABLE t1 (a TIMESTAMP); INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW()); diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result index 13e97ebaafb..762ab6630d8 100644 --- a/mysql-test/r/compress.result +++ b/mysql-test/r/compress.result @@ -1515,7 +1515,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index 017d03f7e67..2fca4b93fd9 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -3,7 +3,7 @@ create table t1 (a int check (a>0)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL CHECK ((`a` > 0)) + `a` int(11) DEFAULT NULL CHECK (`a` > 0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1); insert into t1 values (0); @@ -15,7 +15,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`)) + CONSTRAINT `CONSTRAINT_1` CHECK (`a` > `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); @@ -27,7 +27,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - CONSTRAINT `abc` CHECK ((`a` > `b`)) + CONSTRAINT `abc` CHECK (`a` > `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); diff --git a/mysql-test/r/create_drop_view.result b/mysql-test/r/create_drop_view.result index a822c16ae3c..0ec337b9b25 100644 --- a/mysql-test/r/create_drop_view.result +++ b/mysql-test/r/create_drop_view.result @@ -16,22 +16,22 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>11; ERROR 42S01: Table 'v1' already exists SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1'; VIEW_DEFINITION -select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10) +select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`id` > 10 CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>12; Warnings: Note 1050 Table 'v1' already exists SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1'; VIEW_DEFINITION -select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10) +select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`id` > 10 CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>13; ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1'; VIEW_DEFINITION -select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 10) +select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`id` > 10 CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>14; SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1'; VIEW_DEFINITION -select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` > 14) +select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`id` > 14 INSERT INTO t1 VALUES (50), (80), (3), (2), (40); SELECT * FROM t1; id diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index 616b2151bb7..71bf617df0a 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -569,7 +569,7 @@ with t as (select a from t1 where b >= 'c') select * from t2,t where t2.c=t.a; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where (`t1`.`b` >= 'c'))select `t2`.`c` AS `c`,`t`.`a` AS `a` from (`t2` join `t`) where (`t2`.`c` = `t`.`a`) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`b` >= 'c')select `t2`.`c` AS `c`,`t`.`a` AS `a` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci select * from v1; c a 4 4 @@ -586,7 +586,7 @@ with t as (select a, count(*) from t1 where b >= 'c' group by a) select * from t2,t where t2.c=t.a; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` where (`t1`.`b` >= 'c') group by `t1`.`a`)select `t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`t2` join `t`) where (`t2`.`c` = `t`.`a`) latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` where `t1`.`b` >= 'c' group by `t1`.`a`)select `t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci select * from v2; c a count(*) 4 4 2 @@ -604,7 +604,7 @@ with t(c) as (select a from t1 where b >= 'c') select * from t r1 where r1.c=4; show create view v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t as (select `t1`.`a` AS `c` from `t1` where (`t1`.`b` >= 'c'))select `r1`.`c` AS `c` from `t` `r1` where (`r1`.`c` = 4) latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t as (select `t1`.`a` AS `c` from `t1` where `t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci select * from v3; c 4 @@ -616,7 +616,7 @@ with t(c) as (select a from t1 where b >= 'c') select * from t r1, t r2 where r1.c=r2.c and r2.c=4; show create view v4; View Create View character_set_client collation_connection -v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t as (select `t1`.`a` AS `c` from `t1` where (`t1`.`b` >= 'c'))select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where ((`r1`.`c` = `r2`.`c`) and (`r2`.`c` = 4)) latin1 latin1_swedish_ci +v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t as (select `t1`.`a` AS `c` from `t1` where `t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci select * from v4; c d 4 4 diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 4504de38358..0cc88d27e23 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -699,7 +699,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL 2 UNCACHEABLE SUBQUERY ALL NULL NULL NULL NULL 12 100.00 Using where Warnings: -Note 1003 with recursive ancestor_couple_ids as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where ((`a`.`father` is not null) and (`a`.`mother` is not null)))coupled_ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where (`test`.`folks`.`name` = 'Me') union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where (`test`.`p`.`id` = `fa`.`h_id`) union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where (`test`.`p`.`id` = `ma`.`w_id`)), select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where ((`h`.`id` = `c`.`h_id`) and (`w`.`id` = `c`.`w_id`)) +Note 1003 with recursive ancestor_couple_ids as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null)coupled_ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`), select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id` # simple mutual recursion with recursive ancestor_couple_ids(h_id, w_id) @@ -818,7 +818,7 @@ where p.id = a.father or p.id = a.mother select * from ancestors; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where ((`folks`.`name` = 'Me') and (`folks`.`dob` = '2000-01-01')) union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `a`) where ((`p`.`id` = `a`.`father`) or (`p`.`id` = `a`.`mother`)))select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' and `folks`.`dob` = '2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `a`) where `p`.`id` = `a`.`father` or `p`.`id` = `a`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci select * from v1; id name dob father mother 100 Me 2000-01-01 20 30 @@ -849,7 +849,7 @@ where p.id = ma.mother select * from ancestors; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where (`folks`.`name` = 'Me') union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `fa`) where (`p`.`id` = `fa`.`father`) union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `ma`) where (`p`.`id` = `ma`.`mother`))select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `fa`) where `p`.`id` = `fa`.`father` union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `ma`) where `p`.`id` = `ma`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci select * from v2; id name dob father mother 100 Me 2000-01-01 20 30 @@ -882,7 +882,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 RECURSIVE UNION ALL NULL NULL NULL NULL 12 100.00 Using where; Using join buffer (flat, BNL join) NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where ((`test`.`folks`.`name` = 'Me') and (`test`.`folks`.`dob` = DATE'2000-01-01')) union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestors` `a` where ((`a`.`father` = `p`.`id`) or (`a`.`mother` = `p`.`id`)))select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` +Note 1003 with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' and `test`.`folks`.`dob` = DATE'2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestors` `a` where `a`.`father` = `p`.`id` or `a`.`mother` = `p`.`id`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` # recursive spec with two anchor selects and two recursive ones with recursive ancestor_ids (id) @@ -1358,7 +1358,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(folks.`name` = 'Me2')" + "attached_condition": "folks.`name` = 'Me2'" } } }, @@ -1370,7 +1370,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(prev_gen.`id` < 345)", + "attached_condition": "prev_gen.`id` < 345", "materialized": { "query_block": { "recursive_union": { @@ -1385,7 +1385,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(folks.`name` = 'Me')" + "attached_condition": "folks.`name` = 'Me'" } } }, @@ -1409,7 +1409,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((prev_gen.father = folks.`id`) or (prev_gen.mother = folks.`id`))" + "attached_condition": "prev_gen.father = folks.`id` or prev_gen.mother = folks.`id`" } } } @@ -1428,7 +1428,7 @@ EXPLAIN "access_type": "ALL", "rows": 24, "filtered": 100, - "attached_condition": "(ancestors.`id` < 234)" + "attached_condition": "ancestors.`id` < 234" } } } @@ -1489,7 +1489,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "((v.`name` = 'Me') and (v.father is not null) and (v.mother is not null))" + "attached_condition": "v.`name` = 'Me' and v.father is not null and v.mother is not null" }, "table": { "table_name": "h", @@ -1523,7 +1523,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((a.father is not null) and (a.mother is not null))" + "attached_condition": "a.father is not null and a.mother is not null" }, "table": { "table_name": "h", @@ -1766,7 +1766,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t.a < 1000)" + "attached_condition": "t.a < 1000" } } } diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 77e1224fa83..7fefa5754c3 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2869,7 +2869,7 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` +Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: @@ -3014,7 +3014,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`)) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -3036,7 +3036,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 @@ -3069,7 +3069,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)= id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61'; a HEX(a) a 61 @@ -3081,7 +3081,7 @@ EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' SELECT * FROM t1 WHERE a='a'; a a @@ -3107,7 +3107,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a ') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a ' DROP TABLE t1; # # MDEV-8723 Wrong result for SELECT..WHERE COLLATION(a)='binary' AND a='a' @@ -3130,22 +3130,22 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (weight_string(`test`.`t1`.`a`,0,0,1) = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and weight_string(`test`.`t1`.`a`,0,0,1) = 'a' DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index f84613e086f..27cae7e3c7b 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -519,7 +519,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,('a' = 'A') AS `'a'='A'` +Note 1003 select charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,'a' = 'A' AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 69253250a53..5f5bfa523f2 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -129,7 +129,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -152,7 +152,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -175,7 +175,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -198,7 +198,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -220,7 +220,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 3f8dae4e03d..8902a30934f 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3278,7 +3278,7 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` +Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: @@ -3385,12 +3385,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` in (1,2,3))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = ' 1' and `test`.`t1`.`a` in (1,2,3) EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,3,'x') AND a=' 1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` in (1,2,3,'x'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = ' 1' and `test`.`t1`.`a` in (1,2,3,'x') DROP TABLE t1; # # MDEV-8671 Wrong result for SELECT..WHERE varchar_column=' 1' AND (varchar_column XOR '1') @@ -3416,7 +3416,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=' 1' AND (a XOR '0'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 1') and (`test`.`t1`.`a` xor '0')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = ' 1' and (`test`.`t1`.`a` xor '0') DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 1a155a1c63d..5feb8b7c397 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3575,7 +3575,7 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` +Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: @@ -7723,7 +7723,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7746,7 +7746,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7769,7 +7769,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7792,7 +7792,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -7814,7 +7814,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -7844,7 +7844,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7867,7 +7867,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7890,7 +7890,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -7913,7 +7913,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -7935,7 +7935,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -8032,12 +8032,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND IF(a='10',1,0)=1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '10') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '10' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='10' AND CASE WHEN a='10' THEN 1 ELSE 0 END; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '10') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '10' DROP TABLE t1; # # MDEV-8680 Wrong result for SELECT..WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='a' @@ -8055,7 +8055,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a= id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`a` in ((('a' collate latin1_bin)),'b'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` in (('a' collate latin1_bin),'b') DROP TABLE t1; # # MDEV-8698 Wrong result for SELECT..WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin; @@ -8075,7 +8075,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`a` between 'a' and (('c' collate latin1_bin)))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` between 'a' and ('c' collate latin1_bin) DROP TABLE t1; # # MDEV-8707 Wrong result for SELECT..WHERE varchar_column=DATE'2001-01-01' AND varchar_column='2001-01-01' @@ -8157,7 +8157,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)= id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (crc32(`test`.`t1`.`a`) = 3904355907)) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and crc32(`test`.`t1`.`a`) = 3904355907 SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61'; a HEX(a) a 61 @@ -8169,7 +8169,7 @@ EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (hex(`test`.`t1`.`a`) = '61')) +Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and hex(`test`.`t1`.`a`) = '61' SELECT * FROM t1 WHERE a='a'; a a @@ -8185,7 +8185,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (length(`test`.`t1`.`a`) = 2)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and length(`test`.`t1`.`a`) = 2 DROP TABLE t1; # # MDEV-8712 Wrong result for SELECT..WHERE latin1_bin_column=_latin1'a' AND latin1_bin_column='A' @@ -8217,7 +8217,7 @@ SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 ')) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where coalesce(`test`.`t1`.`c`,0) = '3 ' and coalesce(`test`.`t1`.`d`,0) = '3 ' DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/ctype_latin2_ch.result b/mysql-test/r/ctype_latin2_ch.result index 2ec8351cd69..2e7be3d8384 100644 --- a/mysql-test/r/ctype_latin2_ch.result +++ b/mysql-test/r/ctype_latin2_ch.result @@ -69,7 +69,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -92,7 +92,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -115,7 +115,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -138,7 +138,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -160,7 +160,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index fd934600689..f7297426595 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -3139,7 +3139,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3162,7 +3162,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3185,7 +3185,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3208,7 +3208,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -3230,7 +3230,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -3355,7 +3355,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3378,7 +3378,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3401,7 +3401,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -3424,7 +3424,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -3446,7 +3446,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index cade3e4cd75..2640a078676 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -8468,7 +8468,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8491,7 +8491,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8514,7 +8514,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8537,7 +8537,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -8559,7 +8559,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 @@ -8586,7 +8586,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae' SELECT * FROM t1 WHERE CONCAT(c1)='ä'; c1 ä @@ -8599,7 +8599,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae' DROP TABLE IF EXISTS t1; SET NAMES utf8 COLLATE utf8_german2_ci; # @@ -8626,7 +8626,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8649,7 +8649,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8672,7 +8672,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -8695,7 +8695,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -8717,7 +8717,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 @@ -8746,7 +8746,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae' SELECT * FROM t1 WHERE CONCAT(c1)='ä'; c1 ae @@ -8761,7 +8761,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae' DROP TABLE IF EXISTS t1; # # MDEV-4929 Myanmar collation @@ -13944,12 +13944,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_c id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'oe') and (`test`.`t1`.`a` = 'oe')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'oe' and `test`.`t1`.`a` = 'oe' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'oe') and (`test`.`t1`.`a` = 'oe')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'oe' and `test`.`t1`.`a` = 'oe' DROP TABLE t1; # # End of MariaDB-10.0 tests diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 61367cbe081..11a9eccf7ee 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -4478,7 +4478,7 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` +Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: @@ -5386,7 +5386,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5409,7 +5409,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5432,7 +5432,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5455,7 +5455,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -5477,7 +5477,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -5507,7 +5507,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5530,7 +5530,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5553,7 +5553,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -5576,7 +5576,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -5598,7 +5598,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -5646,7 +5646,7 @@ SELECT * FROM t1 WHERE COALESCE(c,0)='3 ' AND COALESCE(d,0)=COALESCE(c,0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 ')) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where coalesce(`test`.`t1`.`c`,0) = '3 ' and coalesce(`test`.`t1`.`d`,0) = '3 ' DROP TABLE t1; # # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index bd148d82ac7..38e6eac7db0 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5320,7 +5320,7 @@ NULL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Level Code Message -Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()` +Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate < NOW()` id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: @@ -6797,7 +6797,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6820,7 +6820,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6843,7 +6843,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6866,7 +6866,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -6888,7 +6888,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') DROP TABLE t1; # # End of MDEV-8694 @@ -6918,7 +6918,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6941,7 +6941,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6964,7 +6964,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; SHOW CREATE TABLE t1; @@ -6987,7 +6987,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) DROP TABLE t1; # # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' @@ -7009,7 +7009,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((not((`test`.`t1`.`a` like 'a '))) and (`test`.`t1`.`a` = 'a')) +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 @@ -7036,7 +7036,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae' SELECT * FROM t1 WHERE CONCAT(c1)='ä'; c1 ä @@ -7049,7 +7049,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae' DROP TABLE IF EXISTS t1; # # MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string) @@ -10256,7 +10256,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,a)=(10,'1e1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`a` = '1e1')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10 and `test`.`t1`.`a` = '1e1' DROP TABLE t1; # # MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1'; @@ -10283,12 +10283,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '1ë1') and (`test`.`t1`.`a` in (1,2))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2) EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '1ë1') and (`test`.`t1`.`a` in (1,2,'x'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2,'x') DROP TABLE IF EXISTS t1; # # MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A'; @@ -10303,7 +10303,7 @@ SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`c` = 'A') +Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`c` = 'A' DROP TABLE t1; # # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 7e9fff5fe9d..efc2ec640f3 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -270,8 +270,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 1, - `b` int(11) DEFAULT ((`a` + 1)), - `c` int(11) DEFAULT ((`a` + `b`)) + `b` int(11) DEFAULT (`a` + 1), + `c` int(11) DEFAULT (`a` + `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (); insert into t1 (a) values (2); @@ -345,11 +345,11 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT 1, `c` int(11) DEFAULT -1, - `d` int(11) DEFAULT ((1 + 1)), + `d` int(11) DEFAULT (1 + 1), `e` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `f` int(11) DEFAULT (((1 + 1) + 1)), - `g` int(11) NOT NULL DEFAULT ((((1 + 1) + 1) + 1)), - `h` int(11) DEFAULT ((((2 + 2) + 2) + 2)) + `f` int(11) DEFAULT (1 + 1 + 1), + `g` int(11) NOT NULL DEFAULT (1 + 1 + 1 + 1), + `h` int(11) DEFAULT (2 + 2 + 2 + 2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -358,11 +358,11 @@ t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT 1, `c` int(11) DEFAULT -1, - `d` int(11) DEFAULT ((1 + 1)), + `d` int(11) DEFAULT (1 + 1), `e` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `f` int(11) DEFAULT (((1 + 1) + 1)), - `g` int(11) NOT NULL DEFAULT ((((1 + 1) + 1) + 1)), - `h` int(11) DEFAULT ((((2 + 2) + 2) + 2)) + `f` int(11) DEFAULT (1 + 1 + 1), + `g` int(11) NOT NULL DEFAULT (1 + 1 + 1 + 1), + `h` int(11) DEFAULT (2 + 2 + 2 + 2) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t2 (a) values (100); select a,b,c,d,e,f,g,h from t2; @@ -373,7 +373,7 @@ create table t1 (a int default (1----1), b int default - 1, c int default +1, e show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT ((1 - -1)), + `a` int(11) DEFAULT (1 - -1), `b` int(11) DEFAULT -1, `c` int(11) DEFAULT 1, `e` int(11) DEFAULT 1 @@ -549,7 +549,7 @@ deallocate prepare stmt; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT ((1 + 1)) + `a` int(11) DEFAULT (1 + 1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # @@ -1094,7 +1094,7 @@ CREATE TABLE `t1` (`a` int(11) DEFAULT (3+3),`b` int(11) DEFAULT '1000'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT ((3 + 3)), + `a` int(11) DEFAULT (3 + 3), `b` int(11) DEFAULT 1000 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1),(2,2); @@ -1243,7 +1243,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` DIV `b`)) + `c` int(11) DEFAULT (`a` DIV `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a, b) VALUES (13, 3); SELECT * FROM t1; @@ -1344,7 +1344,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` date DEFAULT ((`a` + interval `b` day)) + `c` date DEFAULT (`a` + interval `b` day) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES ('2001-01-01', 30, DEFAULT); SELECT * FROM t1; @@ -1964,7 +1964,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((case when `a` then `b` else 2 end)) + `c` int(11) DEFAULT (case when `a` then `b` else 2 end) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (0, 1, DEFAULT); INSERT INTO t1 VALUES (1, 1, DEFAULT); @@ -1978,13 +1978,13 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (-(`a`)) + `b` int(11) DEFAULT (-`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (-(`a`)) + `b` int(11) DEFAULT (-`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (10, DEFAULT); SELECT * FROM t1; @@ -2025,8 +2025,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` + `b`)), - `d` int(11) DEFAULT ((`a` - `b`)) + `c` int(11) DEFAULT (`a` + `b`), + `d` int(11) DEFAULT (`a` - `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (2, 1, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -2039,18 +2039,18 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` * `b`)), - `d` int(11) DEFAULT ((`a` / `b`)), - `e` int(11) DEFAULT ((`a` % `b`)) + `c` int(11) DEFAULT (`a` * `b`), + `d` int(11) DEFAULT (`a` / `b`), + `e` int(11) DEFAULT (`a` % `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` * `b`)), - `d` int(11) DEFAULT ((`a` / `b`)), - `e` int(11) DEFAULT ((`a` % `b`)) + `c` int(11) DEFAULT (`a` * `b`), + `d` int(11) DEFAULT (`a` / `b`), + `e` int(11) DEFAULT (`a` % `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (7, 3, DEFAULT, DEFAULT, DEFAULT); SELECT * FROM t1; @@ -2211,7 +2211,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` | `b`)) + `c` int(11) DEFAULT (`a` | `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (1,2); SELECT * FROM t1; @@ -2224,7 +2224,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` & `b`)) + `c` int(11) DEFAULT (`a` & `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,4); SELECT * FROM t1; @@ -2237,7 +2237,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` ^ `b`)) + `c` int(11) DEFAULT (`a` ^ `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (11,3); SELECT * FROM t1; @@ -2250,7 +2250,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` & ~(`b`))) + `c` int(11) DEFAULT (`a` & ~`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,1); SELECT * FROM t1; @@ -2263,8 +2263,8 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT ((`a` << `b`)), - `d` int(11) DEFAULT ((`a` >> `b`)) + `c` int(11) DEFAULT (`a` << `b`), + `d` int(11) DEFAULT (`a` >> `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (5,1); SELECT * FROM t1; @@ -2617,7 +2617,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` = 0)) + `b` int(11) DEFAULT (`a` = 0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2632,7 +2632,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `x` int(11) DEFAULT ((`a` xor `b`)) + `x` int(11) DEFAULT (`a` xor `b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES (0,0),(0,1),(1,0),(1,1); SELECT * FROM t1; @@ -2647,8 +2647,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` is true)), - `c` int(11) DEFAULT ((`a` is not true)) + `b` int(11) DEFAULT (`a` is true), + `c` int(11) DEFAULT (`a` is not true) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2662,8 +2662,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` is false)), - `c` int(11) DEFAULT ((`a` is not false)) + `b` int(11) DEFAULT (`a` is false), + `c` int(11) DEFAULT (`a` is not false) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2677,8 +2677,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (isnull(`a`)), - `c` int(11) DEFAULT ((`a` is not null)) + `b` int(11) DEFAULT (`a` is null), + `c` int(11) DEFAULT (`a` is not null) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2692,8 +2692,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT (isnull(`a`)), - `c` int(11) DEFAULT ((`a` is not null)) + `b` int(11) DEFAULT (`a` is null), + `c` int(11) DEFAULT (`a` is not null) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(0),(1); SELECT * FROM t1; @@ -2711,13 +2711,13 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `eq` int(11) DEFAULT ((`a` = 0)), - `equal` int(11) DEFAULT ((`a` <=> 0)), - `ne` int(11) DEFAULT ((`a` <> 0)), - `lt` int(11) DEFAULT ((`a` < 0)), - `le` int(11) DEFAULT ((`a` <= 0)), - `gt` int(11) DEFAULT ((`a` > 0)), - `ge` int(11) DEFAULT ((`a` >= 0)) + `eq` int(11) DEFAULT (`a` = 0), + `equal` int(11) DEFAULT (`a` <=> 0), + `ne` int(11) DEFAULT (`a` <> 0), + `lt` int(11) DEFAULT (`a` < 0), + `le` int(11) DEFAULT (`a` <= 0), + `gt` int(11) DEFAULT (`a` > 0), + `ge` int(11) DEFAULT (`a` >= 0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES (NULL),(-1),(0),(1); SELECT * FROM t1; @@ -2732,7 +2732,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` like 'a%')) + `b` int(11) DEFAULT (`a` like 'a%') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); SELECT * FROM t1; @@ -2746,7 +2746,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` regexp 'a$')) + `b` int(11) DEFAULT (`a` regexp 'a$') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); SELECT * FROM t1; @@ -2760,7 +2760,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` in ('aaa','bbb'))) + `b` int(11) DEFAULT (`a` in ('aaa','bbb')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2775,7 +2775,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` not in ('aaa','bbb'))) + `b` int(11) DEFAULT (`a` not in ('aaa','bbb')) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2790,7 +2790,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` between 'aaa' and 'bbb')) + `b` int(11) DEFAULT (`a` between 'aaa' and 'bbb') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -2805,7 +2805,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` not between 'aaa' and 'bbb')) + `b` int(11) DEFAULT (`a` not between 'aaa' and 'bbb') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); SELECT * FROM t1; @@ -3052,7 +3052,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 1, - `b` int(11) DEFAULT ((1 + 1)), + `b` int(11) DEFAULT (1 + 1), `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 alter a set default (2+3), alter b set default 4, @@ -3062,9 +3062,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT ((2 + 3)), + `a` int(11) DEFAULT (2 + 3), `b` int(11) DEFAULT 4, - `c` int(11) DEFAULT (-(`a`)) + `c` int(11) DEFAULT (-`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int default 5 check (a>10), b int default (5+5), c int as (a+b)); @@ -3073,8 +3073,8 @@ create table t3 as select max(a), max(b), max(c) from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT 5 CHECK ((`a` > 10)), - `b` int(11) DEFAULT ((5 + 5)), + `a` int(11) DEFAULT 5 CHECK (`a` > 10), + `b` int(11) DEFAULT (5 + 5), `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t3; @@ -3241,7 +3241,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) DEFAULT (("a" + 1)) + "b" int(11) DEFAULT ("a" + 1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert t1 (a) values (10); set sql_mode=''; @@ -3249,7 +3249,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` + 1)) + `b` int(11) DEFAULT (`a` + 1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert t1 (a) values (20); flush tables; @@ -3257,7 +3257,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT ((`a` + 1)) + `b` int(11) DEFAULT (`a` + 1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert t1 (a) values (30); select * from t1; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 04cb8c4c3ad..2e89d7de464 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -632,7 +632,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DERIVED t1 system NULL NULL NULL NULL 1 100.00 Warnings: Note 1276 Field or reference 'sq.f2' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 6 AS `f1` from (select `test`.`t2`.`f3` from `test`.`t2` having (`test`.`t2`.`f3` >= 8)) semi join (`test`.`t2`) where ((`test`.`t2`.`f3` = 6) and (``.`f3` = 9)) +Note 1003 select 6 AS `f1` from (select `test`.`t2`.`f3` from `test`.`t2` having `test`.`t2`.`f3` >= 8) semi join (`test`.`t2`) where `test`.`t2`.`f3` = 6 and ``.`f3` = 9 DROP TABLE t2,t1; # # MDEV-9462: Out of memory using explain on 2 empty tables diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 973a14096c0..5df1a8d7e6a 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -133,16 +133,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.max_c > 214)" + "attached_condition": "v1.max_c > 214" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.a > v1.a)", + "attached_condition": "t2.a > v1.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 214))", + "having_condition": "max_c < 707 and max_c > 214", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -202,7 +202,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -214,11 +214,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.max_c > 300)", + "attached_condition": "v1.max_c > 300", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 300))", + "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -288,16 +288,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 400) or (v1.max_c < 135))" + "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.max_c > 400) and (t2.a > v1.a)) or ((v1.max_c < 135) and (t2.a < v1.a)))", + "attached_condition": "v1.max_c > 400 and t2.a > v1.a or v1.max_c < 135 and t2.a < v1.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((max_c > 400) or (max_c < 135)))", + "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -356,16 +356,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 300) or (v1.max_c < 135))" + "attached_condition": "v1.max_c > 300 or v1.max_c < 135" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.b = t2.b) and (v1.max_c > 300) and (v1.avg_c > t2.d)) or ((v1.a = t2.a) and (v1.max_c < 135) and (v1.max_c < t2.c)))", + "attached_condition": "v1.b = t2.b and v1.max_c > 300 and v1.avg_c > t2.d or v1.a = t2.a and v1.max_c < 135 and v1.max_c < t2.c", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((max_c > 300) or (max_c < 135)))", + "having_condition": "max_c < 707 and (max_c > 300 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -413,16 +413,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.a > 6)" + "attached_condition": "v1.a > 6" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.b > v1.b)", + "attached_condition": "t2.b > v1.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -431,7 +431,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 6)" + "attached_condition": "t1.a > 6" } } } @@ -480,16 +480,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v2.b > 25)" + "attached_condition": "v2.b > 25" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.a < v2.a)", + "attached_condition": "t2.a < v2.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -498,7 +498,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b > 25))" + "attached_condition": "t1.a > 5 and t1.b > 25" } } } @@ -568,16 +568,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a > 7) or (v1.a < 2))" + "attached_condition": "v1.a > 7 or v1.a < 2" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a > 7) and (t2.c < v1.max_c)) or ((v1.a < 2) and (t2.b < v1.b)))", + "attached_condition": "v1.a > 7 and t2.c < v1.max_c or v1.a < 2 and t2.b < v1.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -586,7 +586,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 7) or (t1.a < 2))" + "attached_condition": "t1.a > 7 or t1.a < 2" } } } @@ -649,16 +649,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v2.a > 7) or (v2.a > 5))" + "attached_condition": "v2.a > 7 or v2.a > 5" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v2.a > 7) and (t2.c < v2.max_c)) or ((v2.a > 5) and (t2.b < v2.b)))", + "attached_condition": "v2.a > 7 and t2.c < v2.max_c or v2.a > 5 and t2.b < v2.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -667,7 +667,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and ((t1.a > 7) or (t1.a > 5)))" + "attached_condition": "t1.a > 5 and (t1.a > 7 or t1.a > 5)" } } } @@ -716,16 +716,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a > 4) or (v1.a < 2))" + "attached_condition": "v1.a > 4 or v1.a < 2" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a > 4) and (v1.b > t2.b) and (v1.max_c = t2.d)) or ((v1.a < 2) and (v1.max_c < t2.c) and (v1.max_c = t2.d)))", + "attached_condition": "v1.a > 4 and v1.b > t2.b and v1.max_c = t2.d or v1.a < 2 and v1.max_c < t2.c and v1.max_c = t2.d", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -734,7 +734,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 4) or (t1.a < 2))" + "attached_condition": "t1.a > 4 or t1.a < 2" } } } @@ -776,16 +776,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 2) and (v1.max_c > 400))" + "attached_condition": "v1.a < 2 and v1.max_c > 400" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(t2.b > v1.b)", + "attached_condition": "t2.b > v1.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 400))", + "having_condition": "max_c < 707 and max_c > 400", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -794,7 +794,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a < 2)" + "attached_condition": "t1.a < 2" } } } @@ -840,7 +840,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t.a is not null)" + "attached_condition": "t.a is not null" }, "table": { "table_name": "", @@ -852,11 +852,11 @@ EXPLAIN "ref": ["test.t.a"], "rows": 2, "filtered": 100, - "attached_condition": "((v.avg_a > 0.45) and (v.b > 10))", + "attached_condition": "v.avg_a > 0.45 and v.b > 10", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((avg_a < 22.333) and (avg_a > 0.45))", + "having_condition": "avg_a < 22.333 and avg_a > 0.45", "filesort": { "sort_key": "t1_double.b, t1_double.c", "temporary_table": { @@ -865,7 +865,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t1_double.b > 12.2) and (t1_double.b > 10))" + "attached_condition": "t1_double.b > 12.2 and t1_double.b > 10" } } } @@ -899,7 +899,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t.a is not null)" + "attached_condition": "t.a is not null" }, "table": { "table_name": "", @@ -911,11 +911,11 @@ EXPLAIN "ref": ["test.t.a"], "rows": 2, "filtered": 100, - "attached_condition": "((v.avg_c > 15) and (v.b > 1))", + "attached_condition": "v.avg_c > 15 and v.b > 1", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((avg_c > 12) and (avg_c > 15))", + "having_condition": "avg_c > 12 and avg_c > 15", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", "temporary_table": { @@ -924,7 +924,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t1_decimal.b > 1)" + "attached_condition": "t1_decimal.b > 1" } } } @@ -988,16 +988,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a > 7) and (v1.max_c > 300)) or ((v1.a < 4) and (v1.max_c < 500)))" + "attached_condition": "v1.a > 7 and v1.max_c > 300 or v1.a < 4 and v1.max_c < 500" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a > 7) and (v1.max_c > 300) and (t2.c < v1.max_c)) or ((v1.a < 4) and (v1.max_c < 500) and (t2.b < v1.b)))", + "attached_condition": "v1.a > 7 and v1.max_c > 300 and t2.c < v1.max_c or v1.a < 4 and v1.max_c < 500 and t2.b < v1.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (((t1.a > 7) and (max_c > 300)) or ((t1.a < 4) and (max_c < 500))))", + "having_condition": "max_c < 707 and (t1.a > 7 and max_c > 300 or t1.a < 4 and max_c < 500)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1006,7 +1006,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 7) or (t1.a < 4))" + "attached_condition": "t1.a > 7 or t1.a < 4" } } } @@ -1077,16 +1077,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a < 2) and (v1.max_c > 120)) or (v1.a > 7))" + "attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a < 2) and (v1.max_c > 120)) or (v1.a > 7))", + "attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (((t1.a < 2) and (max_c > 120)) or (t1.a > 7)))", + "having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1095,7 +1095,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 2) or (t1.a > 7))" + "attached_condition": "t1.a < 2 or t1.a > 7" } } } @@ -1155,16 +1155,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a < 2) and (v1.max_c > 120)) or (v1.a > 7))" + "attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.b = t2.b) and (v1.a < 2) and (v1.max_c > 120)) or (v1.a > 7))", + "attached_condition": "v1.b = t2.b and v1.a < 2 and v1.max_c > 120 or v1.a > 7", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (((t1.a < 2) and (max_c > 120)) or (t1.a > 7)))", + "having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1173,7 +1173,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 2) or (t1.a > 7))" + "attached_condition": "t1.a < 2 or t1.a > 7" } } } @@ -1222,16 +1222,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a < 2) and (v1.max_c < 200)) or (v1.a > 4))" + "attached_condition": "v1.a < 2 and v1.max_c < 200 or v1.a > 4" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a < 2) and (v1.max_c < 200) and (t2.c > v1.max_c) and (v1.max_c = t2.d)) or ((v1.max_c = t2.c) and (v1.a > 4) and (t2.c < 500) and (t2.b < v1.b)))", + "attached_condition": "v1.a < 2 and v1.max_c < 200 and t2.c > v1.max_c and v1.max_c = t2.d or v1.max_c = t2.c and v1.a > 4 and t2.c < 500 and t2.b < v1.b", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (((t1.a < 2) and (max_c < 200)) or ((t1.a > 4) and (max_c < 500))))", + "having_condition": "max_c < 707 and (t1.a < 2 and max_c < 200 or t1.a > 4 and max_c < 500)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1240,7 +1240,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 2) or (t1.a > 4))" + "attached_condition": "t1.a < 2 or t1.a > 4" } } } @@ -1299,16 +1299,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 400) or (v1.max_c < 135))" + "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.max_c > 400) and (t2.a > v1.a)) or ((v1.max_c < 135) and (t2.a < v1.a)))", + "attached_condition": "v1.max_c > 400 and t2.a > v1.a or v1.max_c < 135 and t2.a < v1.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((max_c > 400) or (max_c < 135)))", + "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1342,16 +1342,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 400) or (v1.max_c < 135))" + "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.max_c > 400) and (t2.a > v1.a)) or ((v1.max_c < 135) and (t2.a < v1.a)))", + "attached_condition": "v1.max_c > 400 and t2.a > v1.a or v1.max_c < 135 and t2.a < v1.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((max_c > 400) or (max_c < 135)))", + "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1394,7 +1394,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a = 1) and (t2.b is not null))" + "attached_condition": "t2.a = 1 and t2.b is not null" }, "table": { "table_name": "", @@ -1406,11 +1406,11 @@ EXPLAIN "ref": ["test.t2.b"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.a = 1)", + "attached_condition": "v1.a = 1", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -1419,7 +1419,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 1)" + "attached_condition": "t1.a = 1" } } } @@ -1449,7 +1449,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.d is not null)" + "attached_condition": "t2.d is not null" }, "table": { "table_name": "", @@ -1461,11 +1461,11 @@ EXPLAIN "ref": ["test.t2.d"], "rows": 2, "filtered": 100, - "attached_condition": "((v1.a = 5) and (v1.max_c = t2.d))", + "attached_condition": "v1.a = 5 and v1.max_c = t2.d", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -1474,7 +1474,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 5)" + "attached_condition": "t1.a = 5" } } } @@ -1511,7 +1511,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a < 5) and (t2.a is not null))" + "attached_condition": "t2.a < 5 and t2.a is not null" }, "table": { "table_name": "", @@ -1526,7 +1526,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1535,7 +1535,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a < 5)" + "attached_condition": "t1.a < 5" } } } @@ -1563,7 +1563,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -1578,7 +1578,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1587,7 +1587,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.b = t1.a)" + "attached_condition": "t1.b = t1.a" } } } @@ -1620,7 +1620,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.c > 150) and (t2.c is not null))" + "attached_condition": "t2.c > 150 and t2.c is not null" }, "table": { "table_name": "", @@ -1635,7 +1635,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 150))", + "having_condition": "max_c < 707 and max_c > 150", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1673,7 +1673,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 3)" + "attached_condition": "t2.a = 3" }, "block-nl-join": { "table": { @@ -1681,7 +1681,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 3) and (v1.b = 3))" + "attached_condition": "v1.a = 3 and v1.b = 3" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -1689,13 +1689,13 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 3) and (t1.b = 3))" + "attached_condition": "t1.a = 3 and t1.b = 3" } } } @@ -1723,7 +1723,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 2)" + "attached_condition": "t2.a = 2" }, "block-nl-join": { "table": { @@ -1731,7 +1731,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 1) and (v1.b = 21))" + "attached_condition": "v1.a = 1 and v1.b = 21" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -1739,13 +1739,13 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 1) and (t1.b = 21))" + "attached_condition": "t1.a = 1 and t1.b = 21" } } } @@ -1779,11 +1779,11 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "((v.a = 'c') and (v.b < 'Hermes'))", + "attached_condition": "v.a = 'c' and v.b < 'Hermes'", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 9)", + "having_condition": "max_c < 9", "filesort": { "sort_key": "t1_char.b", "temporary_table": { @@ -1792,7 +1792,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "((t1_char.a = 'c') and (t1_char.b < 'Hermes'))" + "attached_condition": "t1_char.a = 'c' and t1_char.b < 'Hermes'" } } } @@ -1809,7 +1809,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((t.b = v.b) or (v.max_c > 20))" + "attached_condition": "t.b = v.b or v.max_c > 20" } } } @@ -1852,7 +1852,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(((t.b > 1) or (t.b = 1)) and (t.b is not null) and (t.b is not null))" + "attached_condition": "(t.b > 1 or t.b = 1) and t.b is not null and t.b is not null" }, "table": { "table_name": "", @@ -1867,7 +1867,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(avg_c > 12)", + "having_condition": "avg_c > 12", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", "temporary_table": { @@ -1876,7 +1876,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t1_decimal.b = t1_decimal.a) and ((t1_decimal.a > 1) or (t1_decimal.a = 1)))" + "attached_condition": "t1_decimal.b = t1_decimal.a and (t1_decimal.a > 1 or t1_decimal.a = 1)" } } } @@ -1921,7 +1921,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a < 4) or (t2.c > 150))" + "attached_condition": "t2.a < 4 or t2.c > 150" }, "block-nl-join": { "table": { @@ -1933,11 +1933,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a = t2.a) and (t2.a < 4)) or ((v1.max_c = t2.c) and (t2.c > 150)))", + "attached_condition": "v1.a = t2.a and t2.a < 4 or v1.max_c = t2.c and t2.c > 150", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((t1.a < 4) or (max_c > 150)))", + "having_condition": "max_c < 707 and (t1.a < 4 or max_c > 150)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -1980,7 +1980,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a > 5) and (t2.c > 250) and (t2.a is not null) and (t2.c is not null))" + "attached_condition": "t2.a > 5 and t2.c > 250 and t2.a is not null and t2.c is not null" }, "table": { "table_name": "", @@ -1995,7 +1995,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 250))", + "having_condition": "max_c < 707 and max_c > 250", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2004,7 +2004,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -2050,7 +2050,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 8)" + "attached_condition": "t2.a = 8" }, "block-nl-join": { "table": { @@ -2058,7 +2058,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 8) and (v1.max_c = 404))" + "attached_condition": "v1.a = 8 and v1.max_c = 404" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -2066,7 +2066,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c = 404)", + "having_condition": "max_c = 404", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -2075,7 +2075,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 8)" + "attached_condition": "t1.a = 8" } } } @@ -2110,7 +2110,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.d is not null)" + "attached_condition": "t2.d is not null" }, "table": { "table_name": "", @@ -2122,11 +2122,11 @@ EXPLAIN "ref": ["test.t2.d"], "rows": 2, "filtered": 100, - "attached_condition": "((v1.a > 3) and (v1.max_c > 200) and (t2.b < v1.b) and (t2.d = v1.max_c))", + "attached_condition": "v1.a > 3 and v1.max_c > 200 and t2.b < v1.b and t2.d = v1.max_c", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 200))", + "having_condition": "max_c < 707 and max_c > 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2135,7 +2135,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 3)" + "attached_condition": "t1.a > 3" } } } @@ -2170,7 +2170,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t.c is not null) and (t.c is not null))" + "attached_condition": "t.c is not null and t.c is not null" }, "table": { "table_name": "", @@ -2182,11 +2182,11 @@ EXPLAIN "ref": ["test.t.c", "test.t.c"], "rows": 2, "filtered": 100, - "attached_condition": "((t.c > 10) or (v.a = 1))", + "attached_condition": "t.c > 10 or v.a = 1", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((avg_a < 22.333) and ((t1_double.b > 10) or (t1_double.a = 1)))", + "having_condition": "avg_a < 22.333 and (t1_double.b > 10 or t1_double.a = 1)", "filesort": { "sort_key": "t1_double.b, t1_double.c", "temporary_table": { @@ -2195,7 +2195,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t1_double.c = t1_double.b) and (t1_double.b > 12.2))" + "attached_condition": "t1_double.c = t1_double.b and t1_double.b > 12.2" } } } @@ -2235,7 +2235,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t.c > 18) and (t.c is not null))" + "attached_condition": "t.c > 18 and t.c is not null" }, "table": { "table_name": "", @@ -2247,11 +2247,11 @@ EXPLAIN "ref": ["test.t.c"], "rows": 2, "filtered": 100, - "attached_condition": "((v.a > 0.2) or (v.b < 17) or (t.c > 17))", + "attached_condition": "v.a > 0.2 or v.b < 17 or t.c > 17", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((avg_a < 22.333) and ((t1_double.a > 0.2) or (t1_double.b < 17) or (t1_double.c > 17)))", + "having_condition": "avg_a < 22.333 and (t1_double.a > 0.2 or t1_double.b < 17 or t1_double.c > 17)", "filesort": { "sort_key": "t1_double.b, t1_double.c", "temporary_table": { @@ -2260,7 +2260,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t1_double.b > 12.2) and (t1_double.c > 18))" + "attached_condition": "t1_double.b > 12.2 and t1_double.c > 18" } } } @@ -2331,11 +2331,11 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(((v.a > 4) or (v.a = 2) or (v.b > 3)) and (v.avg_c = 13))", + "attached_condition": "(v.a > 4 or v.a = 2 or v.b > 3) and v.avg_c = 13", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((avg_c > 12) and (avg_c = 13))", + "having_condition": "avg_c > 12 and avg_c = 13", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", "temporary_table": { @@ -2344,7 +2344,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t1_decimal.a > 4) or (t1_decimal.a = 2) or (t1_decimal.b > 3))" + "attached_condition": "t1_decimal.a > 4 or t1_decimal.a = 2 or t1_decimal.b > 3" } } } @@ -2395,7 +2395,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -2407,11 +2407,11 @@ EXPLAIN "ref": ["test.t2.a", "test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.max_c > 300)", + "attached_condition": "v1.max_c > 300", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 300))", + "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2420,7 +2420,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b = t1.a) and (t1.a > 5))" + "attached_condition": "t1.b = t1.a and t1.a > 5" } } } @@ -2461,7 +2461,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a < 2) and (t2.c > 900))" + "attached_condition": "t2.a < 2 and t2.c > 900" }, "block-nl-join": { "table": { @@ -2476,7 +2476,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2518,7 +2518,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.b is not null))" + "attached_condition": "t2.a is not null and t2.b is not null" }, "table": { "table_name": "", @@ -2533,7 +2533,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2600,11 +2600,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a = t2.a) or ((v1.b = t2.b) and ((v1.a = 1) or (v1.a = 6))))", + "attached_condition": "v1.a = t2.a or v1.b = t2.b and (v1.a = 1 or v1.a = 6)", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2695,11 +2695,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a = 1) or (v1.b = 21) or (t2.a = 2))", + "attached_condition": "v1.a = 1 or v1.b = 21 or t2.a = 2", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2751,7 +2751,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a < 2) and (t2.c > 900))" + "attached_condition": "t2.a < 2 and t2.c > 900" }, "block-nl-join": { "table": { @@ -2763,11 +2763,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a < t2.a) or (t2.a < 11))", + "attached_condition": "v1.a < t2.a or t2.a < 11", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2818,7 +2818,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -2833,7 +2833,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2858,11 +2858,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v2.b < 50)", + "attached_condition": "v2.b < 50", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2871,7 +2871,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b < 50))" + "attached_condition": "t1.a > 5 and t1.b < 50" } } } @@ -2933,7 +2933,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.b < 50)" + "attached_condition": "t2.b < 50" }, "block-nl-join": { "table": { @@ -2945,11 +2945,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(v1.b is not null)", + "attached_condition": "v1.b is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2974,11 +2974,11 @@ EXPLAIN "ref": ["v1.b"], "rows": 2, "filtered": 100, - "attached_condition": "((v2.a = v1.a) or (v1.a = t2.a))", + "attached_condition": "v2.a = v1.a or v1.a = t2.a", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2987,7 +2987,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3040,11 +3040,11 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a = t2.a) or (t2.c < 115))", + "attached_condition": "v1.a = t2.a or t2.c < 115", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3069,11 +3069,11 @@ EXPLAIN "buffer_type": "incremental", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a = t2.a) and (v2.a = t2.a)) or ((v2.b > 13) and (t2.c < 115)))", + "attached_condition": "v1.a = t2.a and v2.a = t2.a or v2.b > 13 and t2.c < 115", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3082,7 +3082,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3135,7 +3135,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.max_c < 300)" + "attached_condition": "v1.max_c < 300" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -3143,7 +3143,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c < 300))", + "having_condition": "max_c < 707 and max_c < 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3164,16 +3164,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v2.b < 50) or (v2.b = 19))" + "attached_condition": "v2.b < 50 or v2.b = 19" }, "buffer_type": "incremental", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v2.a = v1.a) or (v1.a = t2.a)) and ((v2.b < 50) or (v2.b = 19)))", + "attached_condition": "(v2.a = v1.a or v1.a = t2.a) and (v2.b < 50 or v2.b = 19)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3182,7 +3182,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and ((t1.b < 50) or (t1.b = 19)))" + "attached_condition": "t1.a > 5 and (t1.b < 50 or t1.b = 19)" } } } @@ -3219,7 +3219,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a is not null and t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -3234,7 +3234,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3243,7 +3243,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.b = t1.a)" + "attached_condition": "t1.b = t1.a" } } } @@ -3260,11 +3260,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v2.max_c < 300)", + "attached_condition": "v2.max_c < 300", "materialized": { "query_block": { "select_id": 3, - "having_condition": "((max_c < 707) and (max_c < 300))", + "having_condition": "max_c < 707 and max_c < 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3273,7 +3273,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3314,16 +3314,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 1) and (v1.b > 10))" + "attached_condition": "v1.a = 1 and v1.b > 10" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(v1.b is not null)", + "attached_condition": "v1.b is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -3332,7 +3332,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 1) and (t1.b > 10))" + "attached_condition": "t1.a = 1 and t1.b > 10" } } } @@ -3352,7 +3352,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3361,7 +3361,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b > 10))" + "attached_condition": "t1.a > 5 and t1.b > 10" } } } @@ -3406,11 +3406,11 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "((v.a = 'b') and ((v.b = 'Vika') or (v.b = 'Ali')))", + "attached_condition": "v.a = 'b' and (v.b = 'Vika' or v.b = 'Ali')", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(max_c < 9)", + "having_condition": "max_c < 9", "filesort": { "sort_key": "t1_char.b", "temporary_table": { @@ -3419,7 +3419,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "((t1_char.a = 'b') and ((t1_char.b = 'Vika') or (t1_char.b = 'Ali')))" + "attached_condition": "t1_char.a = 'b' and (t1_char.b = 'Vika' or t1_char.b = 'Ali')" } } } @@ -3432,7 +3432,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(t.a = 'b')" + "attached_condition": "t.a = 'b'" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -3503,7 +3503,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -3515,11 +3515,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "((v3.b < 50) or (v3.b = 33))", + "attached_condition": "v3.b < 50 or v3.b = 33", "materialized": { "query_block": { "select_id": 4, - "having_condition": "(min_c > 109)", + "having_condition": "min_c > 109", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3528,7 +3528,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.b < 50) or (t1.b = 33)))" + "attached_condition": "t1.a < 10 and (t1.b < 50 or t1.b = 33)" } } } @@ -3541,7 +3541,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v2.max_c > 300)" + "attached_condition": "v2.max_c > 300" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -3549,7 +3549,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, - "having_condition": "((max_c < 707) and (max_c > 300))", + "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3558,7 +3558,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3571,16 +3571,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.max_c < 500)" + "attached_condition": "v1.max_c < 500" }, "buffer_type": "incremental", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a = v2.a) or (v1.a = t2.a))", + "attached_condition": "v1.a = v2.a or v1.a = t2.a", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c < 500))", + "having_condition": "max_c < 707 and max_c < 500", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3640,7 +3640,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.b is not null)" + "attached_condition": "t2.b is not null" }, "table": { "table_name": "", @@ -3652,11 +3652,11 @@ EXPLAIN "ref": ["test.t2.b"], "rows": 2, "filtered": 100, - "attached_condition": "((v1.max_c > 130) and (v1.a is not null))", + "attached_condition": "v1.max_c > 130 and v1.a is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 130))", + "having_condition": "max_c < 707 and max_c > 130", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3665,7 +3665,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3682,11 +3682,11 @@ EXPLAIN "ref": ["v1.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v2.min_c < 130)", + "attached_condition": "v2.min_c < 130", "materialized": { "query_block": { "select_id": 3, - "having_condition": "((min_c < 707) and (min_c < 130))", + "having_condition": "min_c < 707 and min_c < 130", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3695,7 +3695,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3787,16 +3787,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.avg_c < 400) or (v1.a > 1))" + "attached_condition": "v1.avg_c < 400 or v1.a > 1" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.avg_c < 400) or (v1.a > 1)) and (v1.a is not null) and (v1.b is not null))", + "attached_condition": "(v1.avg_c < 400 or v1.a > 1) and v1.a is not null and v1.b is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((avg_c < 400) or (t1.a > 1)))", + "having_condition": "max_c < 707 and (avg_c < 400 or t1.a > 1)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3805,7 +3805,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3822,11 +3822,11 @@ EXPLAIN "ref": ["v1.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v2.min_c < 200)", + "attached_condition": "v2.min_c < 200", "materialized": { "query_block": { "select_id": 3, - "having_condition": "((min_c < 707) and (min_c < 200))", + "having_condition": "min_c < 707 and min_c < 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3835,7 +3835,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -3852,11 +3852,11 @@ EXPLAIN "ref": ["v1.b"], "rows": 2, "filtered": 100, - "attached_condition": "((v3.avg_c > 170) or (v3.a < 5))", + "attached_condition": "v3.avg_c > 170 or v3.a < 5", "materialized": { "query_block": { "select_id": 4, - "having_condition": "((avg_c > 170) or (t1.a < 5))", + "having_condition": "avg_c > 170 or t1.a < 5", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3865,7 +3865,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a < 8)" + "attached_condition": "t1.a < 8" } } } @@ -3932,16 +3932,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a = 1) or (v1.max_c < 300)) and (v1.b > 25))" + "attached_condition": "(v1.a = 1 or v1.max_c < 300) and v1.b > 25" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.a = 1) or (v1.max_c < 300))", + "attached_condition": "v1.a = 1 or v1.max_c < 300", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and ((t1.a = 1) or (max_c < 300)))", + "having_condition": "max_c < 707 and (t1.a = 1 or max_c < 300)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -3950,7 +3950,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.b > 25)" + "attached_condition": "t1.b > 25" } } } @@ -3996,7 +3996,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -4008,11 +4008,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "((v1.max_c > 300) and (v1.b < 30))", + "attached_condition": "v1.max_c > 300 and v1.b < 30", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 707) and (max_c > 300))", + "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4021,7 +4021,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b < 30))" + "attached_condition": "t1.a > 5 and t1.b < 30" } } } @@ -4074,7 +4074,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.c > 800) and (t2.b is not null))" + "attached_condition": "t2.c > 800 and t2.b is not null" }, "table": { "table_name": "", @@ -4086,11 +4086,11 @@ EXPLAIN "ref": ["test.t2.b"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.a < 5)", + "attached_condition": "v1.a < 5", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4099,7 +4099,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a < 5)" + "attached_condition": "t1.a < 5" } } } @@ -4116,7 +4116,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.d > 800)" + "attached_condition": "t2.d > 800" }, "block-nl-join": { "table": { @@ -4124,7 +4124,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 100) and (v1.a > 7))" + "attached_condition": "v1.max_c > 100 and v1.a > 7" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -4132,7 +4132,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and (max_c > 100))", + "having_condition": "max_c < 707 and max_c > 100", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4141,7 +4141,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 7)" + "attached_condition": "t1.a > 7" } } } @@ -4217,7 +4217,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.b = 19)" + "attached_condition": "t2.b = 19" }, "block-nl-join": { "table": { @@ -4225,7 +4225,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.b = 19) and (v1.a < 5))" + "attached_condition": "v1.b = 19 and v1.a < 5" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -4233,7 +4233,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -4242,7 +4242,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b = 19) and (t1.a < 5))" + "attached_condition": "t1.b = 19 and t1.a < 5" } } } @@ -4266,16 +4266,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.max_c > 400) or (v1.avg_c > 270))" + "attached_condition": "v1.max_c > 400 or v1.avg_c > 270" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.max_c > 400) or (v1.avg_c > 270)) and (v1.a < t2.a))", + "attached_condition": "(v1.max_c > 400 or v1.avg_c > 270) and v1.a < t2.a", "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and ((max_c > 400) or (avg_c > 270)))", + "having_condition": "max_c < 707 and (max_c > 400 or avg_c > 270)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4378,16 +4378,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 1) or (v1.a = 6))" + "attached_condition": "v1.a = 1 or v1.a = 6" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a = t2.a) or (v1.b = t2.b)) and ((v1.a = 1) or (v1.a = 6)))", + "attached_condition": "(v1.a = t2.a or v1.b = t2.b) and (v1.a = 1 or v1.a = 6)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4396,7 +4396,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 1) or (t1.a = 6))" + "attached_condition": "t1.a = 1 or t1.a = 6" } } } @@ -4420,16 +4420,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v1.a > 3) and (v1.b > 27)) or (v1.max_c > 550))" + "attached_condition": "v1.a > 3 and v1.b > 27 or v1.max_c > 550" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(((v1.a > 3) and (v1.b > 27)) or (v1.max_c > 550))", + "attached_condition": "v1.a > 3 and v1.b > 27 or v1.max_c > 550", "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and (((t1.a > 3) and (t1.b > 27)) or (max_c > 550)))", + "having_condition": "max_c < 707 and (t1.a > 3 and t1.b > 27 or max_c > 550)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4526,7 +4526,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 1)" + "attached_condition": "t2.a = 1" }, "block-nl-join": { "table": { @@ -4534,16 +4534,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a = 1) and ((v1.max_c < 500) or (v1.avg_c > 500)))" + "attached_condition": "v1.a = 1 and (v1.max_c < 500 or v1.avg_c > 500)" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v1.max_c < 500) or (v1.avg_c > 500))", + "attached_condition": "v1.max_c < 500 or v1.avg_c > 500", "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and ((max_c < 500) or (avg_c > 500)))", + "having_condition": "max_c < 707 and (max_c < 500 or avg_c > 500)", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -4552,7 +4552,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 1)" + "attached_condition": "t1.a = 1" } } } @@ -4569,7 +4569,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a < 2)" + "attached_condition": "t2.a < 2" }, "block-nl-join": { "table": { @@ -4577,16 +4577,16 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v2.b > 10)" + "attached_condition": "v2.b > 10" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v2.a < t2.b) or (v2.max_c > 200))", + "attached_condition": "v2.a < t2.b or v2.max_c > 200", "materialized": { "query_block": { "select_id": 5, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4595,7 +4595,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b > 10))" + "attached_condition": "t1.a > 5 and t1.b > 10" } } } @@ -4612,7 +4612,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.c is not null)" + "attached_condition": "t2.c is not null" }, "table": { "table_name": "", @@ -4624,11 +4624,11 @@ EXPLAIN "ref": ["test.t2.c"], "rows": 2, "filtered": 100, - "attached_condition": "(v2.b < 10)", + "attached_condition": "v2.b < 10", "materialized": { "query_block": { "select_id": 6, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4637,7 +4637,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b < 10))" + "attached_condition": "t1.a > 5 and t1.b < 10" } } } @@ -4698,7 +4698,7 @@ EXPLAIN "access_type": "ALL", "rows": 40, "filtered": 100, - "attached_condition": "((v_union.a < 3) and (v_union.c > 100))" + "attached_condition": "v_union.a < 3 and v_union.c > 100" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -4712,7 +4712,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "((c > 109) and (c > 100))", + "having_condition": "c > 109 and c > 100", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4721,7 +4721,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and (t1.a < 3))" + "attached_condition": "t1.a < 10 and t1.a < 3" } } } @@ -4730,7 +4730,7 @@ EXPLAIN { "query_block": { "select_id": 3, - "having_condition": "((c < 300) and (c > 100))", + "having_condition": "c < 300 and c > 100", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4739,7 +4739,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.a < 3))" + "attached_condition": "t1.b > 10 and t1.a < 3" } } } @@ -4805,12 +4805,12 @@ EXPLAIN "access_type": "ALL", "rows": 40, "filtered": 100, - "attached_condition": "(((v_union.a < 2) or (v_union.c > 800)) and (v_union.b > 12))" + "attached_condition": "(v_union.a < 2 or v_union.c > 800) and v_union.b > 12" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v_union.a < 2) or (v_union.c > 800))", + "attached_condition": "v_union.a < 2 or v_union.c > 800", "materialized": { "query_block": { "union_result": { @@ -4820,7 +4820,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "((c > 109) and ((t1.a < 2) or (c > 800)))", + "having_condition": "c > 109 and (t1.a < 2 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4829,7 +4829,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and (t1.b > 12))" + "attached_condition": "t1.a < 10 and t1.b > 12" } } } @@ -4838,7 +4838,7 @@ EXPLAIN { "query_block": { "select_id": 3, - "having_condition": "((c < 300) and ((t1.a < 2) or (c > 800)))", + "having_condition": "c < 300 and (t1.a < 2 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -4847,7 +4847,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.b > 12))" + "attached_condition": "t1.b > 10 and t1.b > 12" } } } @@ -4893,7 +4893,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 1)" + "attached_condition": "t2.a = 1" }, "block-nl-join": { "table": { @@ -4901,7 +4901,7 @@ EXPLAIN "access_type": "ALL", "rows": 40, "filtered": 100, - "attached_condition": "((v_union.a = 1) and (v_union.c < 200))" + "attached_condition": "v_union.a = 1 and v_union.c < 200" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -4915,7 +4915,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "((c > 109) and (c < 200))", + "having_condition": "c > 109 and c < 200", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -4924,7 +4924,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 1)" + "attached_condition": "t1.a = 1" } } } @@ -4933,7 +4933,7 @@ EXPLAIN { "query_block": { "select_id": 3, - "having_condition": "((c < 300) and (c < 200))", + "having_condition": "c < 300 and c < 200", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -4942,7 +4942,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 1) and (t1.b > 10))" + "attached_condition": "t1.a = 1 and t1.b > 10" } } } @@ -4986,7 +4986,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(t.a is not null)" + "attached_condition": "t.a is not null" }, "table": { "table_name": "", @@ -4998,11 +4998,11 @@ EXPLAIN "ref": ["test.t.a"], "rows": 2, "filtered": 100, - "attached_condition": "((v.b = 'Vika') and (v.max_c > 2))", + "attached_condition": "v.b = 'Vika' and v.max_c > 2", "materialized": { "query_block": { "select_id": 2, - "having_condition": "((max_c < 9) and (max_c > 2))", + "having_condition": "max_c < 9 and max_c > 2", "filesort": { "sort_key": "t1_char.a", "temporary_table": { @@ -5011,7 +5011,7 @@ EXPLAIN "access_type": "ALL", "rows": 12, "filtered": 100, - "attached_condition": "(t1_char.b = 'Vika')" + "attached_condition": "t1_char.b = 'Vika'" } } } @@ -5059,7 +5059,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a = 1)" + "attached_condition": "t2.a = 1" }, "block-nl-join": { "table": { @@ -5067,7 +5067,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.a = 1)" + "attached_condition": "v1.a = 1" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -5075,7 +5075,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -5084,7 +5084,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 1)" + "attached_condition": "t1.a = 1" } } } @@ -5097,12 +5097,12 @@ EXPLAIN "access_type": "ALL", "rows": 40, "filtered": 100, - "attached_condition": "(v_union.a = 1)" + "attached_condition": "v_union.a = 1" }, "buffer_type": "incremental", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((v_union.c > 800) or (v1.max_c > 200))", + "attached_condition": "v_union.c > 800 or v1.max_c > 200", "materialized": { "query_block": { "union_result": { @@ -5112,7 +5112,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "(c > 109)", + "having_condition": "c > 109", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -5121,7 +5121,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a = 1)" + "attached_condition": "t1.a = 1" } } } @@ -5130,7 +5130,7 @@ EXPLAIN { "query_block": { "select_id": 3, - "having_condition": "(c < 300)", + "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -5139,7 +5139,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a = 1) and (t1.b > 10))" + "attached_condition": "t1.a = 1 and t1.b > 10" } } } @@ -5194,7 +5194,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(((t2.a = 6) or (t2.a = 8)) and (t2.a is not null))" + "attached_condition": "(t2.a = 6 or t2.a = 8) and t2.a is not null" }, "table": { "table_name": "", @@ -5206,7 +5206,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 6, "filtered": 100, - "attached_condition": "(v.c > 200)", + "attached_condition": "v.c > 200", "materialized": { "query_block": { "union_result": { @@ -5216,7 +5216,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "((c > 109) and (c > 200))", + "having_condition": "c > 109 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5225,7 +5225,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.a = 6) or (t1.a = 8)))" + "attached_condition": "t1.a < 10 and (t1.a = 6 or t1.a = 8)" } } } @@ -5234,7 +5234,7 @@ EXPLAIN { "query_block": { "select_id": 3, - "having_condition": "((c < 300) and (c > 200))", + "having_condition": "c < 300 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5243,7 +5243,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and ((t1.a = 6) or (t1.a = 8)))" + "attached_condition": "t1.b > 10 and (t1.a = 6 or t1.a = 8)" } } } @@ -5252,7 +5252,7 @@ EXPLAIN { "query_block": { "select_id": 4, - "having_condition": "((c < 707) and (c > 200))", + "having_condition": "c < 707 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5261,7 +5261,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.c > 300) and ((t1.a = 6) or (t1.a = 8)))" + "attached_condition": "t1.c > 300 and (t1.a = 6 or t1.a = 8)" } } } @@ -5361,7 +5361,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -5373,7 +5373,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 4, "filtered": 100, - "attached_condition": "(v.c > 6)", + "attached_condition": "v.c > 6", "materialized": { "query_block": { "union_result": { @@ -5388,7 +5388,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.a + 1) > 6))" + "attached_condition": "t1.a < 10 and t1.a + 1 > 6" } } }, @@ -5400,7 +5400,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.c > 100) and (t1.c > 6))" + "attached_condition": "t1.b > 10 and t1.c > 100 and t1.c > 6" } } } @@ -5478,7 +5478,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -5490,7 +5490,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 4, "filtered": 100, - "attached_condition": "((t2.a > 1) or (v.b < 20))", + "attached_condition": "t2.a > 1 or v.b < 20", "materialized": { "query_block": { "union_result": { @@ -5505,7 +5505,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.a > 1) or (t1.b < 20)))" + "attached_condition": "t1.a < 10 and (t1.a > 1 or t1.b < 20)" } } }, @@ -5517,7 +5517,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.c > 100) and ((t1.a > 1) or (t1.b < 20)))" + "attached_condition": "t1.b > 10 and t1.c > 100 and (t1.a > 1 or t1.b < 20)" } } } @@ -5563,7 +5563,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -5575,7 +5575,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 4, "filtered": 100, - "attached_condition": "(((v.b = 19) or (v.b = 21)) and ((v.c < 3) or (v.c > 600)))", + "attached_condition": "(v.b = 19 or v.b = 21) and (v.c < 3 or v.c > 600)", "materialized": { "query_block": { "union_result": { @@ -5590,7 +5590,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.b = 19) or (t1.b = 21)) and (((t1.a + 1) < 3) or ((t1.a + 1) > 600)))" + "attached_condition": "t1.a < 10 and (t1.b = 19 or t1.b = 21) and (t1.a + 1 < 3 or t1.a + 1 > 600)" } } }, @@ -5602,7 +5602,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.c > 100) and ((t1.b = 19) or (t1.b = 21)) and ((t1.c < 3) or (t1.c > 600)))" + "attached_condition": "t1.b > 10 and t1.c > 100 and (t1.b = 19 or t1.b = 21) and (t1.c < 3 or t1.c > 600)" } } } @@ -5645,7 +5645,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -5657,7 +5657,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 4, "filtered": 100, - "attached_condition": "(v.b < 20)", + "attached_condition": "v.b < 20", "materialized": { "query_block": { "union_result": { @@ -5667,7 +5667,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "(c > 109)", + "having_condition": "c > 109", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5676,7 +5676,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and (t1.b < 20))" + "attached_condition": "t1.a < 10 and t1.b < 20" } } } @@ -5690,7 +5690,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and (t1.b < 20))" + "attached_condition": "t1.b > 10 and t1.b < 20" } } } @@ -5752,7 +5752,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "(t2.a is not null)" + "attached_condition": "t2.a is not null" }, "table": { "table_name": "", @@ -5764,7 +5764,7 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 4, "filtered": 100, - "attached_condition": "(((t2.a < 3) or (v.b < 40)) and (v.c > 500))", + "attached_condition": "(t2.a < 3 or v.b < 40) and v.c > 500", "materialized": { "query_block": { "union_result": { @@ -5774,7 +5774,7 @@ EXPLAIN { "query_block": { "select_id": 2, - "having_condition": "((c > 109) and (c > 500))", + "having_condition": "c > 109 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5783,7 +5783,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 10) and ((t1.a < 3) or (t1.b < 40)))" + "attached_condition": "t1.a < 10 and (t1.a < 3 or t1.b < 40)" } } } @@ -5797,7 +5797,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b > 10) and ((t1.a < 3) or (t1.b < 40)) and ((t1.c + 100) > 500))" + "attached_condition": "t1.b > 10 and (t1.a < 3 or t1.b < 40) and t1.c + 100 > 500" } } } @@ -5861,7 +5861,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v4.a < 13)", + "attached_condition": "v4.a < 13", "materialized": { "query_block": { "select_id": 2, @@ -5873,11 +5873,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and (v1.a < 13))", + "attached_condition": "v1.a < 15 and v1.a < 13", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5886,7 +5886,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and (t1.a < 13))" + "attached_condition": "t1.a < 15 and t1.a < 13" } } } @@ -5904,7 +5904,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a > 5) and (v1.b > 12))" + "attached_condition": "v1.a > 5 and v1.b > 12" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -5912,7 +5912,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5921,7 +5921,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b > 12))" + "attached_condition": "t1.a > 5 and t1.b > 12" } } } @@ -5963,7 +5963,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -5986,11 +5986,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(v1.a < 15)", + "attached_condition": "v1.a < 15", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5999,7 +5999,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a < 15)" + "attached_condition": "t1.a < 15" } } } @@ -6021,11 +6021,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.b > 30)", + "attached_condition": "v1.b > 30", "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6034,7 +6034,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.b > 30)" + "attached_condition": "t1.b > 30" } } } @@ -6078,7 +6078,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.a > 1) and (t2.a is not null) and (t2.a is not null))" + "attached_condition": "t2.a > 1 and t2.a is not null and t2.a is not null" }, "table": { "table_name": "", @@ -6090,11 +6090,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v4.min_c > 100)", + "attached_condition": "v4.min_c > 100", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(min_c > 100)", + "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6103,11 +6103,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and (v1.a > 1))", + "attached_condition": "v1.a < 15 and v1.a > 1", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6116,7 +6116,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and (t1.a > 1))" + "attached_condition": "t1.a < 15 and t1.a > 1" } } } @@ -6138,11 +6138,11 @@ EXPLAIN "ref": ["test.t2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.b < 30)", + "attached_condition": "v1.b < 30", "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6151,7 +6151,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 1) and (t1.b < 30))" + "attached_condition": "t1.a > 1 and t1.b < 30" } } } @@ -6287,12 +6287,12 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v4.b > 10) and (v4.a > 1)) or (v4.b < 20))" + "attached_condition": "v4.b > 10 and v4.a > 1 or v4.b < 20" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((((v4.b > 10) and (v4.a > 1)) or (v4.b < 20)) and (v4.a is not null))", + "attached_condition": "(v4.b > 10 and v4.a > 1 or v4.b < 20) and v4.a is not null", "materialized": { "query_block": { "select_id": 2, @@ -6304,11 +6304,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and (((v1.b > 10) and (v1.a > 1)) or (v1.b < 20)))", + "attached_condition": "v1.a < 15 and (v1.b > 10 and v1.a > 1 or v1.b < 20)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6317,7 +6317,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and (((t1.b > 10) and (t1.a > 1)) or (t1.b < 20)))" + "attached_condition": "t1.a < 15 and (t1.b > 10 and t1.a > 1 or t1.b < 20)" } } } @@ -6339,11 +6339,11 @@ EXPLAIN "ref": ["v4.a"], "rows": 2, "filtered": 100, - "attached_condition": "(v1.max_c > 200)", + "attached_condition": "v1.max_c > 200", "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and (max_c > 200))", + "having_condition": "max_c < 707 and max_c > 200", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6389,11 +6389,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(((v4.a > 12) and (v4.min_c < 300) and (v4.b > 13)) or (v4.a < 1))", + "attached_condition": "v4.a > 12 and v4.min_c < 300 and v4.b > 13 or v4.a < 1", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(((v1.a > 12) and (min_c < 300) and (v1.b > 13)) or (v1.a < 1))", + "having_condition": "v1.a > 12 and min_c < 300 and v1.b > 13 or v1.a < 1", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6402,11 +6402,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and (((v1.a > 12) and (v1.b > 13)) or (v1.a < 1)))", + "attached_condition": "v1.a < 15 and (v1.a > 12 and v1.b > 13 or v1.a < 1)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6415,7 +6415,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and (((t1.a > 12) and (t1.b > 13)) or (t1.a < 1)))" + "attached_condition": "t1.a < 15 and (t1.a > 12 and t1.b > 13 or t1.a < 1)" } } } @@ -6440,7 +6440,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6449,7 +6449,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -6488,11 +6488,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v4.b = v4.a) and (v4.min_c < 100) and (v4.a is not null))", + "attached_condition": "v4.b = v4.a and v4.min_c < 100 and v4.a is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(min_c < 100)", + "having_condition": "min_c < 100", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6501,11 +6501,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.b = v1.a) and (v1.a < 15))", + "attached_condition": "v1.b = v1.a and v1.a < 15", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6514,7 +6514,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b = t1.a) and (t1.a < 15))" + "attached_condition": "t1.b = t1.a and t1.a < 15" } } } @@ -6539,7 +6539,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6548,7 +6548,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -6587,7 +6587,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v4.b = v4.a) and (v4.a < 30) and (v4.a is not null))", + "attached_condition": "v4.b = v4.a and v4.a < 30 and v4.a is not null", "materialized": { "query_block": { "select_id": 2, @@ -6599,11 +6599,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.b = v1.a) and (v1.a < 15) and (v1.a < 30))", + "attached_condition": "v1.b = v1.a and v1.a < 15 and v1.a < 30", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6612,7 +6612,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b = t1.a) and (t1.a < 15) and (t1.a < 30))" + "attached_condition": "t1.b = t1.a and t1.a < 15 and t1.a < 30" } } } @@ -6637,7 +6637,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6646,7 +6646,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and (t1.b < 30))" + "attached_condition": "t1.a > 5 and t1.b < 30" } } } @@ -6685,7 +6685,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v4.b = v4.a) and ((v4.a < 30) or (v4.a > 2)) and (v4.a is not null))", + "attached_condition": "v4.b = v4.a and (v4.a < 30 or v4.a > 2) and v4.a is not null", "materialized": { "query_block": { "select_id": 2, @@ -6697,11 +6697,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.b = v1.a) and (v1.a < 15) and ((v1.a < 30) or (v1.a > 2)))", + "attached_condition": "v1.b = v1.a and v1.a < 15 and (v1.a < 30 or v1.a > 2)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6710,7 +6710,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.b = t1.a) and (t1.a < 15) and ((t1.a < 30) or (t1.a > 2)))" + "attached_condition": "t1.b = t1.a and t1.a < 15 and (t1.a < 30 or t1.a > 2)" } } } @@ -6735,7 +6735,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6744,7 +6744,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a > 5) and ((t1.b < 30) or (t1.b > 2)))" + "attached_condition": "t1.a > 5 and (t1.b < 30 or t1.b > 2)" } } } @@ -6791,11 +6791,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((((v4.a < 12) and (v4.b > 13)) or (v4.a > 10)) and (v4.min_c > 100) and (v4.min_c is not null))", + "attached_condition": "(v4.a < 12 and v4.b > 13 or v4.a > 10) and v4.min_c > 100 and v4.min_c is not null", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(min_c > 100)", + "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6804,11 +6804,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and (((v1.a < 12) and (v1.b > 13)) or (v1.a > 10)))", + "attached_condition": "v1.a < 15 and (v1.a < 12 and v1.b > 13 or v1.a > 10)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6817,7 +6817,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and (((t1.a < 12) and (t1.b > 13)) or (t1.a > 10)))" + "attached_condition": "t1.a < 15 and (t1.a < 12 and t1.b > 13 or t1.a > 10)" } } } @@ -6842,7 +6842,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "((max_c < 707) and (max_c > 100))", + "having_condition": "max_c < 707 and max_c > 100", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6851,7 +6851,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -6897,7 +6897,7 @@ EXPLAIN "access_type": "ALL", "rows": 9, "filtered": 100, - "attached_condition": "((t2.c > 100) and (t2.c is not null))" + "attached_condition": "t2.c > 100 and t2.c is not null" }, "table": { "table_name": "", @@ -6909,11 +6909,11 @@ EXPLAIN "ref": ["test.t2.c"], "rows": 2, "filtered": 100, - "attached_condition": "(((v4.a < 12) and (t2.b > 13)) or (v4.a > 10))", + "attached_condition": "v4.a < 12 and t2.b > 13 or v4.a > 10", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(min_c > 100)", + "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6922,11 +6922,11 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((v1.a < 15) and ((v1.a < 12) or (v1.a > 10)))", + "attached_condition": "v1.a < 15 and (v1.a < 12 or v1.a > 10)", "materialized": { "query_block": { "select_id": 3, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6935,7 +6935,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "((t1.a < 15) and ((t1.a < 12) or (t1.a > 10)))" + "attached_condition": "t1.a < 15 and (t1.a < 12 or t1.a > 10)" } } } @@ -6960,7 +6960,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, - "having_condition": "(max_c < 707)", + "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -6969,7 +6969,7 @@ EXPLAIN "access_type": "ALL", "rows": 20, "filtered": 100, - "attached_condition": "(t1.a > 5)" + "attached_condition": "t1.a > 5" } } } @@ -6996,7 +6996,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 Using where 3 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 select `sq1`.`f` AS `f` from (select min(`test`.`t1`.`i`) AS `f` from `test`.`t1` having (`f` = 8)) `sq1` where (`sq1`.`f` = 8) +Note 1003 select `sq1`.`f` AS `f` from (select min(`test`.`t1`.`i`) AS `f` from `test`.`t1` having `f` = 8) `sq1` where `sq1`.`f` = 8 SELECT * FROM ( SELECT * FROM ( SELECT MIN(i) as f FROM t1 ) sq1 ) AS sq2 WHERE f = 8; @@ -7118,7 +7118,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "const_condition": "(0 or (2,(subquery#3)))", + "const_condition": "0 or (2,(subquery#3))", "table": { "table_name": "t1", "access_type": "system", @@ -7130,7 +7130,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t2.b = 2)", + "attached_condition": "t2.b = 2", "first_match": "t1" }, "subqueries": [ @@ -7155,7 +7155,7 @@ EXPLAIN "access_type": "ALL", "rows": 4, "filtered": 100, - "attached_condition": "(t3.c = 2)" + "attached_condition": "t3.c = 2" } } } @@ -7202,7 +7202,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "const_condition": "(0 or (2,(subquery#3)))", + "const_condition": "0 or (2,(subquery#3))", "table": { "table_name": "t1", "access_type": "system", @@ -7214,7 +7214,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t2.b = 2)", + "attached_condition": "t2.b = 2", "first_match": "t1" }, "subqueries": [ @@ -7292,7 +7292,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(v2.b = 1)", + "attached_condition": "v2.b = 1", "materialized": { "query_block": { "select_id": 4, @@ -7301,7 +7301,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t2.b = 1)" + "attached_condition": "t2.b = 1" } } } @@ -7350,7 +7350,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 2, "filtered": 100, - "attached_condition": "(trigcond(isnull(v2.b)) and trigcond(trigcond((t1.a is not null))))", + "attached_condition": "trigcond(v2.b is null) and trigcond(trigcond(t1.a is not null))", "materialized": { "query_block": { "select_id": 2, @@ -7384,7 +7384,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((v1.i <= 3))", + "attached_condition": "(v1.i <= 3)", "materialized": { "query_block": { "select_id": 3, @@ -7393,7 +7393,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((t1.i <= 3))" + "attached_condition": "(t1.i <= 3)" } } } @@ -7437,7 +7437,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((t1.b,(subquery#2)) or (t1.b = 100))" + "attached_condition": "(t1.b,(subquery#2)) or t1.b = 100" }, "subqueries": [ { @@ -7487,7 +7487,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((t1.b,(subquery#3)) or (t1.b = 100))" + "attached_condition": "(t1.b,(subquery#3)) or t1.b = 100" }, "subqueries": [ { @@ -7555,7 +7555,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(v1.a = 50)", + "attached_condition": "v1.a = 50", "materialized": { "query_block": { "select_id": 3, @@ -7564,7 +7564,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t1.a = 50)" + "attached_condition": "t1.a = 50" } } } @@ -7601,7 +7601,7 @@ EXPLAIN "access_type": "ALL", "rows": 5, "filtered": 100, - "attached_condition": "(v2.s < 50)", + "attached_condition": "v2.s < 50", "materialized": { "query_block": { "select_id": 3, @@ -7668,7 +7668,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(v1.b = 2)", + "attached_condition": "v1.b = 2", "materialized": { "query_block": { "select_id": 3, @@ -7677,7 +7677,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t1.b = 2)" + "attached_condition": "t1.b = 2" } } } @@ -7725,7 +7725,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(v1.f = 2)", + "attached_condition": "v1.f = 2", "materialized": { "query_block": { "select_id": 3, @@ -7734,7 +7734,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t.f = 2)" + "attached_condition": "t.f = 2" } } } @@ -7745,7 +7745,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(v2.pk > 2)" + "attached_condition": "v2.pk > 2" }, "buffer_type": "flat", "buffer_size": "256Kb", diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 52df8bf0012..71e9c8ca4dc 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -36,7 +36,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`f2` = `test`.`t1`.`f1`) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f2` = `test`.`t1`.`f1` select * from (select * from t1 join t2 on f1=f2) tt; f1 f11 f2 f22 1 1 1 1 @@ -48,7 +48,7 @@ select * from (select * from t1 where f1 in (2,3)) tt where f11=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f11` = 2) and (`test`.`t1`.`f1` in (2,3))) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f11` = 2 and `test`.`t1`.`f1` in (2,3) select * from (select * from t1 where f1 in (2,3)) tt where f11=2; f1 f11 2 2 @@ -60,7 +60,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where ((`test`.`t1`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f1` in (1,2)) and (`test`.`t1`.`f1` in (2,3))) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where `test`.`t1`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f1` in (1,2) and `test`.`t1`.`f1` in (2,3) select * from (select * from t1 where f1 in (2,3)) tt join (select * from t1 where f1 in (1,2)) aa on tt.f1=aa.f1; f1 f11 f1 f11 @@ -71,7 +71,7 @@ select * from (select * from t1 where f1 in (2,3)) tt where f11=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f11` = 2) and (`test`.`t1`.`f1` in (2,3))) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f11` = 2 and `test`.`t1`.`f1` in (2,3) show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 @@ -128,7 +128,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`f2` = `test`.`t1`.`f1`) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f2` = `test`.`t1`.`f1` select * from v2; f1 f11 f2 f22 1 1 1 1 @@ -139,7 +139,7 @@ explain extended select * from v3 where f11 in (1,3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f11` in (1,3)) and (`test`.`t1`.`f1` in (2,3))) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f11` in (1,3) and `test`.`t1`.`f1` in (2,3) select * from v3 where f11 in (1,3); f1 f11 3 3 @@ -150,7 +150,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`f2` = `test`.`t1`.`f1`) and (`test`.`t1`.`f1` in (2,3)) and (`test`.`t1`.`f1` in (2,3))) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f2` = `test`.`t1`.`f1` and `test`.`t1`.`f1` in (2,3) and `test`.`t1`.`f1` in (2,3) select * from v3 join v4 on f1=f2; f1 f11 f2 f22 3 3 3 3 @@ -160,7 +160,7 @@ explain extended select * from v4 where f2 in (1,3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where ((`test`.`t2`.`f2` in (1,3)) and (`test`.`t2`.`f2` in (2,3))) +Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where `test`.`t2`.`f2` in (1,3) and `test`.`t2`.`f2` in (2,3) show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 @@ -216,7 +216,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t1.f1 2 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 11 100.00 Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`tt`.`f2` AS `f2`,`tt`.`f22` AS `f22` from `test`.`t1` join (select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` group by `test`.`t2`.`f2`) `tt` where (`tt`.`f2` = `test`.`t1`.`f1`) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`tt`.`f2` AS `f2`,`tt`.`f22` AS `f22` from `test`.`t1` join (select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` group by `test`.`t2`.`f2`) `tt` where `tt`.`f2` = `test`.`t1`.`f1` select * from t1 join (select * from t2 group by f2) tt on f1=f2; f1 f11 f2 f22 1 1 1 1 @@ -290,7 +290,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t1.f1 2 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 11 100.00 Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`v2`.`f2` AS `f2`,`v2`.`f22` AS `f22` from `test`.`t1` join `test`.`v2` where (`v2`.`f2` = `test`.`t1`.`f1`) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`v2`.`f2` AS `f2`,`v2`.`f22` AS `f22` from `test`.`t1` join `test`.`v2` where `v2`.`f2` = `test`.`t1`.`f1` select * from t1 join v2 on f1=f2; f1 f11 f2 f22 1 1 1 1 @@ -307,7 +307,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 2 DERIVED t11 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`v31`.`f1` AS `f1`,`v31`.`f11` AS `f11`,`v3`.`f1` AS `f1`,`v3`.`f11` AS `f11` from `test`.`t1` join `test`.`v3` `v31` join `test`.`v3` where ((`v31`.`f1` = `test`.`t1`.`f1`) and (`v3`.`f1` = `test`.`t1`.`f1`)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`v31`.`f1` AS `f1`,`v31`.`f11` AS `f11`,`v3`.`f1` AS `f1`,`v3`.`f11` AS `f11` from `test`.`t1` join `test`.`v3` `v31` join `test`.`v3` where `v31`.`f1` = `test`.`t1`.`f1` and `v3`.`f1` = `test`.`t1`.`f1` flush status; select * from t1,v3 as v31,v3 where t1.f1=v31.f1 and t1.f1=v3.f1; f1 f11 f1 f11 f1 f11 @@ -374,7 +374,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t2.f2 2 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `v1`.`f1` AS `f1`,`v1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`v1` join `test`.`t2` where ((`v1`.`f1` = `test`.`t2`.`f2`) and (`test`.`t2`.`f2` in (2,3))) +Note 1003 select `v1`.`f1` AS `f1`,`v1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`v1` join `test`.`t2` where `v1`.`f1` = `test`.`t2`.`f2` and `test`.`t2`.`f2` in (2,3) explain format=json select * from v1 join v4 on f1=f2; EXPLAIN { @@ -385,7 +385,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t2.f2 in (2,3)) and (t2.f2 is not null))" + "attached_condition": "t2.f2 in (2,3) and t2.f2 is not null" }, "table": { "table_name": "", @@ -408,7 +408,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(t1.f1 in (2,3))" + "attached_condition": "t1.f1 in (2,3)" } } } @@ -427,7 +427,7 @@ explain extended select * from (select * from id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` > 2) and (`test`.`t1`.`f1` < 7)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 select * from (select * from (select * from t1 where f1 < 7) tt where f1 > 2) zz; f1 f11 @@ -440,7 +440,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 11 100.00 Using where 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` < 7) and (`test`.`t1`.`f1` > 2)) group by `test`.`t1`.`f1`) `tt` where (`tt`.`f1` > 2) +Note 1003 select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) zz; f1 f11 @@ -453,7 +453,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 11 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `zz`.`f1` AS `f1`,`zz`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` > 2) and (`test`.`t1`.`f1` < 7)) group by `test`.`t1`.`f1`) `zz` +Note 1003 select `zz`.`f1` AS `f1`,`zz`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 group by `test`.`t1`.`f1`) `zz` select * from (select * from (select * from t1 where f1 < 7) tt where f1 > 2 group by f1) zz; f1 f11 @@ -467,7 +467,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DERIVED ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `zz`.`f1` AS `f1`,`zz`.`f11` AS `f11` from (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` < 7) and (`test`.`t1`.`f1` > 2)) group by `test`.`t1`.`f1`) `tt` where (`tt`.`f1` > 2) group by `tt`.`f1`) `zz` +Note 1003 select `zz`.`f1` AS `f1`,`zz`.`f11` AS `f11` from (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `zz` explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz; EXPLAIN @@ -490,7 +490,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(tt.f1 > 2)", + "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 3, @@ -502,7 +502,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t1.f1 < 7) and (t1.f1 > 2))" + "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } } } @@ -533,7 +533,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11`,`tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` < 7) and (`test`.`t1`.`f1` > 2) and (`test`.`t1`.`f1` > 2)) group by `test`.`t1`.`f1`) `tt` join (select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where ((`t1`.`f1` < 7) and (`t1`.`f1` > 2) and (`t1`.`f1` > 2)) group by `t1`.`f1`) `tt` where ((`tt`.`f1` = `tt`.`f1`) and (`tt`.`f1` > 2) and (`tt`.`f1` > 2)) +Note 1003 select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11`,`tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` join (select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where `t1`.`f1` < 7 and `t1`.`f1` > 2 and `t1`.`f1` > 2 group by `t1`.`f1`) `tt` where `tt`.`f1` = `tt`.`f1` and `tt`.`f1` > 2 and `tt`.`f1` > 2 explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) x join @@ -548,7 +548,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((tt.f1 > 2) and (tt.f1 > 2) and (tt.f1 is not null))", + "attached_condition": "tt.f1 > 2 and tt.f1 > 2 and tt.f1 is not null", "materialized": { "query_block": { "select_id": 3, @@ -560,7 +560,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t1.f1 < 7) and (t1.f1 > 2) and (t1.f1 > 2))" + "attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2" } } } @@ -588,7 +588,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t1.f1 < 7) and (t1.f1 > 2) and (t1.f1 > 2))" + "attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2" } } } @@ -630,7 +630,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where ((`t1`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f1` > 2) and (`test`.`t1`.`f1` < 7) and (`test`.`t1`.`f1` > 2) and (`test`.`t1`.`f1` < 7)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where `t1`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 select * from (select * from (select * from t1 where f1 < 7 ) tt where f1 > 2 ) x @@ -658,7 +658,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DERIVED ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `x`.`f1` AS `f1`,`x`.`f11` AS `f11`,`z`.`f1` AS `f1`,`z`.`f11` AS `f11` from (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where ((`test`.`t1`.`f1` < 7) and (`test`.`t1`.`f1` > 2)) group by `test`.`t1`.`f1`) `tt` where (`tt`.`f1` > 2) group by `tt`.`f1`) `x` join (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where ((`t1`.`f1` < 7) and (`t1`.`f1` > 2)) group by `t1`.`f1`) `tt` where (`tt`.`f1` > 2) group by `tt`.`f1`) `z` where (`z`.`f1` = `x`.`f1`) +Note 1003 select `x`.`f1` AS `f1`,`x`.`f11` AS `f11`,`z`.`f1` AS `f1`,`z`.`f11` AS `f11` from (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `x` join (select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where `t1`.`f1` < 7 and `t1`.`f1` > 2 group by `t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `z` where `z`.`f1` = `x`.`f1` explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) x @@ -675,7 +675,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(x.f1 is not null)", + "attached_condition": "x.f1 is not null", "materialized": { "query_block": { "select_id": 2, @@ -687,7 +687,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(tt.f1 > 2)", + "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 3, @@ -699,7 +699,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t1.f1 < 7) and (t1.f1 > 2))" + "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } } } @@ -732,7 +732,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(tt.f1 > 2)", + "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 5, @@ -744,7 +744,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t1.f1 < 7) and (t1.f1 > 2))" + "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } } } @@ -775,7 +775,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 11 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `tt`.`f2` AS `f2`,`tt`.`f22` AS `f22` from (select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where (`test`.`t2`.`f2` in (2,3)) group by 1) `tt` +Note 1003 select `tt`.`f2` AS `f2`,`tt`.`f22` AS `f22` from (select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where `test`.`t2`.`f2` in (2,3) group by 1) `tt` select * from (select * from v4 group by 1) tt; f2 f22 2 2 @@ -787,7 +787,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 11 100.00 Using where 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `v1`.`f1` AS `f1`,`v1`.`f11` AS `f11` from `test`.`v1` where (`v1`.`f1` < 7) +Note 1003 select `v1`.`f1` AS `f1`,`v1`.`f11` AS `f11` from `test`.`v1` where `v1`.`f1` < 7 explain format=json select * from ( select * from v1 where f1 < 7) tt; EXPLAIN @@ -799,7 +799,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(v1.f1 < 7)", + "attached_condition": "v1.f1 < 7", "materialized": { "query_block": { "select_id": 3, @@ -811,7 +811,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(t1.f1 < 7)" + "attached_condition": "t1.f1 < 7" } } } @@ -832,7 +832,7 @@ explain extended select * from (select * from v6) tt; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where ((`test`.`t2`.`f2` < 7) and (`test`.`t2`.`f2` in (2,3))) +Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` where `test`.`t2`.`f2` < 7 and `test`.`t2`.`f2` in (2,3) select * from (select * from v6) tt; f2 f22 3 3 @@ -866,7 +866,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t2.f2 2 100.00 5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22`,`v1`.`f1` AS `f1`,`v1`.`f11` AS `f11` from `test`.`t2` join `test`.`v1` where ((`v1`.`f1` = `test`.`t2`.`f2`) and (`test`.`t2`.`f2` < 7) and (`test`.`t2`.`f2` in (2,3))) +Note 1003 select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22`,`v1`.`f1` AS `f1`,`v1`.`f11` AS `f11` from `test`.`t2` join `test`.`v1` where `v1`.`f1` = `test`.`t2`.`f2` and `test`.`t2`.`f2` < 7 and `test`.`t2`.`f2` in (2,3) explain format=json select * from v6 join v7 on f2=f1; EXPLAIN { @@ -877,7 +877,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "((t2.f2 < 7) and (t2.f2 in (2,3)) and (t2.f2 is not null))" + "attached_condition": "t2.f2 < 7 and t2.f2 in (2,3) and t2.f2 is not null" }, "table": { "table_name": "", @@ -900,7 +900,7 @@ EXPLAIN "access_type": "ALL", "rows": 11, "filtered": 100, - "attached_condition": "(t1.f1 in (2,3))" + "attached_condition": "t1.f1 in (2,3)" } } } @@ -1050,7 +1050,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` `t` join `test`.`t3`) on(((`test`.`t`.`a` >= 1) and (`test`.`t3`.`b` > 5))) where 1 group by `test`.`t`.`a` +Note 1003 select `test`.`t`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` `t` join `test`.`t3`) on(`test`.`t`.`a` >= 1 and `test`.`t3`.`b` > 5) where 1 group by `test`.`t`.`a` SELECT t.a FROM t1 LEFT JOIN (t2 t JOIN t3 ON t3.b > 5) ON t.a >= 1 GROUP BY t.a; @@ -1065,7 +1065,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`a` >= 1) and (`test`.`t3`.`b` > 5))) where 1 group by `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`a` >= 1 and `test`.`t3`.`b` > 5) where 1 group by `test`.`t2`.`a` SELECT t.a FROM t1 LEFT JOIN (( SELECT * FROM t2 ) t JOIN t3 ON t3.b > 5) ON t.a >= 1 GROUP BY t.a; @@ -1081,7 +1081,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`a` >= 1) and (`test`.`t3`.`b` > 5))) where 1 group by `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`a` >= 1 and `test`.`t3`.`b` > 5) where 1 group by `test`.`t2`.`a` SELECT t.a FROM t1 LEFT JOIN (v1 t JOIN t3 ON t3.b > 5) ON t.a >= 1 GROUP BY t.a; @@ -1143,7 +1143,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 3 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select `v1`.`a` from `test`.`v1` join `test`.`t2` where ((`test`.`t2`.`a` = `v1`.`b`) and ((`test`.`t3`.`a`) = `v1`.`a`))))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select `v1`.`a` from `test`.`v1` join `test`.`t2` where `test`.`t2`.`a` = `v1`.`b` and (`test`.`t3`.`a`) = `v1`.`a`))) SELECT * FROM t3 WHERE t3.a IN (SELECT v1.a FROM v1, t2 WHERE t2.a = v1.b); a @@ -1233,7 +1233,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 0 0.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t3`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t3` left join (`test`.`t2` join `test`.`t1`) on((`test`.`t3`.`a` <> 0)) where ((`test`.`t1`.`a` = `test`.`t1`.`a`) or (`test`.`t3`.`b` <> 0)) +Note 1003 select `test`.`t3`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t3` left join (`test`.`t2` join `test`.`t1`) on(`test`.`t3`.`a` <> 0) where `test`.`t1`.`a` = `test`.`t1`.`a` or `test`.`t3`.`b` <> 0 DROP VIEW v1; DROP TABLE t1,t2,t3; # @@ -1624,7 +1624,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 't.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (1,<`test`.`t1`.`a`>(exists(select 28 from `test`.`t3` where ('j' < `test`.`t1`.`a`)))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (1,<`test`.`t1`.`a`>(exists(select 28 from `test`.`t3` where 'j' < `test`.`t1`.`a`))) SELECT * FROM (SELECT * FROM t1) AS t WHERE EXISTS (SELECT t2.a FROM t3 RIGHT JOIN t2 ON (t3.a = t2.a) WHERE t2.b < t.a); @@ -1663,7 +1663,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select straight_join `test`.`s2`.`a` AS `a`,`test`.`s3`.`a` AS `a`,`test`.`s3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t5`.`d` AS `d` from `test`.`t2` `s2` join `test`.`t3` `s3` left join (`test`.`t4` left join `test`.`t3` on((`test`.`t4`.`a` <> 0))) on((`test`.`s3`.`a` <> 0)) join `test`.`t5` where ((`test`.`t5`.`d` = 0) and (`test`.`s3`.`c` <> 0) and (`test`.`s2`.`a` <> 0)) +Note 1003 select straight_join `test`.`s2`.`a` AS `a`,`test`.`s3`.`a` AS `a`,`test`.`s3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t5`.`d` AS `d` from `test`.`t2` `s2` join `test`.`t3` `s3` left join (`test`.`t4` left join `test`.`t3` on(`test`.`t4`.`a` <> 0)) on(`test`.`s3`.`a` <> 0) join `test`.`t5` where `test`.`t5`.`d` = 0 and `test`.`s3`.`c` <> 0 and `test`.`s2`.`a` <> 0 SELECT STRAIGHT_JOIN * FROM ( t2 AS s2 JOIN @@ -1690,7 +1690,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ALL NULL NULL NULL NULL 0 0.00 Using where 1 SIMPLE s3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select straight_join `test`.`s2`.`a` AS `a`,`test`.`t5`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`s3`.`a` AS `a`,`test`.`s3`.`c` AS `c` from `test`.`t2` `s2` join `test`.`t5` join `test`.`t3` left join (`test`.`t4` left join `test`.`t3` `s3` on((`test`.`t4`.`a` <> 0))) on((`test`.`t3`.`a` <> 0)) where ((`test`.`t5`.`d` = 0) and (`test`.`s2`.`a` <> 0) and (`test`.`t3`.`c` <> 0)) +Note 1003 select straight_join `test`.`s2`.`a` AS `a`,`test`.`t5`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`s3`.`a` AS `a`,`test`.`s3`.`c` AS `c` from `test`.`t2` `s2` join `test`.`t5` join `test`.`t3` left join (`test`.`t4` left join `test`.`t3` `s3` on(`test`.`t4`.`a` <> 0)) on(`test`.`t3`.`a` <> 0) where `test`.`t5`.`d` = 0 and `test`.`s2`.`a` <> 0 and `test`.`t3`.`c` <> 0 SELECT STRAIGHT_JOIN * FROM t2 AS s2 , t5, (t3 LEFT JOIN (t4 LEFT JOIN t3 AS s3 ON t4.a != 0) ON t3.a != 0) @@ -1712,7 +1712,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ALL NULL NULL NULL NULL 0 0.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select straight_join `test`.`t2`.`a` AS `a`,`test`.`t5`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c` from `test`.`t2` join `test`.`t5` join `test`.`t3` left join (`test`.`t4` left join (`test`.`t3`) on((`test`.`t4`.`a` <> 0))) on((`test`.`t3`.`a` <> 0)) where ((`test`.`t5`.`d` = 0) and (`test`.`t2`.`a` <> 0) and (`test`.`t3`.`c` <> 0)) +Note 1003 select straight_join `test`.`t2`.`a` AS `a`,`test`.`t5`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c` from `test`.`t2` join `test`.`t5` join `test`.`t3` left join (`test`.`t4` left join (`test`.`t3`) on(`test`.`t4`.`a` <> 0)) on(`test`.`t3`.`a` <> 0) where `test`.`t5`.`d` = 0 and `test`.`t2`.`a` <> 0 and `test`.`t3`.`c` <> 0 SELECT STRAIGHT_JOIN * FROM v2 AS s2 , t5, (t3 LEFT JOIN (t4 LEFT JOIN v3 AS s3 ON t4.a != 0) ON t3.a != 0) @@ -2018,7 +2018,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`b` <> 0)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0 SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b AND t.c = t1.a; @@ -2033,7 +2033,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`b` <> 0)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0 SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b <> 0 AND t.c = t1.a; @@ -2049,7 +2049,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t2`.`a`)) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`b` <> 0)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t2`.`a`) where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0 SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b AND t.c = t1.a; @@ -2064,7 +2064,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t2`.`a`)) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`b` <> 0)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t2`.`a`) where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0 SELECT t.b, t.c, t1.a FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t WHERE t.b <> 0 AND t.c = t1.a; @@ -2517,7 +2517,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t2.c2 2 100.00 Using where 2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where ((`v1`.`c1` = `test`.`t2`.`c1`) and (`v1`.`c2` = `test`.`t2`.`c2`)) +Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where `v1`.`c1` = `test`.`t2`.`c1` and `v1`.`c2` = `test`.`t2`.`c2` SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2; c1 c2 c 3 @@ -2530,7 +2530,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ref key0 key0 5 test.t2.c2 2 100.00 Using where 2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from (select `test`.`t1`.`c1` AS `g`,max(`test`.`t1`.`c2`) AS `m` from `test`.`t1` group by `test`.`t1`.`c1`) `t` join `test`.`t2` where ((`t`.`g` = `test`.`t2`.`c1`) and (`t`.`m` = `test`.`t2`.`c2`)) +Note 1003 select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from (select `test`.`t1`.`c1` AS `g`,max(`test`.`t1`.`c2`) AS `m` from `test`.`t1` group by `test`.`t1`.`c1`) `t` join `test`.`t2` where `t`.`g` = `test`.`t2`.`c1` and `t`.`m` = `test`.`t2`.`c2` SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2 WHERE t.g=t2.c1 AND t.m=t2.c2; c1 c2 @@ -2542,7 +2542,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) 2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2`,`test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where (`v1`.`c1` = `test`.`t2`.`c1`) +Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2`,`test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where `v1`.`c1` = `test`.`t2`.`c1` SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1; c1 c2 c1 c2 c 3 c 3 diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 6a67b5d0baf..8d7074cd270 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -920,7 +920,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 2 DERIVED t1 ALL NULL NULL NULL NULL 96 100.00 Using where Warnings: -Note 1003 select straight_join distinct `test`.`t1`.`id` AS `id` from `test`.`t1` join `test`.`v1` join `test`.`t2` where ((`test`.`t2`.`i` = `v1`.`id`) and (`v1`.`i1` = `test`.`t1`.`i1`) and (`v1`.`id` <> 3)) +Note 1003 select straight_join distinct `test`.`t1`.`id` AS `id` from `test`.`t1` join `test`.`v1` join `test`.`t2` where `test`.`t2`.`i` = `v1`.`id` and `v1`.`i1` = `test`.`t1`.`i1` and `v1`.`id` <> 3 set join_buffer_size=1024; SELECT STRAIGHT_JOIN DISTINCT t1.id FROM t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3; diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 2841f27d45d..23d697835b0 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -157,7 +157,7 @@ select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select hex(column_create(1,'afaf' AS char charset utf8 ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,(4 + 1),12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, +Note 1003 select hex(column_create(1,'afaf' AS char charset utf8 ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, 2, 1212 AS unsigned int, 3, 1212 AS int, 4, 12.12 AS double, diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 3f5ad20fe6e..07fa646d558 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -142,7 +142,7 @@ SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),'')); ERROR 22003: DOUBLE value is out of range in 'cot('v')' SET NAMES utf8 COLLATE utf8_latvian_ci ; SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null); -ERROR 22003: BIGINT value is out of range in '(-73 * -2465717823867977728)' +ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728' # # End Bug#57882 # diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 81f75787c58..5bbadb6cbbc 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -268,7 +268,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 select (select 1 from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from dual +Note 1003 select (select 1 from `test`.`t2` where `test`.`t2`.`d` = NULL) AS `(SELECT 1 FROM t2 WHERE d = c)` from dual DROP TABLE t1, t2; # # Bug#30302: Tables that were optimized away are printed in the @@ -288,7 +288,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select 1 AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where (`test`.`t2`.`f2` = 1) +Note 1003 select 1 AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where `test`.`t2`.`f2` = 1 drop table t1,t2; # # Bug #48419: another explain crash.. diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result index ff0bc163a33..1af67cf6a4e 100644 --- a/mysql-test/r/explain_json.result +++ b/mysql-test/r/explain_json.result @@ -34,7 +34,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t0.a < 3)" + "attached_condition": "t0.a < 3" } } } @@ -56,7 +56,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" }, "table": { "table_name": "t1", @@ -88,7 +88,7 @@ EXPLAIN "used_key_parts": ["a1"], "rows": 5, "filtered": 100, - "index_condition": "(t2.a1 < 5)" + "index_condition": "t2.a1 < 5" } } } @@ -116,7 +116,7 @@ EXPLAIN }, "rows": 2, "filtered": 100, - "attached_condition": "((t2.a1 = 1) or (t2.b1 = 2))" + "attached_condition": "t2.a1 = 1 or t2.b1 = 2" } } } @@ -144,7 +144,7 @@ EXPLAIN }, "rows": 2, "filtered": 100, - "attached_condition": "((t2.a1 = 1) or ((t2.b1 = 2) and (t2.b2 = 3)))" + "attached_condition": "t2.a1 = 1 or t2.b1 = 2 and t2.b2 = 3" } } } @@ -173,7 +173,7 @@ EXPLAIN }, "rows": 2, "filtered": 100, - "attached_condition": "(((t2.a1 = 1) and (t2.a2 = 1)) or ((t2.b1 = 2) and (t2.b2 = 1)))" + "attached_condition": "t2.a1 = 1 and t2.a2 = 1 or t2.b1 = 2 and t2.b2 = 1" } } } @@ -188,7 +188,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t0.a is not null)" + "attached_condition": "t0.a is not null" }, "table": { "table_name": "t2", @@ -302,7 +302,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t1.b = t0.a)" + "attached_condition": "t1.b = t0.a" } } } @@ -322,7 +322,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "((t0.a > (subquery#2)) or (t0.a < 3))" + "attached_condition": "t0.a > (subquery#2) or t0.a < 3" }, "subqueries": [ { @@ -335,7 +335,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t1.b = t0.a)" + "attached_condition": "t1.b = t0.a" } } } @@ -360,7 +360,7 @@ EXPLAIN "access_type": "ALL", "rows": 100, "filtered": 100, - "attached_condition": "(tbl1.b < 3)" + "attached_condition": "tbl1.b < 3" }, "block-nl-join": { "table": { @@ -368,12 +368,12 @@ EXPLAIN "access_type": "ALL", "rows": 100, "filtered": 100, - "attached_condition": "(tbl2.b < 5)" + "attached_condition": "tbl2.b < 5" }, "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(tbl2.a = tbl1.a)" + "attached_condition": "tbl2.a = tbl1.a" } } } @@ -411,7 +411,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, - "attached_condition": "(t0.a < 3)" + "attached_condition": "t0.a < 3" } } } @@ -425,7 +425,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, - "attached_condition": "(t0.a in (2,3,4))" + "attached_condition": "t0.a in (2,3,4)" } } } @@ -481,11 +481,11 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(tbl.cnt > 0)", + "attached_condition": "tbl.cnt > 0", "materialized": { "query_block": { "select_id": 2, - "having_condition": "(cnt > 0)", + "having_condition": "cnt > 0", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -514,7 +514,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(tbl2.a is not null)" + "attached_condition": "tbl2.a is not null" }, "table": { "table_name": "", @@ -526,7 +526,7 @@ EXPLAIN "ref": ["test.tbl2.a"], "rows": 2, "filtered": 100, - "attached_condition": "(tbl1.cnt = tbl2.a)", + "attached_condition": "tbl1.cnt = tbl2.a", "materialized": { "query_block": { "select_id": 2, @@ -560,7 +560,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t1.a is not null)" + "attached_condition": "t1.a is not null" }, "table": { "table_name": "", @@ -674,7 +674,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))" + "attached_condition": "t1.b = t2.b and t1.a = t2.a" } } } @@ -711,7 +711,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))" + "attached_condition": "t1.b = t2.b and t1.a = t2.a" } } } @@ -739,7 +739,7 @@ EXPLAIN "used_key_parts": ["a"], "rows": 1, "filtered": 100, - "index_condition": "(t1.a < 3)", + "index_condition": "t1.a < 3", "mrr_type": "Rowid-ordered scan" } } @@ -792,14 +792,14 @@ EXPLAIN "used_key_parts": ["a"], "rows": 2, "filtered": 100, - "attached_condition": "(not((outer_t1.a,(subquery#2))))", + "attached_condition": "!(outer_t1.a,(subquery#2))", "using_index": true }, "subqueries": [ { "query_block": { "select_id": 2, - "having_condition": "trigcond((t1.a))", + "having_condition": "trigcond(t1.a is null)", "full-scan-on-null_key": { "table": { "table_name": "t1", @@ -811,7 +811,7 @@ EXPLAIN "ref": ["func"], "rows": 2, "filtered": 100, - "attached_condition": "trigcond((((outer_t1.a) = t1.a) or isnull(t1.a)))", + "attached_condition": "trigcond((outer_t1.a) = t1.a or t1.a is null)", "using_index": true } }, @@ -825,7 +825,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "((t2.b <> outer_t1.a) and trigcond((((outer_t1.a) = t1.a) or isnull(t1.a))))" + "attached_condition": "t2.b <> outer_t1.a and trigcond((outer_t1.a) = t1.a or t1.a is null)" } } } @@ -849,7 +849,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "const_condition": "((20000,((subquery#2) >= 20000)))", + "const_condition": "((20000,(subquery#2) >= 20000))", "table": { "table_name": "t0", "access_type": "ALL", @@ -876,7 +876,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "(tbl2.b = tbl1.b)" + "attached_condition": "tbl2.b = tbl1.b" } } } @@ -902,7 +902,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(not((t1.a,t1.a in (subquery#2))))" + "attached_condition": "!(t1.a,t1.a in (subquery#2))" }, "subqueries": [ { @@ -1047,7 +1047,7 @@ EXPLAIN "used_key_parts": ["a1", "a2", "b"], "rows": 17, "filtered": 100, - "attached_condition": "((t1.b = 'a') and (t1.a2 >= 'b'))", + "attached_condition": "t1.b = 'a' and t1.a2 >= 'b'", "using_index_for_group_by": true } } @@ -1065,7 +1065,7 @@ EXPLAIN "used_key_parts": ["a1", "a2", "b", "c"], "rows": 65, "filtered": 100, - "attached_condition": "((t1.b = 'a') and (t1.c = 'i121') and (t1.a2 >= 'b'))", + "attached_condition": "t1.b = 'a' and t1.c = 'i121' and t1.a2 >= 'b'", "using_index_for_group_by": "scanning" } } @@ -1086,7 +1086,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t1.a = _latin1'\xDF')" + "attached_condition": "t1.a = _latin1'\xDF'" } } } @@ -1106,7 +1106,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(case when convert(t1.a using utf8) = ((_utf8'a' collate utf8_bin)) then NULL else t1.a end)" + "attached_condition": "(case when convert(t1.a using utf8) = (_utf8'a' collate utf8_bin) then NULL else t1.a end)" } } } @@ -1130,7 +1130,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "having_condition": "(TOP > t2.a)", + "having_condition": "TOP > t2.a", "filesort": { "sort_key": "t2.a", "temporary_table": { @@ -1323,7 +1323,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 1, "filtered": 100, - "attached_condition": "(trigcond(isnull(t2.pk)) and trigcond(trigcond((t1.a is not null))))", + "attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))", "using_index": true, "not_exists": true } @@ -1361,7 +1361,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(trigcond(isnull(t2.pk)) and trigcond(trigcond((t1.a is not null))))", + "attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))", "using_index": true, "not_exists": true } @@ -1385,7 +1385,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(t1.a is not null)" + "attached_condition": "t1.a is not null" }, "table": { "table_name": "t2", @@ -1421,7 +1421,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(t1.a is not null)" + "attached_condition": "t1.a is not null" }, "table": { "table_name": "t2", @@ -1473,7 +1473,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t3.a is not null)" + "attached_condition": "t3.a is not null" }, "block-nl-join": { "table": { @@ -1486,7 +1486,7 @@ EXPLAIN "ref": ["test.t3.a"], "rows": 1, "filtered": 100, - "index_condition_bka": "((t4.b + 1) <= (t3.b + 1))" + "index_condition_bka": "t4.b + 1 <= t3.b + 1" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -1512,7 +1512,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "attached_condition": "(t3.a is not null)" + "attached_condition": "t3.a is not null" }, "block-nl-join": { "table": { @@ -1529,7 +1529,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": null, - "index_condition_bka": "((t4.b + 1) <= (t3.b + 1))" + "index_condition_bka": "t4.b + 1 <= t3.b + 1" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -1567,13 +1567,13 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, - "outer_ref_condition": "(t0.a < 5)", + "outer_ref_condition": "t0.a < 5", "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "((t0.a < 5) and (t1.b < t0.a))" + "attached_condition": "t0.a < 5 and t1.b < t0.a" } } } diff --git a/mysql-test/r/explain_json_format_partitions.result b/mysql-test/r/explain_json_format_partitions.result index fa2b5681120..5d7fdbc4864 100644 --- a/mysql-test/r/explain_json_format_partitions.result +++ b/mysql-test/r/explain_json_format_partitions.result @@ -18,7 +18,7 @@ EXPLAIN "access_type": "ALL", "rows": 10, "filtered": 100, - "attached_condition": "(t1.a in (2,3,4))" + "attached_condition": "t1.a in (2,3,4)" } } } @@ -39,7 +39,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 30, - "attached_condition": "(t1.a in (2,3,4))" + "attached_condition": "t1.a in (2,3,4)" } } } @@ -59,7 +59,7 @@ ANALYZE "r_rows": 10, "r_filtered": 30, "r_total_time_ms": "REPLACED", - "attached_condition": "(t1.a in (2,3,4))" + "attached_condition": "t1.a in (2,3,4)" } } } @@ -79,7 +79,7 @@ ANALYZE "r_rows": 10, "r_filtered": 0, "r_total_time_ms": "REPLACED", - "attached_condition": "(t1.a in (20,30,40))" + "attached_condition": "t1.a in (20,30,40)" } } } diff --git a/mysql-test/r/explain_json_innodb.result b/mysql-test/r/explain_json_innodb.result index cc389c63bda..8cec65642b4 100644 --- a/mysql-test/r/explain_json_innodb.result +++ b/mysql-test/r/explain_json_innodb.result @@ -31,7 +31,7 @@ EXPLAIN "access_type": "ALL", "rows": 1, "filtered": 100, - "attached_condition": "((tbl_alias1.column_name_2 is not null) and (tbl_alias1.column_name_1 is not null))" + "attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null" }, "table": { "table_name": "tbl_alias2", @@ -46,7 +46,7 @@ EXPLAIN ], "rows": 1, "filtered": 100, - "attached_condition": "(tbl_alias2.c = tbl_alias1.column_name_2)", + "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2", "using_index": true } } diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index b436a3c72b1..f99e675954e 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -14,7 +14,7 @@ explain extended select uncompress(compress(@test_compress_string)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select uncompress(compress((@`test_compress_string`))) AS `uncompress(compress(@test_compress_string))` +Note 1003 select uncompress(compress(@`test_compress_string`)) AS `uncompress(compress(@test_compress_string))` select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) 1 @@ -22,7 +22,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (uncompressed_length(compress((@`test_compress_string`))) = length((@`test_compress_string`))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` +Note 1003 select uncompressed_length(compress(@`test_compress_string`)) = length(@`test_compress_string`) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` select uncompressed_length(compress(@test_compress_string)); uncompressed_length(compress(@test_compress_string)) 117 diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result index e8fbba786a4..83fe5c3b551 100644 --- a/mysql-test/r/func_date_add.result +++ b/mysql-test/r/func_date_add.result @@ -102,3 +102,49 @@ select * from t1 where case a when adddate( '2012-12-12', 7 ) then true end; a drop table t1; End of 5.5 tests +create or replace view v1 as select 3 & 20010101 + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 & 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 3 & 20010101 + interval 2 day, x from v1; +3 & 20010101 + interval 2 day x +3 3 +create or replace view v1 as select (3 & 20010101) + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (3 & 20010101) + interval 2 day AS `x` latin1 latin1_swedish_ci +select (3 & 20010101) + interval 2 day, x from v1; +(3 & 20010101) + interval 2 day x +NULL NULL +Warnings: +Warning 1292 Incorrect datetime value: '1' +Warning 1292 Incorrect datetime value: '1' +create or replace view v1 as select 3 & (20010101 + interval 2 day) as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 & 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 3 & (20010101 + interval 2 day), x from v1; +3 & (20010101 + interval 2 day) x +3 3 +create or replace view v1 as select 30 + 20010101 + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 30 + 20010101 + interval 2 day, x from v1; +30 + 20010101 + interval 2 day x +2001-02-02 2001-02-02 +create or replace view v1 as select (30 + 20010101) + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select (30 + 20010101) + interval 2 day, x from v1; +(30 + 20010101) + interval 2 day x +2001-02-02 2001-02-02 +create or replace view v1 as select 30 + (20010101 + interval 2 day) as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + (20010101 + interval 2 day) AS `x` latin1 latin1_swedish_ci +select 30 + (20010101 + interval 2 day), x from v1; +30 + (20010101 + interval 2 day) x +20010133 20010133 +End of 10.2 tests diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index e72e1ff05bb..68c44231e43 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -203,7 +203,7 @@ SELECT * FROM t1 WHERE a=1 AND DES_ENCRYPT('test',a)=_latin1 'abc' COLLATE latin id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and (des_encrypt('test',`test`.`t1`.`a`) = 'abc')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and des_encrypt('test',`test`.`t1`.`a`) = 'abc' DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 4c4ad4da051..17d0baa0f01 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1044,7 +1044,7 @@ DROP TABLE t1; CREATE TABLE t1(f1 int); INSERT INTO t1 values (0),(0); SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d)); -ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `test`.`t`.`f1`) `d`)' value found during parsing +ERROR 22007: Illegal non geometric '(select 1 from (select 1 = group_concat(`test`.`t1`.`f1` separator ',') AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `test`.`t`.`f1`) `d`)' value found during parsing DROP TABLE t1; # # Bug#58396 group_concat and explain extended are still crashy diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index dbeb458345e..cd049f17400 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1409,7 +1409,7 @@ EXPLAIN EXTENDED SELECT y FROM v1 GROUP BY v1.y; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort Warnings: -Note 1003 select (`test`.`t1`.`a` + 1) AS `y` from `test`.`t1` group by (`test`.`t1`.`a` + 1) +Note 1003 select `test`.`t1`.`a` + 1 AS `y` from `test`.`t1` group by `test`.`t1`.`a` + 1 DROP VIEW v1; DROP TABLE t1; SET SQL_MODE=DEFAULT; @@ -1860,7 +1860,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`a` = 1) and (`test`.`t2`.`b` = 2) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = 1 and `test`.`t2`.`b` = 2 and `test`.`t1`.`a` < 10 SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; MAX(a) NULL @@ -1869,7 +1869,7 @@ SELECT MAX(a) FROM t1 WHERE RAND()*0<>0 AND a<10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 4 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (((rand() * 0) <> 0) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where rand() * 0 <> 0 and `test`.`t1`.`a` < 10 SELECT MAX(a) FROM t1 WHERE RAND()*0<>0 AND a<10; MAX(a) NULL @@ -1891,7 +1891,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 Warnings: Note 1276 Field or reference 'test.t3.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select <`test`.`t3`.`b`>((select min(1) from dual where (10 = `test`.`t3`.`b`))) AS `(SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b)` from `test`.`t3` +Note 1003 select <`test`.`t3`.`b`>((select min(1) from dual where 10 = `test`.`t3`.`b`)) AS `(SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b)` from `test`.`t3` SELECT (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) FROM t3; (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) NULL @@ -2398,7 +2398,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t10.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t10`.`a` AS `a` from `test`.`t10` where ((`test`.`t10`.`c` < 3) or <`test`.`t10`.`a`,`test`.`t10`.`b`>((`test`.`t10`.`a`,(select `test`.`t12`.`c` from `test`.`t12` where ((`test`.`t10`.`a`) = `test`.`t12`.`c`) union select max(`test`.`t10`.`b`) from `test`.`t11` group by `test`.`t11`.`c` having ((`test`.`t10`.`a`) = (max(`test`.`t10`.`b`))))))) +Note 1003 select `test`.`t10`.`a` AS `a` from `test`.`t10` where `test`.`t10`.`c` < 3 or <`test`.`t10`.`a`,`test`.`t10`.`b`>((`test`.`t10`.`a`,(select `test`.`t12`.`c` from `test`.`t12` where (`test`.`t10`.`a`) = `test`.`t12`.`c` union select max(`test`.`t10`.`b`) from `test`.`t11` group by `test`.`t11`.`c` having (`test`.`t10`.`a`) = (max(`test`.`t10`.`b`))))) drop table t10,t11,t12; # # MDEV-10017: Get unexpected `Empty Set` for correlated subquery @@ -2429,7 +2429,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY tt system NULL NULL NULL NULL 1 100.00 Warnings: Note 1276 Field or reference 'test.t1.c1' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` having (`test`.`t1`.`c1` >= <`test`.`t1`.`c1`>((select 2 AS `c` from dual order by (select min((`test`.`t1`.`c1` + 2)) from dual)))) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` having `test`.`t1`.`c1` >= <`test`.`t1`.`c1`>((select 2 AS `c` from dual order by (select min(`test`.`t1`.`c1` + 2) from dual))) select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt)); c1 2 diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 637fd8cd2a2..09eb85d9fb6 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where; Using filesort Warnings: -Note 1003 select if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where (`test`.`t1`.`st` like '%a%') order by if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) +Note 1003 select if(`test`.`t1`.`u` = 1,`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where `test`.`t1`.`st` like '%a%' order by if(`test`.`t1`.`u` = 1,`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) select nullif(u, 1) from t1; nullif(u, 1) NULL diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 1855fa72523..aaf1d981e59 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -121,9 +121,9 @@ insert into t1 values ('a','c','c'); select * from t1 where a in (b); ERROR HY000: Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' select * from t1 where a in (b,c); -ERROR HY000: Illegal mix of collations (latin1_general_ci,IMPLICIT), (latin1_swedish_ci,IMPLICIT), (latin1_danish_ci,IMPLICIT) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin1_general_ci,IMPLICIT), (latin1_swedish_ci,IMPLICIT), (latin1_danish_ci,IMPLICIT) for operation 'in' select * from t1 where 'a' in (a,b,c); -ERROR HY000: Illegal mix of collations for operation ' IN ' +ERROR HY000: Illegal mix of collations for operation 'in' select * from t1 where 'a' in (a); a b c A B C @@ -146,7 +146,7 @@ explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ('a' in (`test`.`t1`.`a`,`test`.`t1`.`b`,(`test`.`t1`.`c` collate latin1_bin))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 'a' in (`test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` collate latin1_bin) drop table t1; set names utf8; create table t1 (a char(10) character set utf8 not null); @@ -226,7 +226,7 @@ a CREATE VIEW v1 AS SELECT * FROM t1 WHERE a NOT IN (45); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` <> 45) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` <> 45 latin1 latin1_swedish_ci SELECT * FROM v1; a 44 @@ -841,17 +841,17 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Ok to propagate equalities into IN () list, even if multiple comparison types EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND 1 IN (1,a,'3'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Not Ok to propagate equalities into the left IN argument in case of multiple comparison types EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a IN (1,2,'3'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and (`test`.`t1`.`a` in (1,2,'3'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` in (1,2,'3') DROP TABLE t1; diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 0740e89f8df..842ba25e556 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -5,12 +5,12 @@ explain extended select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like 'abc%' explain extended select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like (concat('abc','%'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like (concat('abc','%')) select * from t1 where a like "abc%"; a abc @@ -224,7 +224,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.00; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 10.0) and (`test`.`t1`.`a` like 10.00)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10.0 and `test`.`t1`.`a` like 10.00 DROP TABLE t1; # # MDEV-8599 "WHERE varchar_field LIKE temporal_const" does not use range optimizer @@ -257,7 +257,7 @@ DROP TABLE t1; create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ('foo!' like 'foo!!') AS `'foo!' like 'foo!!'`,('foo!' like 'foo!!' escape '!') AS `'foo!' like 'foo!!' escape '!'` koi8r koi8r_general_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'foo!' like 'foo!!' AS `'foo!' like 'foo!!'`,'foo!' like 'foo!!' escape '!' AS `'foo!' like 'foo!!' escape '!'` koi8r koi8r_general_ci select * from v1; 'foo!' like 'foo!!' 'foo!' like 'foo!!' escape '!' 0 1 diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index a783fd3967d..f02776d4448 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -49,7 +49,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log( id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-1) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-1,2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` +Note 1003 select log(exp(10)) AS `log(exp(10))`,exp(log(sqrt(10)) * 2) AS `exp(log(sqrt(10))*2)`,log(-1) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-1,2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10 10.000000000000002 NULL NULL NULL @@ -57,7 +57,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-1) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` +Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp(ln(sqrt(10)) * 2) AS `exp(ln(sqrt(10))*2)`,ln(-1) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3 3.9068905956085187 NULL NULL NULL @@ -98,7 +98,7 @@ explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format( id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format(cot(1),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` +Note 1003 select pi() AS `pi()`,format(sin(pi() / 2),6) AS `format(sin(pi()/2),6)`,format(cos(pi() / 2),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format(cot(1),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.283185307179586 @@ -486,13 +486,13 @@ Warning 1292 Truncated incorrect INTEGER value: 'a' DROP TABLE t1; End of 5.0 tests SELECT 1e308 + 1e308; -ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)' +ERROR 22003: DOUBLE value is out of range in '1e308 + 1e308' SELECT -1e308 - 1e308; -ERROR 22003: DOUBLE value is out of range in '(-1e308 - 1e308)' +ERROR 22003: DOUBLE value is out of range in '-1e308 - 1e308' SELECT 1e300 * 1e300; -ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)' +ERROR 22003: DOUBLE value is out of range in '1e300 * 1e300' SELECT 1e300 / 1e-300; -ERROR 22003: DOUBLE value is out of range in '(1e300 / 1e-300)' +ERROR 22003: DOUBLE value is out of range in '1e300 / 1e-300' SELECT EXP(750); ERROR 22003: DOUBLE value is out of range in 'exp(750)' SELECT POW(10, 309); @@ -519,9 +519,9 @@ DROP TABLE t1; # Bug#57477 SIGFPE when dividing a huge number a negative number # SELECT -9999999999999999991 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-9999999999999999991 DIV -1)' +ERROR 22003: BIGINT value is out of range in '-9999999999999999991 DIV -1' SELECT -9223372036854775808 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 DIV -1)' +ERROR 22003: BIGINT value is out of range in '-9223372036854775808 DIV -1' SELECT -9223372036854775808 MOD -1; -9223372036854775808 MOD -1 0 @@ -529,13 +529,13 @@ SELECT -9223372036854775808999 MOD -1; -9223372036854775808999 MOD -1 0 select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x; -ERROR 22003: BIGINT value is out of range in '(123456789012345678901234567890.123456789012345678901234567890 DIV 1)' +ERROR 22003: BIGINT value is out of range in '123456789012345678901234567890.123456789012345678901234567890 DIV 1' select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x; -ERROR 22003: BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)' +ERROR 22003: BIGINT value is out of range in ''123456789012345678901234567890.123456789012345678901234567890' DIV 1' SHOW WARNINGS; Level Code Message Warning 1916 Got overflow when converting '123456789012345678901234567890' to INT. Value truncated -Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)' +Error 1690 BIGINT value is out of range in ''123456789012345678901234567890.123456789012345678901234567890' DIV 1' # # Bug#57810 case/when/then : Assertion failed: length || !scale # @@ -589,13 +589,13 @@ End of 5.1 tests # Bug #8433: Overflow must be an error # SELECT 1e308 + 1e308; -ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)' +ERROR 22003: DOUBLE value is out of range in '1e308 + 1e308' SELECT -1e308 - 1e308; -ERROR 22003: DOUBLE value is out of range in '(-1e308 - 1e308)' +ERROR 22003: DOUBLE value is out of range in '-1e308 - 1e308' SELECT 1e300 * 1e300; -ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)' +ERROR 22003: DOUBLE value is out of range in '1e300 * 1e300' SELECT 1e300 / 1e-300; -ERROR 22003: DOUBLE value is out of range in '(1e300 / 1e-300)' +ERROR 22003: DOUBLE value is out of range in '1e300 / 1e-300' SELECT EXP(750); ERROR 22003: DOUBLE value is out of range in 'exp(750)' SELECT POW(10, 309); @@ -605,86 +605,86 @@ ERROR 22003: DOUBLE value is out of range in 'cot(0)' SELECT DEGREES(1e307); ERROR 22003: DOUBLE value is out of range in 'degrees(1e307)' SELECT 9223372036854775808 + 9223372036854775808; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 + 9223372036854775808)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '9223372036854775808 + 9223372036854775808' SELECT 18446744073709551615 + 1; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '18446744073709551615 + 1' SELECT 1 + 18446744073709551615; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(1 + 18446744073709551615)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '1 + 18446744073709551615' SELECT -2 + CAST(1 AS UNSIGNED); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-2 + cast(1 as unsigned))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '-2 + cast(1 as unsigned)' SELECT CAST(1 AS UNSIGNED) + -2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) + -2)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(1 as unsigned) + -2' SELECT -9223372036854775808 + -9223372036854775808; -ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 + -9223372036854775808)' +ERROR 22003: BIGINT value is out of range in '-9223372036854775808 + -9223372036854775808' SELECT 9223372036854775807 + 9223372036854775807; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 + 9223372036854775807)' +ERROR 22003: BIGINT value is out of range in '9223372036854775807 + 9223372036854775807' SELECT CAST(0 AS UNSIGNED) - 9223372036854775809; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(0 as unsigned) - 9223372036854775809)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(0 as unsigned) - 9223372036854775809' SELECT 9223372036854775808 - 9223372036854775809; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 - 9223372036854775809)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '9223372036854775808 - 9223372036854775809' SELECT CAST(1 AS UNSIGNED) - 2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) - 2)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(1 as unsigned) - 2' SELECT 18446744073709551615 - (-1); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 - -1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '18446744073709551615 - -1' SELECT -1 - 9223372036854775808; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-1 - 9223372036854775808)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '-1 - 9223372036854775808' SELECT -1 - CAST(1 AS UNSIGNED); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-1 - cast(1 as unsigned))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '-1 - cast(1 as unsigned)' SELECT -9223372036854775808 - 1; -ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 - 1)' +ERROR 22003: BIGINT value is out of range in '-9223372036854775808 - 1' SELECT 9223372036854775807 - -9223372036854775808; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -9223372036854775808)' +ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -9223372036854775808' set SQL_MODE='NO_UNSIGNED_SUBTRACTION'; SELECT 18446744073709551615 - 1; -ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - 1)' +ERROR 22003: BIGINT value is out of range in '18446744073709551615 - 1' SELECT 18446744073709551615 - CAST(1 AS UNSIGNED); -ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - cast(1 as unsigned))' +ERROR 22003: BIGINT value is out of range in '18446744073709551615 - cast(1 as unsigned)' SELECT 18446744073709551614 - (-1); -ERROR 22003: BIGINT value is out of range in '(18446744073709551614 - -1)' +ERROR 22003: BIGINT value is out of range in '18446744073709551614 - -1' SELECT 9223372036854775807 - -1; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -1)' +ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -1' set SQL_MODE=default; SELECT 4294967296 * 4294967296; -ERROR 22003: BIGINT value is out of range in '(4294967296 * 4294967296)' +ERROR 22003: BIGINT value is out of range in '4294967296 * 4294967296' SELECT 9223372036854775808 * 2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 * 2)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '9223372036854775808 * 2' SELECT 9223372036854775808 * 2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 * 2)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '9223372036854775808 * 2' SELECT 7158278827 * 3221225472; -ERROR 22003: BIGINT value is out of range in '(7158278827 * 3221225472)' +ERROR 22003: BIGINT value is out of range in '7158278827 * 3221225472' SELECT 9223372036854775807 * (-2); -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * -2)' +ERROR 22003: BIGINT value is out of range in '9223372036854775807 * -2' SELECT CAST(1 as UNSIGNED) * (-1); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) * -1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(1 as unsigned) * -1' SELECT 9223372036854775807 * 2; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * 2)' +ERROR 22003: BIGINT value is out of range in '9223372036854775807 * 2' SELECT ABS(-9223372036854775808); ERROR 22003: BIGINT value is out of range in 'abs(-9223372036854775808)' SELECT -9223372036854775808 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 DIV -1)' +ERROR 22003: BIGINT value is out of range in '-9223372036854775808 DIV -1' SELECT 18446744073709551615 DIV -1; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV -1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '18446744073709551615 DIV -1' CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED); INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809); SELECT -a FROM t1; -ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' +ERROR 22003: BIGINT value is out of range in '-`test`.`t1`.`a`' SELECT -b FROM t1; -ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' +ERROR 22003: BIGINT value is out of range in '-`test`.`t1`.`b`' INSERT INTO t1 VALUES(0,0); SELECT -a FROM t1; -ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' +ERROR 22003: BIGINT value is out of range in '-`test`.`t1`.`a`' SELECT -b FROM t1; -ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' +ERROR 22003: BIGINT value is out of range in '-`test`.`t1`.`b`' DROP TABLE t1; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SELECT @a + @a; -ERROR 22003: DECIMAL value is out of range in '((@`a`) + (@`a`))' +ERROR 22003: DECIMAL value is out of range in '@`a` + @`a`' SELECT @a * @a; -ERROR 22003: DECIMAL value is out of range in '((@`a`) * (@`a`))' +ERROR 22003: DECIMAL value is out of range in '@`a` * @`a`' SELECT -@a - @a; -ERROR 22003: DECIMAL value is out of range in '(-((@`a`)) - (@`a`))' +ERROR 22003: DECIMAL value is out of range in '-@`a` - @`a`' SELECT @a / 0.5; -ERROR 22003: DECIMAL value is out of range in '((@`a`) / 0.5)' +ERROR 22003: DECIMAL value is out of range in '@`a` / 0.5' SELECT COT(1/0); COT(1/0) NULL diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 663fc2583e7..10423a4b105 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -354,7 +354,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) 2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on((`test`.`tv`.`e` = `test`.`t1`.`a`)) where (not(((last_value(NULL,`test`.`tv`.`e`),(select last_value(NULL,'1') from dual where trigcond(((last_value(NULL,`test`.`tv`.`e`)) = last_value(NULL,'1')))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on(`test`.`tv`.`e` = `test`.`t1`.`a`) where !((last_value(NULL,`test`.`tv`.`e`),(select last_value(NULL,'1') from dual where trigcond((last_value(NULL,`test`.`tv`.`e`)) = last_value(NULL,'1'))))) explain extended select a from t1 left join v_merge on (a=e) where e not in (select last_value(NULL,e) from vm); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -362,7 +362,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) 2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on((`test`.`tv`.`e` = `test`.`t1`.`a`)) where (not(<`test`.`tv`.`e`>((`test`.`tv`.`e`,(select last_value(NULL,'1') from dual where trigcond(((`test`.`tv`.`e`) = last_value(NULL,'1')))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on(`test`.`tv`.`e` = `test`.`t1`.`a`) where !<`test`.`tv`.`e`>((`test`.`tv`.`e`,(select last_value(NULL,'1') from dual where trigcond((`test`.`tv`.`e`) = last_value(NULL,'1'))))) set optimizer_switch=@optimizer_switch_save; drop view v_merge, vm; drop table t1,tv; diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index 0d738570035..685aba1075f 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -5,7 +5,7 @@ explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -2) AS `-(1+1)*-2` +Note 1003 select 1 + 1 AS `1+1`,1 - 1 AS `1-1`,1 + 1 * 2 AS `1+1*2`,8 / 5 AS `8/5`,8 % 5 AS `8%5`,8 % 5 AS `mod(8,5)`,8 % 5 | 0 AS `mod(8,5)|0`,-(1 + 1) * -2 AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 @@ -13,7 +13,7 @@ explain extended select 1 | (1+1),5 & 3,bit_count(7) ; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` +Note 1003 select 1 | 1 + 1 AS `1 | (1+1)`,5 & 3 AS `5 & 3`,bit_count(7) AS `bit_count(7)` select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 4294967296 9223372036854775808 0 1 0 8 diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 96af966d367..3ffbe275fb9 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -5,7 +5,7 @@ explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select interval(55,10,20,30,40,50,60,70,80,90,100) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval(3,1,(1 + 1),(((1 + 1) + 1) + 1)) AS `interval(3,1,1+1,1+1+1+1)`,field('IBM','NCA','ICL','SUN','IBM','DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field('A','B','C') AS `field("A","B","C")`,elt(2,'ONE','TWO','THREE') AS `elt(2,"ONE","TWO","THREE")`,interval(0,1,2,3,4) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` +Note 1003 select interval(55,10,20,30,40,50,60,70,80,90,100) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval(3,1,1 + 1,1 + 1 + 1 + 1) AS `interval(3,1,1+1,1+1+1+1)`,field('IBM','NCA','ICL','SUN','IBM','DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field('A','B','C') AS `field("A","B","C")`,elt(2,'ONE','TWO','THREE') AS `elt(2,"ONE","TWO","THREE")`,interval(0,1,2,3,4) AS `interval(0,1,2,3,4)`,elt(1,1,2,3) | 0 AS `elt(1,1,2,3)|0`,elt(1,1.1,1.2,1.3) + 0 AS `elt(1,1.1,1.2,1.3)+0` SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) 1 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d4c17e68394..b095cf4574e 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -587,15 +587,15 @@ select _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin); _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin) 0 select _latin2'B' in (_latin1'a',_latin1'b'); -ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'in' select _latin1'B' in (_latin2'a',_latin1'b'); -ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'in' select _latin1'B' in (_latin1'a',_latin2'b'); -ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE) for operation 'in' select _latin1'B' COLLATE latin1_general_ci in (_latin1'a' COLLATE latin1_bin,_latin1'b'); -ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_bin,EXPLICIT), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_bin,EXPLICIT), (latin1_swedish_ci,COERCIBLE) for operation 'in' select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE latin1_bin); -ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_swedish_ci,COERCIBLE), (latin1_bin,EXPLICIT) for operation ' IN ' +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_swedish_ci,COERCIBLE), (latin1_bin,EXPLICIT) for operation 'in' select collation(bin(130)), coercibility(bin(130)); collation(bin(130)) coercibility(bin(130)) latin1_swedish_ci 4 @@ -841,7 +841,7 @@ explain extended select 'mood' sounds like 'mud'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (soundex('mood') = soundex('mud')) AS `'mood' sounds like 'mud'` +Note 1003 select soundex('mood') = soundex('mud') AS `'mood' sounds like 'mud'` explain extended select aes_decrypt(aes_encrypt('abc','1'),'1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -921,7 +921,7 @@ explain extended select FIELD('b' COLLATE latin1_bin,'A','B'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select field(('b' collate latin1_bin),'A','B') AS `FIELD('b' COLLATE latin1_bin,'A','B')` +Note 1003 select field('b' collate latin1_bin,'A','B') AS `FIELD('b' COLLATE latin1_bin,'A','B')` explain extended select FIND_IN_SET(_latin1'B', _latin1'a,b,c,d'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -976,7 +976,7 @@ explain extended select quote(1/0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select quote((1 / 0)) AS `quote(1/0)` +Note 1003 select quote(1 / 0) AS `quote(1/0)` explain extended select crc32("123"); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -1290,27 +1290,27 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`) > 'ab') +Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(`test`.`t1`.`s`) > 'ab' EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both 'y' from `test`.`t1`.`s`) > 'ab') +Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(both 'y' from `test`.`t1`.`s`) > 'ab' EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading 'y' from `test`.`t1`.`s`) > 'ab') +Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(leading 'y' from `test`.`t1`.`s`) > 'ab' EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing 'y' from `test`.`t1`.`s`) > 'ab') +Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(trailing 'y' from `test`.`t1`.`s`) > 'ab' EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both 'y' from `test`.`t1`.`s`) > 'ab') +Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(both 'y' from `test`.`t1`.`s`) > 'ab' DROP TABLE t1; create table t1(f1 varchar(4)); explain extended select encode(f1,'zxcv') as 'enc' from t1; @@ -1400,7 +1400,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 100.00 Using index 1 SIMPLE t1 ref code code 13 const 3 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = 'a12') and (length(`test`.`t1`.`code`) = 5)) +Note 1003 select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`code` = 'a12' and length(`test`.`t1`.`code`) = 5 DROP TABLE t1,t2; select encode(NULL, NULL); encode(NULL, NULL) @@ -4575,7 +4575,7 @@ SELECT * FROM t1 WHERE a=18446744073709551615 AND FORMAT(a,0)='18,446,744,073,70 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and (format(`test`.`t1`.`a`,0) = '18,446,744,073,709,551,615')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 18446744073709551615 and format(`test`.`t1`.`a`,0) = '18,446,744,073,709,551,615' DROP TABLE t1; # # Bug#58081 Duplicate entry error when doing GROUP BY diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index ddd71e5d110..f999061e2e7 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -48,7 +48,7 @@ explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` +Note 1003 select 3 ^ 11 AS `3 ^ 11`,1 ^ 1 AS `1 ^ 1`,1 ^ 0 AS `1 ^ 0`,1 ^ NULL AS `1 ^ NULL`,NULL ^ 1 AS `NULL ^ 1` select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL @@ -62,7 +62,7 @@ explain extended select 10 % 7, 10 mod 7, 10 div 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` +Note 1003 select 10 % 7 AS `10 % 7`,10 % 7 AS `10 mod 7`,10 DIV 3 AS `10 div 3` select 18446744073709551615, 18446744073709551615 DIV 1, 18446744073709551615 DIV 2; 18446744073709551615 18446744073709551615 DIV 1 18446744073709551615 DIV 2 18446744073709551615 18446744073709551615 9223372036854775807 @@ -70,7 +70,7 @@ explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` +Note 1003 select (1 << 64) - 1 AS `(1 << 64)-1`,((1 << 64) - 1) DIV 1 AS `((1 << 64)-1) DIV 1`,((1 << 64) - 1) DIV 2 AS `((1 << 64)-1) DIV 2` create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; @@ -87,7 +87,7 @@ explain extended select - a from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select -(1) AS `- a` from dual +Note 1003 select -1 AS `- a` from dual drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 @@ -108,7 +108,7 @@ explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (_koi8r'a' = (_koi8r'A' collate koi8r_general_ci)) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` +Note 1003 select _koi8r'a' = _koi8r'A' collate koi8r_general_ci AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; _koi8r'a' = _koi8r'A' COLLATE koi8r_bin 0 @@ -291,7 +291,7 @@ explain extended select not a from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Warnings: -Note 1003 select (`test`.`t1`.`a` = 0) AS `not a` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` = 0 AS `not a` from `test`.`t1` select * from t1 where not a; a 0 @@ -299,7 +299,7 @@ explain extended select * from t1 where not a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 select not (a+0) from t1; not (a+0) 0 @@ -310,7 +310,7 @@ explain extended select not (a+0) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Warnings: -Note 1003 select (not((`test`.`t1`.`a` + 0))) AS `not (a+0)` from `test`.`t1` +Note 1003 select !(`test`.`t1`.`a` + 0) AS `not (a+0)` from `test`.`t1` select * from t1 where not (a+0); a 0 @@ -318,7 +318,7 @@ explain extended select * from t1 where not (a+0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not((`test`.`t1`.`a` + 0))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where !(`test`.`t1`.`a` + 0) select not 1, not null, not not null, 1 is not null; not 1 not null not not null 1 is not null 0 NULL NULL 1 @@ -336,7 +336,7 @@ EXPLAIN EXTENDED SELECT NOT NOT strcmp('a','b'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (strcmp('a','b') <> 0) AS `NOT NOT strcmp('a','b')` +Note 1003 select strcmp('a','b') <> 0 AS `NOT NOT strcmp('a','b')` # # End of 10.0 tests # diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 6ca89082a45..d76fc313dc0 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -874,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(current_timestamp())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,weekday(curdate()) - weekday(current_timestamp()) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time(time_to_sec('0:30:47') / 6.21) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,'1997-12-31 23:59:59' + interval 1 second AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,'1998-01-01 00:00:00' - interval 1 second AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,'1997-12-31' + interval 1 day AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,'1997-12-31 23:59:59' + interval 1 second AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP='2007-08-01 12:22:49'; CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ('2007-08-01 12:22:59'); diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result index 93119dcb309..0f822456724 100644 --- a/mysql-test/r/func_time_hires.result +++ b/mysql-test/r/func_time_hires.result @@ -156,12 +156,12 @@ explain extended select cast(cast(@a as datetime(4)) as time(0)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(cast((@`a`) as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))` +Note 1003 select cast(cast(@`a` as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))` select cast(cast(@a as time(2)) as time(6)); cast(cast(@a as time(2)) as time(6)) 12:13:14.120000 select CAST(@a AS DATETIME(7)); -ERROR 42000: Too big precision 7 specified for '(@`a`)'. Maximum is 6 +ERROR 42000: Too big precision 7 specified for '@`a`'. Maximum is 6 SELECT CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00'); CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00') 2011-01-02 15:00:00 diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result index 14737a2e62e..04fd9962218 100644 --- a/mysql-test/r/func_weight_string.result +++ b/mysql-test/r/func_weight_string.result @@ -119,7 +119,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null ALTER TABLE t1 MODIFY a DOUBLE ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a @@ -129,7 +129,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null ALTER TABLE t1 MODIFY a DECIMAL(10,1) ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a @@ -139,7 +139,7 @@ SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and isnull(weight_string(`test`.`t1`.`a`,0,0,1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 8d2ab0d8a55..2d6d9f3b632 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1093,10 +1093,10 @@ SHOW CREATE VIEW mysqltest2.t_nn; ERROR HY000: 'mysqltest2.t_nn' is not VIEW SHOW CREATE VIEW mysqltest2.v_yy; View Create View character_set_client collation_connection -v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci +v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where `mysqltest2`.`t_nn`.`c1` = 55 latin1 latin1_swedish_ci SHOW CREATE TABLE mysqltest2.v_yy; View Create View character_set_client collation_connection -v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci +v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where `mysqltest2`.`t_nn`.`c1` = 55 latin1 latin1_swedish_ci connection master; SHOW CREATE TABLE mysqltest2.v_nn; View Create View character_set_client collation_connection diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 7cc5f1029b0..e671b777b50 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1789,7 +1789,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select <`test`.`t1`.`a`>((select `test`.`t1`.`a`)) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by (<`test`.`t1`.`a`>((select `test`.`t1`.`a`)) + 0) +Note 1003 select <`test`.`t1`.`a`>((select `test`.`t1`.`a`)) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by <`test`.`t1`.`a`>((select `test`.`t1`.`a`)) + 0 EXPLAIN EXTENDED SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -1797,7 +1797,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select <`test`.`t1`.`a`>((select `test`.`t1`.`a`)) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -(<`test`.`t1`.`a`>((select `test`.`t1`.`a`))) +Note 1003 select <`test`.`t1`.`a`>((select `test`.`t1`.`a`)) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -<`test`.`t1`.`a`>((select `test`.`t1`.`a`)) # should return only one record SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa; diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 5d2af550b81..6d1e23d18fe 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -1715,7 +1715,7 @@ explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 50.78 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 'a') and (`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`a2` >= 'b')) +Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 'a' and `test`.`t1`.`c` = 'i121' and `test`.`t1`.`a2` >= 'b' explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by @@ -1732,7 +1732,7 @@ explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 50.61 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`b` = 'a') and (`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`a2` >= 'b')) +Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`b` = 'a' and `test`.`t2`.`c` = 'i121' and `test`.`t2`.`a2` >= 'b' explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by @@ -1961,7 +1961,7 @@ explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by Warnings: -Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`b` = 'c') and (`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a')) +Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`b` = 'c' and `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index @@ -1969,7 +1969,7 @@ explain extended select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') an id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by Warnings: -Note 1003 select (98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a')) +Note 1003 select 98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); count(distinct a1,a2,b) 4 @@ -2077,19 +2077,19 @@ where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 85.53 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`c` > 'a111')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2` +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 50.78 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`d` > 'xy2')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select a1,a2,b,c from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 50.78 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`d` > 'xy2')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index @@ -2097,7 +2097,7 @@ explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 85.53 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`c` > 'a111')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index @@ -2121,12 +2121,12 @@ explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where (`test`.`t1`.`a1` > 'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index Warnings: -Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where (`test`.`t1`.`a1` > 'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` +Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` create table t4 as select distinct a1, a2, b, c from t1; alter table t4 add unique index idxt4 (a1, a2, b, c); # This is "superceded" by MDEV-7118, and Loose Index Scan is again an option: @@ -2636,7 +2636,7 @@ explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref a,index a 5 const 15 100.00 Using index; Using temporary Warnings: -Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a` +Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a` drop table t1; CREATE TABLE t1 (a int, b int, c int, d int, KEY foo (c,d,a,b), KEY bar (c,a,b,d)); diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 627edd60141..89e53ec23b2 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select count(NULL) AS `b` from dual where 0 having (`b` >= 0) +Note 1003 select count(NULL) AS `b` from dual where 0 having `b` >= 0 drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', @@ -472,7 +472,7 @@ HAVING (table2.f2 = 8 AND table1.f1 >= 6); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where (`test`.`table1`.`f3` = 9) group by `test`.`table1`.`f1`,7 having 0 +Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where `test`.`table1`.`f3` = 9 group by `test`.`table1`.`f1`,7 having 0 EXPLAIN EXTENDED SELECT table1.f1, table2.f2 FROM t1 AS table1 @@ -483,7 +483,7 @@ HAVING (table2.f2 = 8); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where (`test`.`table1`.`f3` = 9) group by `test`.`table1`.`f1`,7 having 0 +Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where `test`.`table1`.`f3` = 9 group by `test`.`table1`.`f1`,7 having 0 DROP TABLE t1; # # Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 @@ -631,7 +631,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL f10 4 NULL 2 100.00 Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select min(`test`.`t1`.`f10`) AS `field1` from `test`.`t1` where <7>((7,(select `test`.`t3`.`f3` from `test`.`t3` where ((7) = `test`.`t3`.`f3`)))) having ((`field1`) < 's') +Note 1003 select min(`test`.`t1`.`f10`) AS `field1` from `test`.`t1` where <7>((7,(select `test`.`t3`.`f3` from `test`.`t3` where (7) = `test`.`t3`.`f3`))) having (`field1`) < 's' set optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; End of 5.2 tests diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 7b476ca6415..61a78e65610 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1137,7 +1137,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((1 = 1)) left join (`test`.`t1` left join `test`.`t1` `t2` on((1 = 1))) on(rand()) where 1 +Note 1003 select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on(1 = 1) left join (`test`.`t1` left join `test`.`t1` `t2` on(1 = 1)) on(rand()) where 1 DROP VIEW v1; DROP TABLE t1; # @@ -1495,7 +1495,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select NULL AS `i1`,`v2`.`i2` AS `i2`,`v2`.`a` AS `a`,`v2`.`b` AS `b` from `test`.`v2` where ((`v2`.`i2` = NULL) and (`v2`.`a` < `v2`.`b`)) +Note 1003 select NULL AS `i1`,`v2`.`i2` AS `i2`,`v2`.`a` AS `a`,`v2`.`b` AS `b` from `test`.`v2` where `v2`.`i2` = NULL and `v2`.`a` < `v2`.`b` DROP VIEW v2; DROP TABLE t1,t2; SET optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index c15f96fc2e5..74e64d92856 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -4776,7 +4776,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`d2` = `test`.`t1`.`pk`) and (`test`.`t3`.`a3` = `test`.`t2`.`c2`))) left join `test`.`t4` on(((`test`.`t4`.`a4` = `test`.`t1`.`a1`) and (`test`.`t1`.`a1` is not null))) left join `test`.`t5` on((`test`.`t5`.`a5` = `test`.`t3`.`a3`)) where 1 +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4798,7 +4798,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`d2` = `test`.`t1`.`pk`) and (`test`.`t3`.`a3` = `test`.`t2`.`c2`))) left join `test`.`t4` on(((`test`.`t4`.`a4` = `test`.`t1`.`a1`) and (`test`.`t1`.`a1` is not null))) left join `test`.`t5` on((`test`.`t5`.`a5` = `test`.`t3`.`a3`)) where 1 +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4820,7 +4820,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`d2` = `test`.`t1`.`pk`) and (`test`.`t3`.`a3` = `test`.`t2`.`c2`))) left join `test`.`t4` on(((`test`.`t4`.`a4` = `test`.`t1`.`a1`) and (`test`.`t1`.`a1` is not null))) left join `test`.`t5` on((`test`.`t5`.`a5` = `test`.`t3`.`a3`)) where 1 +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result index 84b6ff640e9..28f8a1e5990 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -79,7 +79,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on((`test`.`t4`.`b` = `test`.`t2`.`b`)) where ((`test`.`t3`.`a` = 1) or isnull(`test`.`t3`.`c`)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t4`.`b` = `test`.`t2`.`b`) where `test`.`t3`.`a` = 1 or `test`.`t3`.`c` is null SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM t2 LEFT JOIN @@ -156,7 +156,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on((`test`.`t4`.`b` = `test`.`t2`.`b`)) where ((`test`.`t3`.`a` > 1) or isnull(`test`.`t3`.`c`)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b`) where `test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b FROM t2 LEFT JOIN @@ -186,7 +186,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on((`test`.`t4`.`b` = `test`.`t2`.`b`)) where (((`test`.`t3`.`a` > 1) or isnull(`test`.`t3`.`c`)) and ((`test`.`t5`.`a` < 3) or isnull(`test`.`t5`.`c`))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b`) where (`test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null) and (`test`.`t5`.`a` < 3 or `test`.`t5`.`c` is null) SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b FROM t2 LEFT JOIN @@ -235,7 +235,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t7`.`b`) and (`test`.`t6`.`b` < 10))) where 1 +Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t7`.`b` and `test`.`t6`.`b` < 10) where 1 SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM (t6, t7) LEFT JOIN @@ -556,7 +556,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b`) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM t0,t1 @@ -652,7 +652,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b`) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) SELECT t9.a,t9.b FROM t9; a b @@ -843,7 +843,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) where (`test`.`t1`.`a` <= 2) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b`) where `test`.`t1`.`a` <= 2 INSERT INTO t2 VALUES (-1,9,0), (-3,10,0), (-2,8,0), (-4,11,0), (-5,15,0); CREATE INDEX idx_b ON t2(b); EXPLAIN EXTENDED @@ -858,7 +858,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t3`.`b` is not null))) where 1 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t3`.`b` and `test`.`t2`.`b` = `test`.`t3`.`b` and `test`.`t2`.`a` > 0 and `test`.`t3`.`b` is not null) where 1 SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM (t3,t4) LEFT JOIN @@ -920,7 +920,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -972,7 +972,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0); CREATE INDEX idx_b ON t8(b); EXPLAIN EXTENDED @@ -1022,7 +1022,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0); CREATE INDEX idx_b ON t1(b); CREATE INDEX idx_a ON t0(a); @@ -1073,7 +1073,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b FROM t0,t1 @@ -1843,7 +1843,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 Using where; Not exists 1 SIMPLE t4 ALL NULL NULL NULL NULL 0 0.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t1`.`a`)) left join `test`.`t4` on((`test`.`t4`.`b` = `test`.`t3`.`a`))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t1`.`a`) left join `test`.`t4` on(`test`.`t4`.`b` = `test`.`t3`.`a`)) on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t3`.`a` is null DROP TABLE t1,t2,t3,t4; SET optimizer_switch=@save_optimizer_switch; End of 5.0 tests diff --git a/mysql-test/r/join_nested_jcl6.result b/mysql-test/r/join_nested_jcl6.result index 3b47645ca79..d1f402054cf 100644 --- a/mysql-test/r/join_nested_jcl6.result +++ b/mysql-test/r/join_nested_jcl6.result @@ -90,7 +90,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) where ((`test`.`t3`.`a` = 1) or isnull(`test`.`t3`.`c`)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` = 1 or `test`.`t3`.`c` is null SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM t2 LEFT JOIN @@ -167,7 +167,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) where ((`test`.`t3`.`a` > 1) or isnull(`test`.`t3`.`c`)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b FROM t2 LEFT JOIN @@ -197,7 +197,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) where (((`test`.`t3`.`a` > 1) or isnull(`test`.`t3`.`c`)) and ((`test`.`t5`.`a` < 3) or isnull(`test`.`t5`.`c`))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where (`test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null) and (`test`.`t5`.`a` < 3 or `test`.`t5`.`c` is null) SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b FROM t2 LEFT JOIN @@ -246,7 +246,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t7`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` is not null))) where 1 +Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t7`.`b` and `test`.`t6`.`b` < 10 and `test`.`t7`.`b` is not null) where 1 SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM (t6, t7) LEFT JOIN @@ -567,7 +567,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM t0,t1 @@ -663,7 +663,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) SELECT t9.a,t9.b FROM t9; a b @@ -854,7 +854,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) where (`test`.`t1`.`a` <= 2) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t1`.`a` <= 2 INSERT INTO t2 VALUES (-1,9,0), (-3,10,0), (-2,8,0), (-4,11,0), (-5,15,0); CREATE INDEX idx_b ON t2(b); EXPLAIN EXTENDED @@ -869,7 +869,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t3`.`b` is not null))) where 1 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t3`.`b` and `test`.`t2`.`b` = `test`.`t3`.`b` and `test`.`t2`.`a` > 0 and `test`.`t3`.`b` is not null) where 1 SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM (t3,t4) LEFT JOIN @@ -931,7 +931,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -983,7 +983,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0); CREATE INDEX idx_b ON t8(b); EXPLAIN EXTENDED @@ -1033,7 +1033,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0); CREATE INDEX idx_b ON t1(b); CREATE INDEX idx_a ON t0(a); @@ -1084,7 +1084,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b FROM t0,t1 @@ -1854,7 +1854,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 100.00 Using where; Not exists; Using join buffer (incremental, BNLH join) 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t3.a 0 0.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t1`.`a`)) left join `test`.`t4` on(((`test`.`t4`.`b` = `test`.`t3`.`a`) and (`test`.`t3`.`a` is not null)))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t1`.`a`) left join `test`.`t4` on(`test`.`t4`.`b` = `test`.`t3`.`a` and `test`.`t3`.`a` is not null)) on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t3`.`a` is null DROP TABLE t1,t2,t3,t4; SET optimizer_switch=@save_optimizer_switch; End of 5.0 tests diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 8b4ee17f20e..7fb3517ecb7 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1386,7 +1386,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE jt5 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index 1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(((`test`.`jt6`.`f1` <> 0) and 1))) on(1) where 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(`test`.`jt6`.`f1` <> 0 and 1)) on(1) where 1 EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 RIGHT JOIN t1 AS jt2 RIGHT JOIN t1 AS jt3 @@ -1403,7 +1403,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index 1 SIMPLE jt1 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(((`test`.`jt6`.`f1` <> 0) and 1)) left join `test`.`t1` `jt1` on(1) where 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(`test`.`jt6`.`f1` <> 0 and 1) left join `test`.`t1` `jt1` on(1) where 1 DROP TABLE t1; # # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field @@ -1746,7 +1746,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t3.pk 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.t2.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`pk` AS `pk`,<`test`.`t2`.`pk`>((select (`test`.`t3`.`pk` + if(isnull(`test`.`t4`.`pk`),0,`test`.`t4`.`pk`)) from `test`.`t3` left join `test`.`t4` on((`test`.`t4`.`pk` = `test`.`t3`.`pk`)) where (`test`.`t3`.`pk` = (`test`.`t2`.`pk` + 1000)) limit 1)) AS `t` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = (`test`.`t1`.`pk` + 1000)) and (`test`.`t1`.`pk` > 1000)) group by `test`.`t2`.`pk` +Note 1003 select `test`.`t2`.`pk` AS `pk`,<`test`.`t2`.`pk`>((select `test`.`t3`.`pk` + if(`test`.`t4`.`pk` is null,0,`test`.`t4`.`pk`) from `test`.`t3` left join `test`.`t4` on(`test`.`t4`.`pk` = `test`.`t3`.`pk`) where `test`.`t3`.`pk` = `test`.`t2`.`pk` + 1000 limit 1)) AS `t` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`pk` + 1000 and `test`.`t1`.`pk` > 1000 group by `test`.`t2`.`pk` select t2.pk, (select t3.pk+if(isnull(t4.pk),0,t4.pk) from t3 left join t4 on t4.pk=t3.pk @@ -2008,7 +2008,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 10 10.00 Using join buffer (flat, BNLH join) 1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.b 27 3.70 Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t2` join `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t2` join `test`.`t1` join `test`.`t3` where `test`.`t3`.`b` = `test`.`t1`.`b` and `test`.`t2`.`b` = `test`.`t1`.`b` PREPARE stmt FROM 'SELECT * FROM (t2 LEFT JOIN t1 ON t1.b = t2.b) JOIN t3 ON t1.b = t3.b'; EXECUTE stmt; @@ -2077,7 +2077,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b` SELECT t1.b, t2.c, t2.d FROM t2 JOIN t1 ON t2.c = t1.a WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 ORDER BY t1.b; @@ -2094,7 +2094,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b` SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 ORDER BY t1.b; @@ -2221,7 +2221,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`i2` = `test`.`t1`.`i1`) and (`test`.`t3`.`i3` = `test`.`t1`.`i1`))) where ((`test`.`t3`.`d3` = 0) or isnull(`test`.`t3`.`d3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1`) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null DROP TABLE t1,t2,t3; # # Bug mdev-6705: wrong on expression after constant row substitution @@ -2241,7 +2241,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`d` = 10)) where ((`test`.`t2`.`c` = 8) and (`test`.`t3`.`d` = 8)) +Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8 SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a WHERE b IN (1,2,3) OR b = d; a b c d @@ -2317,7 +2317,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3` # This should have the same join order like the query above: EXPLAIN EXTENDED SELECT * FROM @@ -2335,6 +2335,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3` drop table t1,t2,t3; SET optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result index 9cdcea379b9..ef749768d4c 100644 --- a/mysql-test/r/join_outer_jcl6.result +++ b/mysql-test/r/join_outer_jcl6.result @@ -1397,7 +1397,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE jt5 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (incremental, BNL join) 1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(((`test`.`jt6`.`f1` <> 0) and 1))) on(1) where 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(`test`.`jt6`.`f1` <> 0 and 1)) on(1) where 1 EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 RIGHT JOIN t1 AS jt2 RIGHT JOIN t1 AS jt3 @@ -1414,7 +1414,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (incremental, BNL join) 1 SIMPLE jt1 index NULL PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(((`test`.`jt6`.`f1` <> 0) and 1)) left join `test`.`t1` `jt1` on(1) where 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on(`test`.`jt6`.`f1` <> 0 and 1) left join `test`.`t1` `jt1` on(1) where 1 DROP TABLE t1; # # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field @@ -1757,7 +1757,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t3.pk 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.t2.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`pk` AS `pk`,<`test`.`t2`.`pk`>((select (`test`.`t3`.`pk` + if(isnull(`test`.`t4`.`pk`),0,`test`.`t4`.`pk`)) from `test`.`t3` left join `test`.`t4` on((`test`.`t4`.`pk` = `test`.`t3`.`pk`)) where (`test`.`t3`.`pk` = (`test`.`t2`.`pk` + 1000)) limit 1)) AS `t` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = (`test`.`t1`.`pk` + 1000)) and (`test`.`t1`.`pk` > 1000)) group by `test`.`t2`.`pk` +Note 1003 select `test`.`t2`.`pk` AS `pk`,<`test`.`t2`.`pk`>((select `test`.`t3`.`pk` + if(`test`.`t4`.`pk` is null,0,`test`.`t4`.`pk`) from `test`.`t3` left join `test`.`t4` on(`test`.`t4`.`pk` = `test`.`t3`.`pk`) where `test`.`t3`.`pk` = `test`.`t2`.`pk` + 1000 limit 1)) AS `t` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`pk` + 1000 and `test`.`t1`.`pk` > 1000 group by `test`.`t2`.`pk` select t2.pk, (select t3.pk+if(isnull(t4.pk),0,t4.pk) from t3 left join t4 on t4.pk=t3.pk @@ -2019,7 +2019,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 10 10.00 Using join buffer (flat, BNLH join) 1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.b 27 3.70 Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t2` join `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t2` join `test`.`t1` join `test`.`t3` where `test`.`t3`.`b` = `test`.`t1`.`b` and `test`.`t2`.`b` = `test`.`t1`.`b` PREPARE stmt FROM 'SELECT * FROM (t2 LEFT JOIN t1 ON t1.b = t2.b) JOIN t3 ON t1.b = t3.b'; EXECUTE stmt; @@ -2088,7 +2088,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b` SELECT t1.b, t2.c, t2.d FROM t2 JOIN t1 ON t2.c = t1.a WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 ORDER BY t1.b; @@ -2105,7 +2105,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b` SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 ORDER BY t1.b; @@ -2232,7 +2232,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t2`.`i2` = `test`.`t1`.`i1`) and (`test`.`t3`.`i3` = `test`.`t1`.`i1`))) where ((`test`.`t3`.`d3` = 0) or isnull(`test`.`t3`.`d3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1`) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null DROP TABLE t1,t2,t3; # # Bug mdev-6705: wrong on expression after constant row substitution @@ -2252,7 +2252,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`d` = 10)) where ((`test`.`t2`.`c` = 8) and (`test`.`t3`.`d` = 8)) +Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8 SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a WHERE b IN (1,2,3) OR b = d; a b c d @@ -2328,7 +2328,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3` # This should have the same join order like the query above: EXPLAIN EXTENDED SELECT * FROM @@ -2346,7 +2346,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3` drop table t1,t2,t3; SET optimizer_switch=@save_optimizer_switch; set join_cache_level=default; diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result index 5eae1af7982..4cd726f0efc 100644 --- a/mysql-test/r/lock_sync.result +++ b/mysql-test/r/lock_sync.result @@ -773,7 +773,7 @@ SET DEBUG_SYNC= 'now SIGNAL dropped'; connection con1; # Reaping: SHOW CREATE VIEW v1 View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`f1`() = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `f1`() = 1 latin1 latin1_swedish_ci Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them connection con2; diff --git a/mysql-test/r/lowercase_view.result b/mysql-test/r/lowercase_view.result index 6bec4f34349..df303807407 100644 --- a/mysql-test/r/lowercase_view.result +++ b/mysql-test/r/lowercase_view.result @@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW v1 AS select X.a from t1 AS X group by X.b having (X.a = 1); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having (`x`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having `x`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1; a DROP VIEW v1; diff --git a/mysql-test/r/myisam_explain_non_select_all.result b/mysql-test/r/myisam_explain_non_select_all.result index fc0f54286a1..e60bb9a8d08 100644 --- a/mysql-test/r/myisam_explain_non_select_all.result +++ b/mysql-test/r/myisam_explain_non_select_all.result @@ -23,7 +23,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` < 10) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -58,7 +58,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` < 10) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -93,7 +93,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -133,7 +133,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = 1) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -175,7 +175,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t11 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where (`test`.`t11`.`a` = 1) +Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where `test`.`t11`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -217,7 +217,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`b` < 3) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -261,7 +261,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 3)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -307,7 +307,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) join `test`.`t2` where ((`test`.`t2`.`b` < 3)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) join `test`.`t2` where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -441,7 +441,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t11 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where (`test`.`t11`.`a` > 1) +Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where `test`.`t11`.`a` > 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -476,7 +476,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 1 LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 1) limit 1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1 limit 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -611,7 +611,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` < 3) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -676,7 +676,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 0) order by `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -713,7 +713,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (@a:=`test`.`t1`.`a`) order by `test`.`t1`.`a` limit 1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -800,7 +800,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 100.00 Using index 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b2,test.t1.b1 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`a2` = `test`.`t1`.`a1`) and (`test`.`t3`.`a3` = `test`.`t2`.`b2`) and (`test`.`t3`.`b3` = `test`.`t1`.`b1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a2` = `test`.`t1`.`a1` and `test`.`t3`.`a3` = `test`.`t2`.`b2` and `test`.`t3`.`b3` = `test`.`t1`.`b1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -888,7 +888,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(select `test`.`t2`.`a2` from `test`.`t2` where ((`test`.`t2`.`a2` > 2) and ((`test`.`t1`.`a1`) = `test`.`t2`.`a2`))))) +Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and (`test`.`t1`.`a1`) = `test`.`t2`.`a2`))) # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -926,7 +926,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`a2` > 2) and (`test`.`t1`.`a1` = `test`.`t2`.`a2`)) +Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1034,7 +1034,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1187,7 +1187,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 8 100.00 Using index condition Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where ((`test`.`t1`.`i` > 10) and (`test`.`t1`.`i` <= 18)) order by `test`.`t1`.`i` limit 5 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1226,7 +1226,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL i NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where ((`test`.`t1`.`i` > 10) and (`test`.`t1`.`i` <= 18)) order by `test`.`t1`.`i` limit 5 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1271,7 +1271,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1317,7 +1317,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1358,7 +1358,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1404,7 +1404,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1451,7 +1451,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where ((`test`.`t2`.`key1` < 13) or (`test`.`t2`.`key2` < 14)) order by `test`.`t2`.`key1` +Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1498,7 +1498,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where ((`test`.`t2`.`i` > 10) and (`test`.`t2`.`i` <= 18)) order by `test`.`t2`.`i` desc limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1626,7 +1626,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 8 100.00 Using index condition Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where ((`test`.`t2`.`i` > 10) and (`test`.`t2`.`i` <= 18)) order by `test`.`t2`.`i` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1668,7 +1668,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL i NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where ((`test`.`t2`.`i` > 10) and (`test`.`t2`.`i` <= 18)) order by `test`.`t2`.`i` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1714,7 +1714,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1761,7 +1761,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1803,7 +1803,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1849,7 +1849,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where (`test`.`t2`.`b` = 10) order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1896,7 +1896,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort Warnings: -Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where ((`test`.`t2`.`key1` < 13) or (`test`.`t2`.`key2` < 14)) order by `test`.`t2`.`key1` +Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -1943,7 +1943,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC L id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where ((`test`.`t2`.`i` > 10) and (`test`.`t2`.`i` <= 18)) order by `test`.`t2`.`i` desc limit 5 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2076,7 +2076,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref c1_idx c1_idx 2 const 2 100.00 Using index condition; Using where; Using filesort Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where (`test`.`t1`.`c1_idx` = 'y') order by `test`.`t1`.`pk` desc limit 2 +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2116,7 +2116,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref c1_idx c1_idx 2 const 2 100.00 Using index condition; Using where; Using filesort Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where (`test`.`t1`.`c1_idx` = 'y') order by `test`.`t1`.`pk` desc limit 2 +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2159,7 +2159,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 34; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 34) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 34 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2237,7 +2237,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`c3` AS `c3`,NULL AS `c1`,NULL AS `c2` from `test`.`t1` where (`test`.`t1`.`c3` = 10) +Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`c3` AS `c3`,NULL AS `c1`,NULL AS `c2` from `test`.`t1` where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value Handler_read_rnd_next 1 @@ -2281,7 +2281,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL IDX NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 -Note 1003 select <`test`.`t1`.`f1`>((select max(`test`.`t2`.`f4`) from `test`.`t2` where (`test`.`t2`.`f3` = `test`.`t1`.`f1`))) AS `(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1)` from `test`.`t1` +Note 1003 select <`test`.`t1`.`f1`>((select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`)) AS `(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1)` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2344,7 +2344,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` `t11` join `test`.`t1` `t12` where (`test`.`t11`.`a` > 0) +Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` `t11` join `test`.`t1` `t12` where `test`.`t11`.`a` > 0 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2382,7 +2382,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` where (`test`.`t11`.`a` = `test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` where `test`.`t11`.`a` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2421,7 +2421,7 @@ EXPLAIN EXTENDED SELECT * FROM v1 WHERE a < 4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` < 4) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 4 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2465,7 +2465,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,(`test`.`t1`.`b` + 1) AS `c` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`x`) +Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` + 1 AS `c` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2510,7 +2510,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,(`test`.`t1`.`b` + 1) AS `c` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`x`) +Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` + 1 AS `c` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2808,7 +2808,7 @@ EXPLAIN EXTENDED SELECT a t1 FROM t1 WHERE a>10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 5 20.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where (`test`.`t1`.`a` > 10) +Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a` > 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: @@ -2840,7 +2840,7 @@ EXPLAIN EXTENDED SELECT a t1 FROM t1 WHERE a>10 ORDER BY a+20; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 5 20.00 Using where; Using index; Using filesort Warnings: -Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where (`test`.`t1`.`a` > 10) order by (`test`.`t1`.`a` + 20) +Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a` > 10 order by `test`.`t1`.`a` + 20 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value # Status of "equivalent" SELECT query execution: diff --git a/mysql-test/r/mysql57_virtual.result b/mysql-test/r/mysql57_virtual.result index 3d5ba5f99cf..8186aa7cdec 100644 --- a/mysql-test/r/mysql57_virtual.result +++ b/mysql-test/r/mysql57_virtual.result @@ -5,8 +5,8 @@ SHOW CREATE TABLE mysql57_virtual; Table Create Table mysql57_virtual CREATE TABLE `mysql57_virtual` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, - `c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + 3) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into mysql57_virtual (a) values (1),(2); select * from mysql57_virtual; @@ -20,8 +20,8 @@ SHOW CREATE TABLE mysql57_virtual; Table Create Table mysql57_virtual CREATE TABLE `mysql57_virtual` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, - `c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + 3) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='I am now a MariaDB table' DROP TABLE mysql57_virtual; # @@ -32,7 +32,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) STORED, - `c` int(11) GENERATED ALWAYS AS ((`a` + 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) STORED, + `c` int(11) GENERATED ALWAYS AS (`a` + 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index fcfab3e068a..3b7aa3b2e5c 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2086,7 +2086,7 @@ SET character_set_client = @saved_cs_client; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like 'a%') */ +/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` like 'a%' */ /*!50002 WITH CASCADED CHECK OPTION */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; @@ -2254,7 +2254,7 @@ SET character_set_client = @saved_cs_client; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like 'a%') */ +/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` like 'a%' */ /*!50002 WITH CASCADED CHECK OPTION */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; @@ -2388,7 +2388,7 @@ SET character_set_client = @saved_cs_client; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7)) */; +/*!50001 VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where `v3`.`b` in (1,2,3,4,5,6,7) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -2402,7 +2402,7 @@ SET character_set_client = @saved_cs_client; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1 */; +/*!50001 VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where `v1`.`a` = `v3`.`a` and `v3`.`b` = 3 limit 1 */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -3414,7 +3414,7 @@ mysqldump { /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */; +/*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,`t`.`qty` * `t`.`price` AS `value` from `t` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result index 85cc6235e75..89b3881eb5d 100644 --- a/mysql-test/r/named_pipe.result +++ b/mysql-test/r/named_pipe.result @@ -1509,7 +1509,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/negation_elimination.result b/mysql-test/r/negation_elimination.result index aea6518b676..1b08baee60a 100644 --- a/mysql-test/r/negation_elimination.result +++ b/mysql-test/r/negation_elimination.result @@ -482,13 +482,13 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE NOT ((NOT a) XOR (a)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL a 5 NULL 21 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` xor `test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` xor `test`.`t1`.`a` # Should be simplified to "...WHERE (a XOR a) EXPLAIN EXTENDED SELECT * FROM t1 WHERE NOT (a XOR (NOT a)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL a 5 NULL 21 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` xor `test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` xor `test`.`t1`.`a` # End XOR delete from t1 where a > 3; select a, not(not(a)) from t1; @@ -502,5 +502,5 @@ explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like " id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a` <> 0) AS `not(not(a))`,((`test`.`t1`.`a` > 2) or (`test`.`t1`.`a` <> 0)) AS `not(a <= 2 and not(a))`,(`test`.`t1`.`a` like '1') AS `not(a not like "1")`,(`test`.`t1`.`a` in (1,2)) AS `not (a not in (1,2))`,(`test`.`t1`.`a` = 2) AS `not(a != 2)` from `test`.`t1` where (`test`.`t1`.`a` <> 0) having (`test`.`t1`.`a` <> 0) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a` <> 0 AS `not(not(a))`,`test`.`t1`.`a` > 2 or `test`.`t1`.`a` <> 0 AS `not(a <= 2 and not(a))`,`test`.`t1`.`a` like '1' AS `not(a not like "1")`,`test`.`t1`.`a` in (1,2) AS `not (a not in (1,2))`,`test`.`t1`.`a` = 2 AS `not(a != 2)` from `test`.`t1` where `test`.`t1`.`a` <> 0 having `test`.`t1`.`a` <> 0 drop table t1; diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 1686bc7dbd3..217c227fa7e 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -6,7 +6,7 @@ explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnu id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,'TRUE') AS `ifnull(null,"TRUE")`,ifnull('TRUE','ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` +Note 1003 select NULL AS `NULL`,NULL AS `NULL`,NULL is null AS `isnull(null)`,1 / 0 is null AS `isnull(1/0)`,1 / 0 = NULL is null AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,'TRUE') AS `ifnull(null,"TRUE")`,ifnull('TRUE','ERROR') AS `ifnull("TRUE","ERROR")`,1 / 0 is null AS `1/0 is null`,1 is not null AS `1 is not null` select 1 | NULL,1 & NULL,1+NULL,1-NULL; 1 | NULL 1 & NULL 1+NULL 1-NULL NULL NULL NULL NULL @@ -32,7 +32,7 @@ explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` +Note 1003 select 2 between NULL and 1 AS `2 between null and 1`,2 between 3 and NULL AS `2 between 3 AND NULL`,NULL between 1 and 2 AS `NULL between 1 and 2`,2 between NULL and 3 AS `2 between NULL and 3`,2 between 1 and NULL AS `2 between 1 AND null` SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0; NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0 NULL NULL NULL NULL NULL NULL @@ -1372,7 +1372,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND NULLIF(10.1,a) IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL ELSE 10.1 END IS NULL; a 2010 @@ -1380,7 +1380,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND CASE WHEN 10.1=a THEN NULL EL id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 DROP TABLE t1; # Two warnings expected CREATE TABLE t1 AS SELECT @@ -1409,7 +1409,7 @@ EXPLAIN EXTENDED SELECT NULLIF(a,_utf8'a' COLLATE utf8_bin) IS NULL AS expr FROM id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 select isnull((case when convert(`test`.`t1`.`a` using utf8) = (_utf8'a' collate utf8_bin) then NULL else `test`.`t1`.`a` end)) AS `expr` from `test`.`t1` +Note 1003 select (case when convert(`test`.`t1`.`a` using utf8) = _utf8'a' collate utf8_bin then NULL else `test`.`t1`.`a` end) is null AS `expr` from `test`.`t1` DROP TABLE t1; # # MDEV-8740 Wrong result for SELECT..WHERE year_field=10 AND NULLIF(year_field,2011.1)='2011' @@ -1432,13 +1432,13 @@ SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)='2011'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2010) and ((case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = '2011')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 and (case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = '2011' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)=CONCAT('2011',RAND()); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2010) and ((case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = concat('2011',rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 and (case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = concat('2011',rand()) DROP TABLE t1; # # MDEV-8754 Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020' @@ -1459,13 +1459,13 @@ SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2020) and ((case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = '2020')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2020 and (case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = '2020' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)=CONCAT('2020',RAND()); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 2020) and ((case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = concat('2020',rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2020 and (case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = concat('2020',rand()) DROP TABLE t1; # # MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x @@ -1584,7 +1584,7 @@ SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= 0) is not null) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` is not null >= 0 is not null SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; c1 1 diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 262529ef0ce..b4d78ac8347 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -2570,7 +2570,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE r range PRIMARY PRIMARY 4 NULL 12 100.00 Using where; Using index 1 SIMPLE s eq_ref PRIMARY PRIMARY 4 test.r.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`r`.`a` AS `a`,`test`.`s`.`a` AS `a` from `test`.`t1` `r` join `test`.`t1` `s` where ((`test`.`s`.`a` = `test`.`r`.`a`) and ((`test`.`r`.`a` in (2,9)) or ((`test`.`r`.`a` < 100) and (`test`.`r`.`a` <> 0)))) order by 1 limit 10 +Note 1003 select `test`.`r`.`a` AS `a`,`test`.`s`.`a` AS `a` from `test`.`t1` `r` join `test`.`t1` `s` where `test`.`s`.`a` = `test`.`r`.`a` and (`test`.`r`.`a` in (2,9) or `test`.`r`.`a` < 100 and `test`.`r`.`a` <> 0) order by 1 limit 10 SELECT * FROM t1 r JOIN t1 s ON r.a = s.a WHERE s.a IN (2,9) OR s.a < 100 AND s.a != 0 ORDER BY 1 LIMIT 10; @@ -2637,7 +2637,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 5 100.00 Using index 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i1 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`i2` = `test`.`t1`.`i1`) order by `test`.`t1`.`i1` limit 5 +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`i2` = `test`.`t1`.`i1` order by `test`.`t1`.`i1` limit 5 SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2 LEFT JOIN t3 ON t2.i2 = t3.i3 ORDER BY t1.i1 LIMIT 5; @@ -2678,28 +2678,28 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`b` AS `field1` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` +Note 1003 select `test`.`t2`.`b` AS `field1` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b` explain extended SELECT t2.b, t1.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b, t2.b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b` explain extended SELECT t2.b,t1.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` +Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b` explain extended SELECT t2.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` +Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b` drop table t1,t2; End of 5.2 tests # diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index bc3598131e2..59866040d05 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -77,7 +77,7 @@ EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a > 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 1) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`a` > 1 DROP TABLE t1; # # Bug#57778: failed primary key add to partitioned innodb table diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index fe19473f8e4..0fb24b74218 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -2872,7 +2872,7 @@ explain extended select * from t2 where b = 6; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref b b 5 const 96 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = 6) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = 6 explain partitions select * from t2 where b = 6; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 96 @@ -2880,7 +2880,7 @@ explain extended select * from t2 where b in (1,3,5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 51.65 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (1,3,5)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` in (1,3,5) explain partitions select * from t2 where b in (1,3,5); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where @@ -2888,7 +2888,7 @@ explain extended select * from t2 where b in (2,4,6); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 31.65 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (2,4,6)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` in (2,4,6) explain partitions select * from t2 where b in (2,4,6); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where @@ -2896,7 +2896,7 @@ explain extended select * from t2 where b in (7,8,9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 19.12 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` in (7,8,9)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` in (7,8,9) explain partitions select * from t2 where b in (7,8,9); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where @@ -2904,7 +2904,7 @@ explain extended select * from t2 where b > 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 29.23 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` > 5) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` > 5 explain partitions select * from t2 where b > 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where @@ -2912,7 +2912,7 @@ explain extended select * from t2 where b > 5 and b < 8; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 28.13 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 5) and (`test`.`t2`.`b` < 8)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` > 5 and `test`.`t2`.`b` < 8 explain partitions select * from t2 where b > 5 and b < 8; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where @@ -2920,7 +2920,7 @@ explain extended select * from t2 where b > 5 and b < 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range b b 5 NULL 96 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 5) and (`test`.`t2`.`b` < 7)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` > 5 and `test`.`t2`.`b` < 7 explain partitions select * from t2 where b > 5 and b < 7; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 range b b 5 NULL 96 Using where @@ -2928,7 +2928,7 @@ explain extended select * from t2 where b > 0 and b < 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 53.19 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b` > 0) and (`test`.`t2`.`b` < 5)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` > 0 and `test`.`t2`.`b` < 5 explain partitions select * from t2 where b > 0 and b < 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where diff --git a/mysql-test/r/pool_of_threads.result b/mysql-test/r/pool_of_threads.result index f2e08b12359..f5cef38a904 100644 --- a/mysql-test/r/pool_of_threads.result +++ b/mysql-test/r/pool_of_threads.result @@ -1510,7 +1510,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index faefd0805c8..4011985103a 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1783,7 +1783,7 @@ prepare stmt from "create view v1 (c) as select b+1 from t1"; execute stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci select * from v1; c drop view v1; @@ -1791,7 +1791,7 @@ execute stmt; deallocate prepare stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci select * from v1; c drop view v1; @@ -1799,7 +1799,7 @@ prepare stmt from "create view v1 (c,d,e,f) as select a,b,a in (select a+2 from execute stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select `t1`.`a` + 2 from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci select * from v1; c d e f drop view v1; @@ -1807,7 +1807,7 @@ execute stmt; deallocate prepare stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select `t1`.`a` + 2 from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci select * from v1; c d e f drop view v1; @@ -1853,7 +1853,7 @@ prepare stmt from "create view v1 (x) as select a from t1 where a > 1"; execute stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `x` from `t1` where (`t1`.`a` > 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `x` from `t1` where `t1`.`a` > 1 latin1 latin1_swedish_ci select * from v1; x drop view v1; @@ -1861,7 +1861,7 @@ execute stmt; deallocate prepare stmt; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `x` from `t1` where (`t1`.`a` > 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `x` from `t1` where `t1`.`a` > 1 latin1 latin1_swedish_ci select * from v1; x drop view v1; @@ -4067,9 +4067,9 @@ DROP TABLE t1, t2; # CREATE TABLE t1 (a INT); PREPARE stmt FROM "SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1"; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '18446744073709551615 + 1' SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '18446744073709551615 + 1' drop table t1; # End of 5.3 tests # diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result index a665224f59d..3160ec33690 100644 --- a/mysql-test/r/ps_ddl.result +++ b/mysql-test/r/ps_ddl.result @@ -1310,7 +1310,7 @@ create algorithm=temptable view v1 as select a*a as a2 from t1; # statement code, and should not raise ER_PS_INVALIDATED errors show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`a` * `t1`.`a`) AS `a2` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` * `t1`.`a` AS `a2` from `t1` latin1 latin1_swedish_ci prepare stmt from "select * from v1"; insert into t1 values (1), (2), (3); execute stmt; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 5adb8225b38..5027fffe047 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2258,26 +2258,26 @@ explain extended select * from t2 where (b > 25 and b < 15) or a<44; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`a` < 44 # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE: explain extended select * from t2 where a < 44 or (b > 25 and b < 15); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`a` < 44 # Here, conditions b will not be removed, because "c<44" is not sargable # and hence (b.. and .. b) part is not analyzed at all: explain extended select * from t2 where c < 44 or (b > 25 and b < 15); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` < 44 or `test`.`t2`.`b` > 25 and `test`.`t2`.`b` < 15 # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE: explain extended select * from t2 where (b > 25 and b < 15) or c < 44; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` < 44 # Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE: explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index 4ef7c0b658c..7d009070150 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2260,26 +2260,26 @@ explain extended select * from t2 where (b > 25 and b < 15) or a<44; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`a` < 44 # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE: explain extended select * from t2 where a < 44 or (b > 25 and b < 15); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`a` < 44 # Here, conditions b will not be removed, because "c<44" is not sargable # and hence (b.. and .. b) part is not analyzed at all: explain extended select * from t2 where c < 44 or (b > 25 and b < 15); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` < 44 or `test`.`t2`.`b` > 25 and `test`.`t2`.`b` < 15 # EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE: explain extended select * from t2 where (b > 25 and b < 15) or c < 44; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` < 44 # Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE: explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 9a19c3b0604..9b796c24354 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -49,7 +49,7 @@ explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,N id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))` +Note 1003 select (1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))` select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5))); row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5))) 0 @@ -373,7 +373,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` = `test`.`t2`.`b` + 1 SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b+1); a b a b c 1 2 1 1 1 @@ -385,7 +385,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 index NULL PRIMARY 12 NULL 7 100.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t1`.`a` - 1) = (`test`.`t2`.`a` - 1)) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` - 1 = `test`.`t2`.`a` - 1 and `test`.`t1`.`b` = `test`.`t2`.`b` + 1 SELECT * FROM t1,t2 WHERE (t1.a-1,t1.b)=(t2.a-1,t2.b+1); a b a b c 1 2 1 1 2 @@ -411,7 +411,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 12 test.t1.a,const,const 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`c` = 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = 2 and `test`.`t2`.`c` = 1 SELECT * FROM t1,t2 WHERE (t2.a,(t2.b,t2.c))=(t1.a,(2,1)); a b a b c 1 1 1 2 1 @@ -421,7 +421,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 12 test.t1.a,const,const 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`c` = 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = 2 and `test`.`t2`.`c` = 1 SELECT * FROM t1,t2 WHERE t2.a=t1.a AND (t2.b,t2.c)=(2,1); a b a b c 1 1 1 2 1 @@ -507,12 +507,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 10 and `test`.`t1`.`b` = 10 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 10 and `test`.`t1`.`b` = 10 DROP TABLE t1; # # MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index f8ff343e8bb..a7c4c76dc8c 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1510,7 +1510,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -4395,12 +4395,12 @@ EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 DROP TABLE t1; # # Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when @@ -4767,7 +4767,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1 HAVING a = 1 + 1; a 2 @@ -4775,7 +4775,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1, t2 WHERE a = b + (1 + 1); a b 4 2 @@ -4784,7 +4784,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where (`test`.`t1`.`a` = ((2 + (1 + 1)))) +Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where `test`.`t1`.`a` = (2 + 1 + 1) SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; b a 2 3 @@ -4798,7 +4798,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00')) CREATE FUNCTION f1() RETURNS INT DETERMINISTIC BEGIN SET @cnt := @cnt + 1; @@ -4815,7 +4815,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = (`f1`())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5383,7 +5383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index Warnings: -Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8) +Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` = 8 SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) WHERE 1 IS NULL OR b < 33 AND b = c; a b c @@ -5413,7 +5413,7 @@ SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); a b 5 11 @@ -5422,7 +5422,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); a b 5 11 @@ -5431,7 +5431,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); a b 5 11 @@ -5448,7 +5448,7 @@ SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 5) and (`test`.`t1`.`a` = 5)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 5 and `test`.`t1`.`a` = 5 SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); a b DROP TABLE t1; @@ -5466,7 +5466,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where ((`test`.`t1`.`b` = 'k') and (`test`.`t1`.`a` = 136)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where `test`.`t1`.`b` = 'k' and `test`.`t1`.`a` = 136 SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b)); a b c d DROP TABLE t1,t2; @@ -5507,7 +5507,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6)) +Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where `test`.`t1`.`a1` = 1 and `test`.`t1`.`b1` = 6 INSERT INTO t1 VALUES (3,1,6); SELECT * FROM t1, t2 WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index c5f28395535..19d1733c52e 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -1521,7 +1521,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -4406,12 +4406,12 @@ EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 DROP TABLE t1; # # Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when @@ -4778,7 +4778,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1 HAVING a = 1 + 1; a 2 @@ -4786,7 +4786,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1, t2 WHERE a = b + (1 + 1); a b 4 2 @@ -4795,7 +4795,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where (`test`.`t1`.`a` = ((2 + (1 + 1)))) +Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where `test`.`t1`.`a` = (2 + 1 + 1) SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; b a 2 3 @@ -4809,7 +4809,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00')) CREATE FUNCTION f1() RETURNS INT DETERMINISTIC BEGIN SET @cnt := @cnt + 1; @@ -4826,7 +4826,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = (`f1`())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5394,7 +5394,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index Warnings: -Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8) +Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` = 8 SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) WHERE 1 IS NULL OR b < 33 AND b = c; a b c @@ -5424,7 +5424,7 @@ SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); a b 5 11 @@ -5433,7 +5433,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); a b 5 11 @@ -5442,7 +5442,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); a b 5 11 @@ -5459,7 +5459,7 @@ SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 5) and (`test`.`t1`.`a` = 5)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 5 and `test`.`t1`.`a` = 5 SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); a b DROP TABLE t1; @@ -5477,7 +5477,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where ((`test`.`t1`.`b` = 'k') and (`test`.`t1`.`a` = 136)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where `test`.`t1`.`b` = 'k' and `test`.`t1`.`a` = 136 SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b)); a b c d DROP TABLE t1,t2; @@ -5518,7 +5518,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6)) +Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where `test`.`t1`.`a1` = 1 and `test`.`t1`.`b1` = 6 INSERT INTO t1 VALUES (3,1,6); SELECT * FROM t1, t2 WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index f8ff343e8bb..a7c4c76dc8c 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -1510,7 +1510,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -4395,12 +4395,12 @@ EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 EXPLAIN EXTENDED SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using index condition; Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 1)) limit 2 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 1 limit 2 DROP TABLE t1; # # Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when @@ -4767,7 +4767,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1 HAVING a = 1 + 1; a 2 @@ -4775,7 +4775,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = ((1 + 1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having `test`.`t1`.`a` = (1 + 1) SELECT * FROM t1, t2 WHERE a = b + (1 + 1); a b 4 2 @@ -4784,7 +4784,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where (`test`.`t1`.`a` = ((2 + (1 + 1)))) +Note 1003 select `test`.`t1`.`a` AS `a`,2 AS `b` from `test`.`t1` where `test`.`t1`.`a` = (2 + 1 + 1) SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; b a 2 3 @@ -4798,7 +4798,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00'))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > (unix_timestamp('2009-03-10 00:00:00')) CREATE FUNCTION f1() RETURNS INT DETERMINISTIC BEGIN SET @cnt := @cnt + 1; @@ -4815,7 +4815,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = (`f1`())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5383,7 +5383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index Warnings: -Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8) +Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`c` = 8 SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) WHERE 1 IS NULL OR b < 33 AND b = c; a b c @@ -5413,7 +5413,7 @@ SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); a b 5 11 @@ -5422,7 +5422,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); a b 5 11 @@ -5431,7 +5431,7 @@ SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and (`test`.`t1`.`b` <> 1)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 5 and `test`.`t1`.`b` <> 1 SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); a b 5 11 @@ -5448,7 +5448,7 @@ SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 5) and (`test`.`t1`.`a` = 5)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 5 and `test`.`t1`.`a` = 5 SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); a b DROP TABLE t1; @@ -5466,7 +5466,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where ((`test`.`t1`.`b` = 'k') and (`test`.`t1`.`a` = 136)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,'k' AS `c`,'k' AS `d` from `test`.`t1` where `test`.`t1`.`b` = 'k' and `test`.`t1`.`a` = 136 SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b)); a b c d DROP TABLE t1,t2; @@ -5507,7 +5507,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6)) +Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where `test`.`t1`.`a1` = 1 and `test`.`t1`.`b1` = 6 INSERT INTO t1 VALUES (3,1,6); SELECT * FROM t1, t2 WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 4238359c201..de2403918c6 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -27,13 +27,13 @@ select * from t1 where a is null; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where isnull(`test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null explain extended select * from t1 where a is not null; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` is not null) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null drop table t1; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP DATABASE IF EXISTS dbt3_s001; @@ -80,7 +80,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`part`.`p_size` = 9) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_type` like '%TIN') and (`dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)))))) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` set optimizer_use_condition_selectivity=4; explain extended select @@ -121,7 +121,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`part`.`p_size` = 9) and (`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_type` like '%TIN') and (`dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)))))) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` === Q15 === create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) @@ -145,7 +145,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY ALL NULL NULL NULL NULL 268 100.00 4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -166,7 +166,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY ALL NULL NULL NULL NULL 268 100.00 4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -193,7 +193,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -281,7 +281,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -328,7 +328,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index 2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -362,7 +362,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 .l_orderkey 4 100.00 2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -400,7 +400,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 SUBQUERY customer ALL NULL NULL NULL NULL 150 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where ((substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and (`dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where ((`dbt3_s001`.`customer`.`c_acctbal` > 0.00) and (substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25'))))) and (not((1,exists(select 1 from `dbt3_s001`.`orders` where (`dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)))))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) +Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,exists(select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -441,7 +441,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 SUBQUERY customer ALL NULL NULL NULL NULL 150 91.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where ((substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and (`dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where ((`dbt3_s001`.`customer`.`c_acctbal` > 0.00) and (substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25'))))) and (not((1,exists(select 1 from `dbt3_s001`.`orders` where (`dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)))))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) +Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,exists(select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -491,7 +491,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -544,7 +544,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -599,7 +599,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -654,7 +654,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -709,7 +709,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -754,7 +754,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`d` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t1`.`b` SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); a b c d 0 7 0 7 @@ -775,7 +775,7 @@ select * from t1 where a < 1 and a > 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` < 1) and (`test`.`t1`.`a` > 7)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a set optimizer_use_condition_selectivity=3; @@ -833,7 +833,7 @@ explain extended select * from t1 where a=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; set histogram_size=@save_histogram_size; set histogram_type=@save_histogram_type; @@ -902,7 +902,7 @@ SELECT * FROM t1 WHERE a > 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 75.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 3) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 SELECT * FROM t1 WHERE a > 3; a 9 @@ -985,7 +985,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 2 SUBQUERY t1 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((((1,exists(select 1 from `test`.`t1` join `test`.`t2`))) and (`test`.`t1`.`a` <> `test`.`t2`.`b`)) or (`test`.`t1`.`a` <= 4)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((1,exists(select 1 from `test`.`t1` join `test`.`t2`))) and `test`.`t1`.`a` <> `test`.`t2`.`b` or `test`.`t1`.`a` <= 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; @@ -1008,25 +1008,25 @@ SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 28.57 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where isnull(`test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NOT NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 71.43 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` is not null) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a IS NOT NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (isnull(`test`.`t1`.`a`) or (`test`.`t1`.`a` is not null)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a < 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 69.39 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (isnull(`test`.`t1`.`a`) or (`test`.`t1`.`a` < 5)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` < 5 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; @@ -1135,7 +1135,7 @@ explain extended select * from t1 where a between 5 and 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` between 5 and 7) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 alter table t1 change column a a int; analyze table t1; Table Op Msg_type Msg_text @@ -1146,7 +1146,7 @@ explain extended select * from t1 where a between 5 and 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` between 5 and 7) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1; set use_stat_tables=@save_use_stat_tables; @@ -1179,7 +1179,7 @@ WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`c3` = 'b'))) where 0 +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`c3` = 'b')) where 0 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; # @@ -1246,7 +1246,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE language ALL NULL NULL NULL NULL 6 0.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE continent ALL NULL NULL NULL NULL 6 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where ((`test`.`language`.`lang_group` = `test`.`country`.`country_group`) and isnull(`test`.`country`.`country_group`)) +Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where `test`.`language`.`lang_group` = `test`.`country`.`country_group` and `test`.`country`.`country_group` is null set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table language, country, continent; set use_stat_tables=@save_use_stat_tables; @@ -1294,7 +1294,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref c,d c 5 test.t1.b 5 100.00 1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`d`) and (`test`.`t3`.`b` < 5) and (`test`.`t1`.`a` < 2000)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`a` = `test`.`t2`.`d` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1311,7 +1311,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref c,d d 5 test.t3.a 7 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 2.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t1`.`b` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = `test`.`t3`.`a`) and (`test`.`t3`.`b` < 5) and (`test`.`t1`.`a` < 2000)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t1`.`b` = `test`.`t2`.`c` and `test`.`t2`.`d` = `test`.`t3`.`a` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1372,14 +1372,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 0.99 Using where 1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 explain extended select * from t1 straight_join t2 where t1.a=t2.a and t2.a<10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 0.99 Using where 1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1405,7 +1405,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE a ALL NULL NULL NULL NULL 1000 100.00 Using where 1 SIMPLE b ALL NULL NULL NULL NULL 1000 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where isnull(`test`.`a`.`a`) +Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where `test`.`a`.`a` is null set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1433,7 +1433,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref PRIMARY,b b 5 const 1 100.00 Using index condition; Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <> 'USARussian') and isnull(`test`.`t1`.`b`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <> 'USARussian' and `test`.`t1`.`b` is null SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; a b i diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 2c1913f0929..3ebcb9101bd 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -30,13 +30,13 @@ select * from t1 where a is null; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where isnull(`test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null explain extended select * from t1 where a is not null; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` is not null) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null drop table t1; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP DATABASE IF EXISTS dbt3_s001; @@ -83,7 +83,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`part`.`p_size` = 9) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_type` like '%TIN') and (`dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)))))) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` set optimizer_use_condition_selectivity=4; explain extended select @@ -124,7 +124,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`part`.`p_size` = 9) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_type` like '%TIN') and (`dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where ((`dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey`) and (`dbt3_s001`.`region`.`r_name` = 'ASIA') and (`dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)))))) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` === Q15 === create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) @@ -148,7 +148,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY ALL NULL NULL NULL NULL 229 100.00 4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY ALL NULL NULL NULL NULL 228 100.00 4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` +Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -196,7 +196,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -240,7 +240,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -284,7 +284,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where ((`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`part`.`p_brand` <> 'Brand#11') and (not((`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%'))) and (`dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8)) and (not(<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where (`dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%') ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`))))))))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -331,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index 2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00 Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -365,7 +365,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 .l_orderkey 4 100.00 2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00 Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -403,7 +403,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 SUBQUERY customer ALL NULL NULL NULL NULL 150 100.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where ((substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and (`dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where ((`dbt3_s001`.`customer`.`c_acctbal` > 0.00) and (substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25'))))) and (not((1,exists(select 1 from `dbt3_s001`.`orders` where (`dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)))))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) +Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,exists(select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -444,7 +444,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 SUBQUERY customer ALL NULL NULL NULL NULL 150 91.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where ((substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and (`dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where ((`dbt3_s001`.`customer`.`c_acctbal` > 0.00) and (substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25'))))) and (not((1,exists(select 1 from `dbt3_s001`.`orders` where (`dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)))))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) +Note 1003 select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,exists(select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey`)) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -494,7 +494,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -548,7 +548,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -604,7 +604,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -660,7 +660,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -716,7 +716,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < ((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -761,7 +761,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 1 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t2`.`d` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t1`.`b` SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); a b c d 0 7 0 7 @@ -782,7 +782,7 @@ select * from t1 where a < 1 and a > 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` < 1) and (`test`.`t1`.`a` > 7)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a set optimizer_use_condition_selectivity=3; @@ -806,7 +806,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 0.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t1`.`a` > 3)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` > 3 select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); a drop table t1,t2; @@ -842,7 +842,7 @@ explain extended select * from t1 where a=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; set histogram_size=@save_histogram_size; set histogram_type=@save_histogram_type; @@ -911,7 +911,7 @@ SELECT * FROM t1 WHERE a > 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 75.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 3) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 SELECT * FROM t1 WHERE a > 3; a 9 @@ -944,7 +944,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1 0.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` > 9) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` > 9 SELECT * FROM t1, t2 WHERE a > 9; a b c set optimizer_switch=@save_optimizer_switch; @@ -995,7 +995,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 2 SUBQUERY t1 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((((1,exists(select 1 from `test`.`t1` join `test`.`t2`))) and (`test`.`t1`.`a` <> `test`.`t2`.`b`)) or (`test`.`t1`.`a` <= 4)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((1,exists(select 1 from `test`.`t1` join `test`.`t2`))) and `test`.`t1`.`a` <> `test`.`t2`.`b` or `test`.`t1`.`a` <= 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; @@ -1018,25 +1018,25 @@ SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 28.57 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where isnull(`test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NOT NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 71.43 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` is not null) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a IS NOT NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (isnull(`test`.`t1`.`a`) or (`test`.`t1`.`a` is not null)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a < 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 14 69.39 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (isnull(`test`.`t1`.`a`) or (`test`.`t1`.`a` < 5)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` < 5 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; @@ -1145,7 +1145,7 @@ explain extended select * from t1 where a between 5 and 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` between 5 and 7) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 alter table t1 change column a a int; analyze table t1; Table Op Msg_type Msg_text @@ -1156,7 +1156,7 @@ explain extended select * from t1 where a between 5 and 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` between 5 and 7) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1; set use_stat_tables=@save_use_stat_tables; @@ -1189,7 +1189,7 @@ WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`c3` = 'b'))) where 0 +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`c3` = 'b')) where 0 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; # @@ -1256,7 +1256,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE language ALL NULL NULL NULL NULL 6 0.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE continent ALL NULL NULL NULL NULL 6 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where ((`test`.`language`.`lang_group` = `test`.`country`.`country_group`) and isnull(`test`.`country`.`country_group`)) +Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where `test`.`language`.`lang_group` = `test`.`country`.`country_group` and `test`.`country`.`country_group` is null set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table language, country, continent; set use_stat_tables=@save_use_stat_tables; @@ -1304,7 +1304,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref c,d c 5 test.t1.b 5 100.00 1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t3`.`a` = `test`.`t2`.`d`) and (`test`.`t3`.`b` < 5) and (`test`.`t1`.`a` < 2000)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`a` = `test`.`t2`.`d` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1321,7 +1321,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref c,d d 5 test.t3.a 7 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 2.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where ((`test`.`t1`.`b` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = `test`.`t3`.`a`) and (`test`.`t3`.`b` < 5) and (`test`.`t1`.`a` < 2000)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t1`.`b` = `test`.`t2`.`c` and `test`.`t2`.`d` = `test`.`t3`.`a` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1382,14 +1382,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 0.99 Using where 1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 explain extended select * from t1 straight_join t2 where t1.a=t2.a and t2.a<10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 0.99 Using where 1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 10)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1415,7 +1415,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE a ALL NULL NULL NULL NULL 1000 100.00 Using where 1 SIMPLE b ALL NULL NULL NULL NULL 1000 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where isnull(`test`.`a`.`a`) +Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where `test`.`a`.`a` is null set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1443,7 +1443,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref PRIMARY,b b 5 const 2 66.67 Using where; Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <> 'USARussian') and isnull(`test`.`t1`.`b`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <> 'USARussian' and `test`.`t1`.`b` is null SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; a b i diff --git a/mysql-test/r/selectivity_no_engine.result b/mysql-test/r/selectivity_no_engine.result index da210b09c23..7fc3c6e9909 100644 --- a/mysql-test/r/selectivity_no_engine.result +++ b/mysql-test/r/selectivity_no_engine.result @@ -38,12 +38,12 @@ explain extended select * from t2 where col1 IN (20, 180); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where (`test`.`t2`.`col1` in (20,180)) +Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (20,180) explain extended select * from t2 where col1 IN (180, 20); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where (`test`.`t2`.`col1` in (180,20)) +Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (180,20) drop table t1, t2; # # MDEV-5926: EITS: Histogram estimates for column=least_possible_value are wrong @@ -65,25 +65,25 @@ explain extended select * from t1 where a=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 # Should select about 10%: explain extended select * from t1 where a=1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Must not have filtered=100%: explain extended select * from t1 where a=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 # Again, must not have filtered=100%: explain extended select * from t1 where a=-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = -1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = -1 drop table t0, t1; # # MDEV-4362: Selectivity estimates for IN (...) do not depend on whether the values are in range @@ -104,18 +104,18 @@ explain extended select * from t1 where col1 in (1,2,3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 3.37 Using where Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` in (1,2,3)) +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (1,2,3) # Must not cause fp division by zero, or produce nonsense numbers: explain extended select * from t1 where col1 in (-1,-2,-3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 5.94 Using where Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` in (-1,-2,-3)) +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (-1,-2,-3) explain extended select * from t1 where col1<=-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 1.00 Using where Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` <= -1) +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` <= -1 drop table t1, t2; # # MDEV-5984: EITS: Incorrect filtered% value for single-table select with range access @@ -136,7 +136,7 @@ explain extended select * from t2 where a in (1,2,3) and b in (1,2,3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range a a 10 NULL 9 100.00 Using index condition Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col2` AS `col2` from `test`.`t2` where ((`test`.`t2`.`a` in (1,2,3)) and (`test`.`t2`.`b` in (1,2,3))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col2` AS `col2` from `test`.`t2` where `test`.`t2`.`a` in (1,2,3) and `test`.`t2`.`b` in (1,2,3) drop table t2, t1; # # MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered% @@ -157,13 +157,13 @@ explain extended select * from t1 where col1=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.90 Using where Warnings: -Note 1003 select `test`.`t1`.`key1` AS `key1`,`test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` = 2) +Note 1003 select `test`.`t1`.`key1` AS `key1`,`test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` = 2 # Must show 100%, not 10% explain extended select * from t1 where key1=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref key1 key1 5 const 98 100.00 Warnings: -Note 1003 select `test`.`t1`.`key1` AS `key1`,`test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`key1` = 2) +Note 1003 select `test`.`t1`.`key1` AS `key1`,`test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`key1` = 2 drop table t0, t1; # MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value # @@ -195,14 +195,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 10 100.00 Using where 1 SIMPLE t1 ref kp1 kp1 10 test.t0.a,func 10 100.00 Using index condition Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2`,`test`.`t1`.`filler1` AS `filler1`,`test`.`t1`.`filler2` AS `filler2` from `test`.`t0` join `test`.`t1` where ((`test`.`t1`.`kp1` = `test`.`t0`.`a`) and (`test`.`t1`.`kp2` = (`test`.`t0`.`a` + 1))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2`,`test`.`t1`.`filler1` AS `filler1`,`test`.`t1`.`filler2` AS `filler2` from `test`.`t0` join `test`.`t1` where `test`.`t1`.`kp1` = `test`.`t0`.`a` and `test`.`t1`.`kp2` = `test`.`t0`.`a` + 1 # NOTE: t0: 10*100% is ok, t1: 10*9.90% is bad. t1 should have 10*100%. explain extended select * from t0, t1 where t1.kp1=t0.a and t1.kp2=4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 10 100.00 Using where 1 SIMPLE t1 ref kp1 kp1 10 test.t0.a,const 10 100.00 Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2`,`test`.`t1`.`filler1` AS `filler1`,`test`.`t1`.`filler2` AS `filler2` from `test`.`t0` join `test`.`t1` where ((`test`.`t1`.`kp1` = `test`.`t0`.`a`) and (`test`.`t1`.`kp2` = 4)) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2`,`test`.`t1`.`filler1` AS `filler1`,`test`.`t1`.`filler2` AS `filler2` from `test`.`t0` join `test`.`t1` where `test`.`t1`.`kp1` = `test`.`t0`.`a` and `test`.`t1`.`kp2` = 4 drop table t0, t1; # # MDEV-6209: Assertion `join->best_read < double(1.79769313486231570815e+308L)' @@ -267,14 +267,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE ta ALL NULL NULL NULL NULL 1000 4.95 Using where 1 SIMPLE tb ALL NULL NULL NULL NULL 1000 9.90 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where ((`test`.`ta`.`a` < 40) and (`test`.`tb`.`a` < 100)) +Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where `test`.`ta`.`a` < 40 and `test`.`tb`.`a` < 100 # Here, tb.filtered should not become 100%: explain extended select * from t1 ta, t2 tb where ta.a < 40 and tb.a < 100 and tb.a=ta.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE ta ALL NULL NULL NULL NULL 1000 4.95 Using where 1 SIMPLE tb ALL NULL NULL NULL NULL 1000 4.95 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where ((`test`.`tb`.`a` = `test`.`ta`.`a`) and (`test`.`ta`.`a` < 40) and (`test`.`ta`.`a` < 100)) +Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where `test`.`tb`.`a` = `test`.`ta`.`a` and `test`.`ta`.`a` < 40 and `test`.`ta`.`a` < 100 drop table t0,t1,t2; # # MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to) diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result index cd3e6a559b8..65187b6b19b 100644 --- a/mysql-test/r/shm.result +++ b/mysql-test/r/shm.result @@ -1509,7 +1509,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index c9d2f7b023a..f6a7fff5d4e 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -51,10 +51,10 @@ Pos Instruction 9 set err@1 1 10 hreturn 5 11 cfetch c@0 n@4 -12 jump_if_not 15(17) isnull(n@4) -13 set nulls@2 (nulls@2 + 1) +12 jump_if_not 15(17) n@4 is null +13 set nulls@2 nulls@2 + 1 14 jump 17 -15 set count@3 (count@3 + 1) +15 set count@3 count@3 + 1 16 stmt 4 "update t2 set idx = count where name=n" 17 hpop 1 18 jump 7 @@ -167,35 +167,35 @@ Pos Instruction 12 set v_schedmax@5 NULL 13 stmt 0 "select count(*) into v_schedmax from ..." 14 set v_tcounter@6 0 -15 jump_if_not 39(39) (v_i@3 <= v_schedmax@5) +15 jump_if_not 39(39) v_i@3 <= v_schedmax@5 16 set v_row@7 NULL 17 set v_col@8 NULL 18 stmt 0 "select row,col into v_row,v_col from ..." 19 stmt 0 "select dig into v_dig from sudoku_wor..." 20 set_case_expr (34) 0 v_dig@4 -21 jump_if_not 25(34) (case_expr@0 = 0) +21 jump_if_not 25(34) case_expr@0 = 0 22 set v_dig@4 1 23 stmt 4 "update sudoku_work set dig = 1 where ..." 24 jump 34 -25 jump_if_not 32(34) (case_expr@0 = 9) -26 jump_if_not 30(34) (v_i@3 > 0) +25 jump_if_not 32(34) case_expr@0 = 9 +26 jump_if_not 30(34) v_i@3 > 0 27 stmt 4 "update sudoku_work set dig = 0 where ..." -28 set v_i@3 (v_i@3 - 1) +28 set v_i@3 v_i@3 - 1 29 jump 15 30 stmt 0 "select v_scounter as 'Solutions'" 31 jump 45 -32 set v_dig@4 (v_dig@4 + 1) +32 set v_dig@4 v_dig@4 + 1 33 stmt 4 "update sudoku_work set dig = v_dig wh..." -34 set v_tcounter@6 (v_tcounter@6 + 1) -35 jump_if_not 37(37) (not(`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4))) +34 set v_tcounter@6 v_tcounter@6 + 1 +35 jump_if_not 37(37) !`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4) 36 jump 15 -37 set v_i@3 (v_i@3 + 1) +37 set v_i@3 v_i@3 + 1 38 jump 15 39 stmt 0 "select dig from sudoku_work" 40 stmt 0 "select v_tcounter as 'Tests'" -41 set v_scounter@2 (v_scounter@2 + 1) -42 jump_if_not 45(14) (p_all@1 and (v_i@3 > 0)) -43 set v_i@3 (v_i@3 - 1) +41 set v_scounter@2 v_scounter@2 + 1 +42 jump_if_not 45(14) p_all@1 and v_i@3 > 0 +43 set v_i@3 v_i@3 - 1 44 jump 14 45 stmt 9 "drop temporary table sudoku_work, sud..." drop procedure sudoku_solve; @@ -323,13 +323,13 @@ SHOW PROCEDURE CODE proc_19194_simple; Pos Instruction 0 set str@1 NULL 1 set_case_expr (12) 0 i@0 -2 jump_if_not 5(12) (case_expr@0 = 1) +2 jump_if_not 5(12) case_expr@0 = 1 3 set str@1 '1' 4 jump 12 -5 jump_if_not 8(12) (case_expr@0 = 2) +5 jump_if_not 8(12) case_expr@0 = 2 6 set str@1 '2' 7 jump 12 -8 jump_if_not 11(12) (case_expr@0 = 3) +8 jump_if_not 11(12) case_expr@0 = 3 9 set str@1 '3' 10 jump 12 11 set str@1 'unknown' @@ -337,13 +337,13 @@ Pos Instruction SHOW PROCEDURE CODE proc_19194_searched; Pos Instruction 0 set str@1 NULL -1 jump_if_not 4(11) (i@0 = 1) +1 jump_if_not 4(11) i@0 = 1 2 set str@1 '1' 3 jump 11 -4 jump_if_not 7(11) (i@0 = 2) +4 jump_if_not 7(11) i@0 = 2 5 set str@1 '2' 6 jump 11 -7 jump_if_not 10(11) (i@0 = 3) +7 jump_if_not 10(11) i@0 = 3 8 set str@1 '3' 9 jump 11 10 set str@1 'unknown' @@ -353,27 +353,27 @@ Pos Instruction 0 set str_i@2 NULL 1 set str_j@3 NULL 2 set_case_expr (27) 0 i@0 -3 jump_if_not 6(27) (case_expr@0 = 10) +3 jump_if_not 6(27) case_expr@0 = 10 4 set str_i@2 '10' 5 jump 27 -6 jump_if_not 20(27) (case_expr@0 = 20) +6 jump_if_not 20(27) case_expr@0 = 20 7 set str_i@2 '20' -8 jump_if_not 11(18) (j@1 = 1) +8 jump_if_not 11(18) j@1 = 1 9 set str_j@3 '1' 10 jump 18 -11 jump_if_not 14(18) (j@1 = 2) +11 jump_if_not 14(18) j@1 = 2 12 set str_j@3 '2' 13 jump 18 -14 jump_if_not 17(18) (j@1 = 3) +14 jump_if_not 17(18) j@1 = 3 15 set str_j@3 '3' 16 jump 18 17 set str_j@3 'unknown' 18 stmt 0 "select "i was 20"" 19 jump 27 -20 jump_if_not 23(27) (case_expr@0 = 30) +20 jump_if_not 23(27) case_expr@0 = 30 21 set str_i@2 '30' 22 jump 27 -23 jump_if_not 26(27) (case_expr@0 = 40) +23 jump_if_not 26(27) case_expr@0 = 40 24 set str_i@2 '40' 25 jump 27 26 set str_i@2 'unknown' @@ -382,28 +382,28 @@ SHOW PROCEDURE CODE proc_19194_nested_2; Pos Instruction 0 set str_i@2 NULL 1 set str_j@3 NULL -2 jump_if_not 5(27) (i@0 = 10) +2 jump_if_not 5(27) i@0 = 10 3 set str_i@2 '10' 4 jump 27 -5 jump_if_not 20(27) (i@0 = 20) +5 jump_if_not 20(27) i@0 = 20 6 set str_i@2 '20' 7 set_case_expr (18) 0 j@1 -8 jump_if_not 11(18) (case_expr@0 = 1) +8 jump_if_not 11(18) case_expr@0 = 1 9 set str_j@3 '1' 10 jump 18 -11 jump_if_not 14(18) (case_expr@0 = 2) +11 jump_if_not 14(18) case_expr@0 = 2 12 set str_j@3 '2' 13 jump 18 -14 jump_if_not 17(18) (case_expr@0 = 3) +14 jump_if_not 17(18) case_expr@0 = 3 15 set str_j@3 '3' 16 jump 18 17 set str_j@3 'unknown' 18 stmt 0 "select "i was 20"" 19 jump 27 -20 jump_if_not 23(27) (i@0 = 30) +20 jump_if_not 23(27) i@0 = 30 21 set str_i@2 '30' 22 jump 27 -23 jump_if_not 26(27) (i@0 = 40) +23 jump_if_not 26(27) i@0 = 40 24 set str_i@2 '40' 25 jump 27 26 set str_i@2 'unknown' @@ -413,28 +413,28 @@ Pos Instruction 0 set str_i@2 NULL 1 set str_j@3 NULL 2 set_case_expr (28) 0 i@0 -3 jump_if_not 6(28) (case_expr@0 = 10) +3 jump_if_not 6(28) case_expr@0 = 10 4 set str_i@2 '10' 5 jump 28 -6 jump_if_not 21(28) (case_expr@0 = 20) +6 jump_if_not 21(28) case_expr@0 = 20 7 set str_i@2 '20' 8 set_case_expr (19) 1 j@1 -9 jump_if_not 12(19) (case_expr@1 = 1) +9 jump_if_not 12(19) case_expr@1 = 1 10 set str_j@3 '1' 11 jump 19 -12 jump_if_not 15(19) (case_expr@1 = 2) +12 jump_if_not 15(19) case_expr@1 = 2 13 set str_j@3 '2' 14 jump 19 -15 jump_if_not 18(19) (case_expr@1 = 3) +15 jump_if_not 18(19) case_expr@1 = 3 16 set str_j@3 '3' 17 jump 19 18 set str_j@3 'unknown' 19 stmt 0 "select "i was 20"" 20 jump 28 -21 jump_if_not 24(28) (case_expr@0 = 30) +21 jump_if_not 24(28) case_expr@0 = 30 22 set str_i@2 '30' 23 jump 28 -24 jump_if_not 27(28) (case_expr@0 = 40) +24 jump_if_not 27(28) case_expr@0 = 40 25 set str_i@2 '40' 26 jump 28 27 set str_i@2 'unknown' @@ -443,27 +443,27 @@ SHOW PROCEDURE CODE proc_19194_nested_4; Pos Instruction 0 set str_i@2 NULL 1 set str_j@3 NULL -2 jump_if_not 5(26) (i@0 = 10) +2 jump_if_not 5(26) i@0 = 10 3 set str_i@2 '10' 4 jump 26 -5 jump_if_not 19(26) (i@0 = 20) +5 jump_if_not 19(26) i@0 = 20 6 set str_i@2 '20' -7 jump_if_not 10(17) (j@1 = 1) +7 jump_if_not 10(17) j@1 = 1 8 set str_j@3 '1' 9 jump 17 -10 jump_if_not 13(17) (j@1 = 2) +10 jump_if_not 13(17) j@1 = 2 11 set str_j@3 '2' 12 jump 17 -13 jump_if_not 16(17) (j@1 = 3) +13 jump_if_not 16(17) j@1 = 3 14 set str_j@3 '3' 15 jump 17 16 set str_j@3 'unknown' 17 stmt 0 "select "i was 20"" 18 jump 26 -19 jump_if_not 22(26) (i@0 = 30) +19 jump_if_not 22(26) i@0 = 30 20 set str_i@2 '30' 21 jump 26 -22 jump_if_not 25(26) (i@0 = 40) +22 jump_if_not 25(26) i@0 = 40 23 set str_i@2 '40' 24 jump 26 25 set str_i@2 'unknown' @@ -668,8 +668,8 @@ Pos Instruction 0 set i@1 5 1 hpush_jump 8 2 CONTINUE 2 stmt 0 "select 'caught something'" -3 jump_if_not 7(7) (i@1 > 0) -4 set i@1 (i@1 - 1) +3 jump_if_not 7(7) i@1 > 0 +4 set i@1 i@1 - 1 5 stmt 0 "select 'looping', i" 6 jump 3 7 hreturn 2 @@ -683,8 +683,8 @@ Pos Instruction 0 set i@1 5 1 hpush_jump 9 2 CONTINUE 2 stmt 0 "select 'caught something'" -3 jump_if_not 7(7) (i@1 > 0) -4 set i@1 (i@1 - 1) +3 jump_if_not 7(7) i@1 > 0 +4 set i@1 i@1 - 1 5 stmt 0 "select 'looping', i" 6 jump 3 7 stmt 0 "select 'optimizer: keep hreturn'" @@ -796,8 +796,8 @@ Pos Instruction 0 set count1@1 '0' 1 set vb@2 NULL 2 set last_row@3 NULL -3 jump_if_not 24(24) (num@0 >= 1) -4 set num@0 (num@0 - 1) +3 jump_if_not 24(24) num@0 >= 1 +4 set num@0 num@0 - 1 5 cpush cur1@0 6 hpush_jump 9 4 CONTINUE 7 set last_row@3 1 @@ -807,11 +807,11 @@ Pos Instruction 11 hpush_jump 13 4 EXIT 12 hreturn 0 17 13 cfetch cur1@0 vb@2 -14 jump_if_not 17(17) (last_row@3 = 1) +14 jump_if_not 17(17) last_row@3 = 1 15 hpop 1 16 jump 19 17 hpop 1 -18 jump_if_not 11(19) (last_row@3 = 1) +18 jump_if_not 11(19) last_row@3 = 1 19 cclose cur1@0 20 hpop 1 21 cpop 1 @@ -821,8 +821,8 @@ Pos Instruction 0 set count1@1 '0' 1 set vb@2 NULL 2 set last_row@3 NULL -3 jump_if_not 23(23) (num@0 >= 1) -4 set num@0 (num@0 - 1) +3 jump_if_not 23(23) num@0 >= 1 +4 set num@0 num@0 - 1 5 cpush cur1@0 6 hpush_jump 9 4 CONTINUE 7 set last_row@3 1 @@ -831,11 +831,11 @@ Pos Instruction 10 copen cur1@0 11 cpush cur2@1 12 cfetch cur1@0 vb@2 -13 jump_if_not 16(16) (last_row@3 = 1) +13 jump_if_not 16(16) last_row@3 = 1 14 cpop 1 15 jump 18 16 cpop 1 -17 jump_if_not 11(18) (last_row@3 = 1) +17 jump_if_not 11(18) last_row@3 = 1 18 cclose cur1@0 19 hpop 1 20 cpop 1 @@ -883,7 +883,7 @@ SHOW PROCEDURE CODE p1; Pos Instruction 0 set dummy@0 0 1 set_case_expr (6) 0 12 -2 jump_if_not 5(6) (case_expr@0 = 12) +2 jump_if_not 5(6) case_expr@0 = 12 3 set dummy@0 0 4 jump 6 5 error 1339 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index aca9458f124..fefcdae539e 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6045,12 +6045,12 @@ select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; 9223372036854775810 2**63+2 9223372036854775810 select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' select bug20777(9223372036854775807) as 'upper bounds signed bigint'; upper bounds signed bigint 9223372036854775807 select bug20777(0) as 'lower bounds unsigned bigint'; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; upper bounds unsigned bigint 18446744073709551615 @@ -6060,7 +6060,7 @@ upper bounds unsigned bigint + 1 Warnings: Warning 1264 Out of range value for column 'f1' at row 1 select bug20777(-1) as 'lower bounds unsigned bigint - 1'; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' create table examplebug20777 as select 0 as 'i', bug20777(9223372036854775806) as '2**63-2', diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index 566314cf7a9..ac18da81b93 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -1518,7 +1518,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result index dcf9a41de29..4e37cc68a24 100644 --- a/mysql-test/r/ssl_compress.result +++ b/mysql-test/r/ssl_compress.result @@ -1515,7 +1515,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> '')) +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 9436627aa1f..49a7c45de6e 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -897,7 +897,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES ('-1.2E-3'); ERROR 22003: Out of range value for column 'col2' at row 1 UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0; -ERROR 22003: DOUBLE value is out of range in '("test"."t1"."col1" * 5000)' +ERROR 22003: DOUBLE value is out of range in '"test"."t1"."col1" * 5000' UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0; ERROR 22012: Division by 0 UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ff5823c10d9..dd741e165bf 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -56,7 +56,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -197,7 +197,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -283,7 +283,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -327,7 +327,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -345,7 +345,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t6 ALL i1 NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where (`test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`) +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq` select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; @@ -406,13 +406,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -559,7 +559,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -741,7 +741,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -754,7 +754,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -762,7 +762,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3))))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -888,7 +888,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -910,7 +910,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having (`test`.`t2`.`a`))))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -925,7 +925,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (((`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having (`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and ((`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1325,7 +1325,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1335,7 +1335,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1380,7 +1380,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1442,7 +1442,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1452,7 +1452,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1463,7 +1463,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1485,7 +1485,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1495,7 +1495,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1506,7 +1506,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1522,7 +1522,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1613,25 +1613,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1646,7 +1646,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1654,7 +1654,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1665,7 +1665,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1673,7 +1673,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1716,7 +1716,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1886,14 +1886,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and ((`test`.`t1`.`id`) = `test`.`t1`.`id`)))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not((1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null)))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1919,7 +1919,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2977,20 +2977,20 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4456,7 +4456,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`))) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4537,14 +4537,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 75e8c084026..e87f4b9b451 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -262,7 +262,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2c ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where (not(<`test`.`t1`.`c1`,`test`.`t1`.`a`>((`test`.`t1`.`c1`,(select `test`.`t2a`.`c2` from `test`.`t2` `t2a` join `test`.`t2` `t2b` join `test`.`t2` `t2c` where (((`test`.`t2b`.`m` <> `test`.`t1`.`a`) or (`test`.`t2b`.`m` = `test`.`t2a`.`m`)) and trigcond((((`test`.`t1`.`c1`) = `test`.`t2a`.`c2`) or isnull(`test`.`t2a`.`c2`))) and (`test`.`t2c`.`c2` = `test`.`t2b`.`c2`) and (`test`.`t2b`.`n` = `test`.`t2a`.`m`)) having trigcond((`test`.`t2a`.`c2`))))))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`a`>((`test`.`t1`.`c1`,(select `test`.`t2a`.`c2` from `test`.`t2` `t2a` join `test`.`t2` `t2b` join `test`.`t2` `t2c` where (`test`.`t2b`.`m` <> `test`.`t1`.`a` or `test`.`t2b`.`m` = `test`.`t2a`.`m`) and trigcond((`test`.`t1`.`c1`) = `test`.`t2a`.`c2` or `test`.`t2a`.`c2` is null) and `test`.`t2c`.`c2` = `test`.`t2b`.`c2` and `test`.`t2b`.`n` = `test`.`t2a`.`m` having trigcond(`test`.`t2a`.`c2` is null)))) DROP TABLE t1,t2; # # MDEV-614, also MDEV-536, also LP:1050806: @@ -342,7 +342,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ref idx idx 6 func 2 100.00 Using where; Using index 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`a` = `test`.`t1`.`a`)) where ((`test`.`t1`.`a` = (select min(`test`.`t1`.`a`) from `test`.`t1`)) and (`test`.`t2`.`a` = (select min(`test`.`t1`.`a`) from `test`.`t1`))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`a` = `test`.`t1`.`a`) where `test`.`t1`.`a` = (select min(`test`.`t1`.`a`) from `test`.`t1`) and `test`.`t2`.`a` = (select min(`test`.`t1`.`a`) from `test`.`t1`) select * from t1, t2 left join t3 on ( t2.a = t3.a ) where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 ); a a a diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index a7e051e7c06..673b53b9c04 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -33,7 +33,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having trigcond(((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` group by `test`.`t1`.`grp` having trigcond((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`)))))) AS `Z` from `test`.`t2` explain extended select a, oref from t2 where a in (select max(ie) from t1 where oref=t2.oref group by grp); @@ -42,7 +42,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having ((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`)))))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` group by `test`.`t1`.`grp` having (`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`))))) select a, oref, a in ( select max(ie) from t1 where oref=t2.oref group by grp union select max(ie) from t1 where oref=t2.oref group by grp @@ -73,7 +73,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: -Note 1003 select <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = 4) group by `test`.`t1`.`grp` having trigcond(((`test`.`t3`.`a`) = (max(`test`.`t1`.`ie`))))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3` +Note 1003 select <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = 4 group by `test`.`t1`.`grp` having trigcond((`test`.`t3`.`a`) = (max(`test`.`t1`.`ie`)))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3` set @@optimizer_switch=@save_optimizer_switch; drop table t1, t2, t3; create table t1 (a int, oref int, key(a)); @@ -99,7 +99,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 2 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a checking NULL where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) having trigcond((`test`.`t1`.`a`)))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2` flush status; select oref, a from t2 where a in (select a from t1 where oref=t2.oref); oref a @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref a a 5 test.t1.b 1 100.00 Using where Warnings: Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond((((`test`.`t3`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) and (`test`.`t2`.`a` = `test`.`t1`.`b`)) having trigcond((`test`.`t1`.`a`))))) AS `Z` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t3`.`oref` and trigcond((`test`.`t3`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) and `test`.`t2`.`a` = `test`.`t1`.`b` having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t3` drop table t1, t2, t3; create table t1 (a int NOT NULL, b int NOT NULL, key(a)); insert into t1 values @@ -197,7 +197,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref a a 4 test.t1.b 1 100.00 Using where Warnings: Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond(((`test`.`t3`.`a`) = `test`.`t1`.`a`)) and (`test`.`t2`.`a` = `test`.`t1`.`b`))))) AS `Z` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t3`.`oref` and trigcond((`test`.`t3`.`a`) = `test`.`t1`.`a`) and `test`.`t2`.`a` = `test`.`t1`.`b`))) AS `Z` from `test`.`t3` drop table t1,t2,t3; create table t1 (oref int, grp int); insert into t1 (oref, grp) values @@ -221,7 +221,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: Note 1276 Field or reference 't2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select count(0) from `test`.`t1` group by `test`.`t1`.`grp` having ((`test`.`t1`.`grp` = `test`.`t2`.`oref`) and trigcond(((`test`.`t2`.`a`) = (count(0)))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select count(0) from `test`.`t1` group by `test`.`t1`.`grp` having `test`.`t1`.`grp` = `test`.`t2`.`oref` and trigcond((`test`.`t2`.`a`) = (count(0)))))) AS `Z` from `test`.`t2` drop table t1, t2; create table t1 (a int, b int, primary key (a)); insert into t1 values (1,1), (3,1),(100,1); @@ -253,7 +253,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 2 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on a checking NULL where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))))) having (trigcond((`test`.`t1`.`a`)) and trigcond((`test`.`t1`.`b`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`c` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`b` or `test`.`t1`.`b` is null)) having trigcond(`test`.`t1`.`a` is null) and trigcond(`test`.`t1`.`b` is null))))) AS `Z` from `test`.`t2` select a,b, oref, (a,b) in (select a,b from t1 where c=t2.oref) Z from t2; a b oref Z NULL 1 100 0 @@ -270,7 +270,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(select `test`.`t1`.`a`,`test`.`t1`.`b` from `test`.`t1` join `test`.`t4` where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))))) having (trigcond((`test`.`t1`.`a`)) and trigcond((`test`.`t1`.`b`)))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(select `test`.`t1`.`a`,`test`.`t1`.`b` from `test`.`t1` join `test`.`t4` where `test`.`t1`.`c` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`b` or `test`.`t1`.`b` is null)) having trigcond(`test`.`t1`.`a` is null) and trigcond(`test`.`t1`.`b` is null)))) AS `Z` from `test`.`t2` select a,b, oref, (a,b) in (select a,b from t1,t4 where c=t2.oref) Z from t2; @@ -315,7 +315,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond((`test`.`t1`.`ie1`)) and trigcond((`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`a` = 10) and (`test`.`t2`.`b` = 10)) +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`ie1` or `test`.`t1`.`ie1` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`ie2` or `test`.`t1`.`ie2` is null)) having trigcond(`test`.`t1`.`ie1` is null) and trigcond(`test`.`t1`.`ie2` is null))))) AS `Z` from `test`.`t2` where `test`.`t2`.`a` = 10 and `test`.`t2`.`b` = 10 drop table t1, t2; create table t1 (oref char(4), grp int, ie int); insert into t1 (oref, grp, ie) values @@ -585,7 +585,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond((`test`.`t1`.`ie1`)) and trigcond((`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`ie1` or `test`.`t1`.`ie1` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`ie2` or `test`.`t1`.`ie2` is null)) having trigcond(`test`.`t1`.`ie1` is null) and trigcond(`test`.`t1`.`ie2` is null))))) AS `Z` from `test`.`t2` drop table t1,t2; create table t1 (oref char(4), grp int, ie int primary key); insert into t1 (oref, grp, ie) values @@ -716,7 +716,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (not(<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) having trigcond((`test`.`t1`.`a`)))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t1`.`a` and !<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where trigcond((`test`.`t2`.`b`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1)); a SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4)); @@ -1418,7 +1418,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where 1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary Warnings: -Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`cona`.`postalStripped` = 'T2H3B2') and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`c`.`idContact` = `test`.`cona`.`idContact`)) +Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where `test`.`cona`.`postalStripped` = 'T2H3B2' and `test`.`a`.`idIndividual` = `test`.`c`.`idObj` and `test`.`c`.`idContact` = `test`.`cona`.`idContact` set @@optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; # @@ -1541,7 +1541,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`))) AS `subsel` from `test`.`t2` +Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where `test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2` DROP TABLE t1,t2; End of 5.6 tests set @@optimizer_switch=@subselect3_tmp; diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result index fd28084fa43..06a5e2c5aa4 100644 --- a/mysql-test/r/subselect3_jcl6.result +++ b/mysql-test/r/subselect3_jcl6.result @@ -43,7 +43,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having trigcond(((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` group by `test`.`t1`.`grp` having trigcond((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`)))))) AS `Z` from `test`.`t2` explain extended select a, oref from t2 where a in (select max(ie) from t1 where oref=t2.oref group by grp); @@ -52,7 +52,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having ((`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`)))))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` group by `test`.`t1`.`grp` having (`test`.`t2`.`a`) = (max(`test`.`t1`.`ie`))))) select a, oref, a in ( select max(ie) from t1 where oref=t2.oref group by grp union select max(ie) from t1 where oref=t2.oref group by grp @@ -83,7 +83,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary Warnings: -Note 1003 select <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = 4) group by `test`.`t1`.`grp` having trigcond(((`test`.`t3`.`a`) = (max(`test`.`t1`.`ie`))))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3` +Note 1003 select <`test`.`t3`.`a`>((`test`.`t3`.`a`,(select max(`test`.`t1`.`ie`) from `test`.`t1` where `test`.`t1`.`oref` = 4 group by `test`.`t1`.`grp` having trigcond((`test`.`t3`.`a`) = (max(`test`.`t1`.`ie`)))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3` set @@optimizer_switch=@save_optimizer_switch; drop table t1, t2, t3; create table t1 (a int, oref int, key(a)); @@ -109,7 +109,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 2 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a checking NULL where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) having trigcond((`test`.`t1`.`a`)))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2` flush status; select oref, a from t2 where a in (select a from t1 where oref=t2.oref); oref a @@ -179,7 +179,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref a a 5 test.t1.b 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan Warnings: Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond((((`test`.`t3`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) and (`test`.`t2`.`a` = `test`.`t1`.`b`)) having trigcond((`test`.`t1`.`a`))))) AS `Z` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t3`.`oref` and trigcond((`test`.`t3`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) and `test`.`t2`.`a` = `test`.`t1`.`b` having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t3` drop table t1, t2, t3; create table t1 (a int NOT NULL, b int NOT NULL, key(a)); insert into t1 values @@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref a a 4 test.t1.b 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan Warnings: Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond(((`test`.`t3`.`a`) = `test`.`t1`.`a`)) and (`test`.`t2`.`a` = `test`.`t1`.`b`))))) AS `Z` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<`test`.`t3`.`a`,`test`.`t3`.`oref`>((`test`.`t3`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t3`.`oref` and trigcond((`test`.`t3`.`a`) = `test`.`t1`.`a`) and `test`.`t2`.`a` = `test`.`t1`.`b`))) AS `Z` from `test`.`t3` drop table t1,t2,t3; create table t1 (oref int, grp int); insert into t1 (oref, grp) values @@ -231,7 +231,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: Note 1276 Field or reference 't2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select count(0) from `test`.`t1` group by `test`.`t1`.`grp` having ((`test`.`t1`.`grp` = `test`.`t2`.`oref`) and trigcond(((`test`.`t2`.`a`) = (count(0)))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`oref`>((`test`.`t2`.`a`,(select count(0) from `test`.`t1` group by `test`.`t1`.`grp` having `test`.`t1`.`grp` = `test`.`t2`.`oref` and trigcond((`test`.`t2`.`a`) = (count(0)))))) AS `Z` from `test`.`t2` drop table t1, t2; create table t1 (a int, b int, primary key (a)); insert into t1 values (1,1), (3,1),(100,1); @@ -263,7 +263,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 2 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on a checking NULL where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))))) having (trigcond((`test`.`t1`.`a`)) and trigcond((`test`.`t1`.`b`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`c` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`b` or `test`.`t1`.`b` is null)) having trigcond(`test`.`t1`.`a` is null) and trigcond(`test`.`t1`.`b` is null))))) AS `Z` from `test`.`t2` select a,b, oref, (a,b) in (select a,b from t1 where c=t2.oref) Z from t2; a b oref Z NULL 1 100 0 @@ -280,7 +280,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(select `test`.`t1`.`a`,`test`.`t1`.`b` from `test`.`t1` join `test`.`t4` where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))))) having (trigcond((`test`.`t1`.`a`)) and trigcond((`test`.`t1`.`b`)))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(select `test`.`t1`.`a`,`test`.`t1`.`b` from `test`.`t1` join `test`.`t4` where `test`.`t1`.`c` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`b` or `test`.`t1`.`b` is null)) having trigcond(`test`.`t1`.`a` is null) and trigcond(`test`.`t1`.`b` is null)))) AS `Z` from `test`.`t2` select a,b, oref, (a,b) in (select a,b from t1,t4 where c=t2.oref) Z from t2; @@ -325,7 +325,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond((`test`.`t1`.`ie1`)) and trigcond((`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`a` = 10) and (`test`.`t2`.`b` = 10)) +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`ie1` or `test`.`t1`.`ie1` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`ie2` or `test`.`t1`.`ie2` is null)) having trigcond(`test`.`t1`.`ie1` is null) and trigcond(`test`.`t1`.`ie2` is null))))) AS `Z` from `test`.`t2` where `test`.`t2`.`a` = 10 and `test`.`t2`.`b` = 10 drop table t1, t2; create table t1 (oref char(4), grp int, ie int); insert into t1 (oref, grp, ie) values @@ -595,7 +595,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond((((`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond((`test`.`t1`.`ie1`)) and trigcond((`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(((`test`.`t2`.`a`,`test`.`t2`.`b`),(((`test`.`t2`.`a`) in t1 on idx checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(trigcond((`test`.`t2`.`a`) = `test`.`t1`.`ie1` or `test`.`t1`.`ie1` is null)) and trigcond(trigcond((`test`.`t2`.`b`) = `test`.`t1`.`ie2` or `test`.`t1`.`ie2` is null)) having trigcond(`test`.`t1`.`ie1` is null) and trigcond(`test`.`t1`.`ie2` is null))))) AS `Z` from `test`.`t2` drop table t1,t2; create table t1 (oref char(4), grp int, ie int primary key); insert into t1 (oref, grp, ie) values @@ -726,7 +726,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (not(<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where trigcond((((`test`.`t2`.`b`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) having trigcond((`test`.`t1`.`a`)))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`b` = `test`.`t1`.`a` and !<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where trigcond((`test`.`t2`.`b`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1)); a SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4)); @@ -1428,7 +1428,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary Warnings: -Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`cona`.`postalStripped` = 'T2H3B2') and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`c`.`idContact` = `test`.`cona`.`idContact`)) +Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where `test`.`cona`.`postalStripped` = 'T2H3B2' and `test`.`a`.`idIndividual` = `test`.`c`.`idObj` and `test`.`c`.`idContact` = `test`.`cona`.`idContact` set @@optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; # @@ -1551,7 +1551,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`))) AS `subsel` from `test`.`t2` +Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where `test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2` DROP TABLE t1,t2; End of 5.6 tests set @@optimizer_switch=@subselect3_tmp; diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 992892b8fb6..792ce657ba0 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2349,7 +2349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 system NULL NULL NULL NULL 1 100.00 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select 3 AS `f` from dual where (not(<3>((3,(select `test`.`t1`.`b` from `test`.`t1` where (((`test`.`t1`.`c` = 'USA') or (`test`.`t1`.`c` <> 'USA')) and trigcond((((3) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))) and (`test`.`t1`.`b` = `test`.`t1`.`a`)) having trigcond((`test`.`t1`.`b`))))))) +Note 1003 select 3 AS `f` from dual where !<3>((3,(select `test`.`t1`.`b` from `test`.`t1` where (`test`.`t1`.`c` = 'USA' or `test`.`t1`.`c` <> 'USA') and trigcond((3) = `test`.`t1`.`b` or `test`.`t1`.`b` is null) and `test`.`t1`.`b` = `test`.`t1`.`a` having trigcond(`test`.`t1`.`b` is null)))) SELECT * FROM t2 WHERE f NOT IN (SELECT b FROM t1 WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result index 97a5f5a77f6..86bc78dc204 100644 --- a/mysql-test/r/subselect_cache.result +++ b/mysql-test/r/subselect_cache.result @@ -76,7 +76,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 18.75, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } } @@ -128,7 +128,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 18.75, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } }, @@ -162,7 +162,7 @@ ANALYZE "r_total_time_ms": "REPLACED", "filtered": 100, "r_filtered": 18.75, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } } @@ -193,7 +193,7 @@ EXPLAIN "access_type": "ALL", "rows": 4, "filtered": 100, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } } @@ -230,7 +230,7 @@ EXPLAIN "access_type": "ALL", "rows": 4, "filtered": 100, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } }, @@ -257,7 +257,7 @@ EXPLAIN "access_type": "ALL", "rows": 4, "filtered": 100, - "attached_condition": "(t1.b = t2.c)" + "attached_condition": "t1.b = t2.c" } } } @@ -3613,7 +3613,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where ((`test`.`t1`.`a`) = `test`.`t2`.`b`)))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where (`test`.`t1`.`a`) = `test`.`t2`.`b`))) drop table t1,t2; set @@optimizer_switch= default; # LP BUG#615760 (part 2: incorrect heap table index flags) diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result index 1d0732060b7..07b5557506b 100644 --- a/mysql-test/r/subselect_exists2in.result +++ b/mysql-test/r/subselect_exists2in.result @@ -55,7 +55,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL bb NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t3`) where (`test`.`t3`.`b` = `test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t3`) where `test`.`t3`.`b` = `test`.`t1`.`a` -- EXIST to IN then IN to EXISTS set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); @@ -68,7 +68,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a`,(select `test`.`t3`.`b` from `test`.`t3` where ((`test`.`t1`.`a`) = `test`.`t3`.`b`))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a`,(select `test`.`t3`.`b` from `test`.`t3` where (`test`.`t1`.`a`) = `test`.`t3`.`b`)) -- EXIST2IN then MATERIALIZATION set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); @@ -81,7 +81,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t3`.`b` from `test`.`t3` where 1 ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`b`))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t3`.`b` from `test`.`t3` where 1 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`b`))) -- NO EXIST2IN set optimizer_switch='exists_to_in=off,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); @@ -94,7 +94,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`b` = `test`.`t1`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`b` = `test`.`t1`.`a`) set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; drop table t1,t2,t3; @@ -313,7 +313,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`b` from `test`.`t2` where 1 ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`b`)))))) or (`test`.`t1`.`a` > 0)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`b` from `test`.`t2` where 1 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`b`)))) or `test`.`t1`.`a` > 0 drop tables t1,t2; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (1),(5); @@ -330,7 +330,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 -Note 1003 select (select 1 from dual where (not(((1 is not null) and (1,1 in ( (select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` is not null) ), (1 in on distinct_key where ((1 = ``.`c`))))))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +Note 1003 select (select 1 from dual where !(1 is not null and (1,1 in ( (select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` is not null ), (1 in on distinct_key where 1 = ``.`c`))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) 1 @@ -344,7 +344,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 -Note 1003 select (select 1 from dual where (not(((1 is not null) and (1,1 in ( (select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` is not null) ), (1 in on distinct_key where ((1 = ``.`c`))))))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +Note 1003 select (select 1 from dual where !(1 is not null and (1,1 in ( (select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` is not null ), (1 in on distinct_key where 1 = ``.`c`))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) 1 @@ -358,7 +358,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 -Note 1003 select (select 1 from dual where (not(exists(select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` = 1))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +Note 1003 select (select 1 from dual where !exists(select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` = 1)) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) 1 @@ -387,7 +387,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t3`.`b`) and (`test`.`t1`.`a1` = `test`.`t3`.`b1`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t3`) where `test`.`t1`.`a` = `test`.`t3`.`b` and `test`.`t1`.`a1` = `test`.`t3`.`b1` -- EXIST to IN then IN to EXISTS set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); @@ -401,7 +401,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a`,`test`.`t1`.`a1`),(((`test`.`t1`.`a`) in t3 on bb where (((`test`.`t1`.`a`) = `test`.`t3`.`b`) and ((`test`.`t1`.`a1`) = `test`.`t3`.`b1`))))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a`,`test`.`t1`.`a1`),(((`test`.`t1`.`a`) in t3 on bb where (`test`.`t1`.`a`) = `test`.`t3`.`b` and (`test`.`t1`.`a1`) = `test`.`t3`.`b1`))) -- EXIST2IN then MATERIALIZATION set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); @@ -415,7 +415,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a`,`test`.`t1`.`a1`),(`test`.`t1`.`a`,`test`.`t1`.`a1`) in ( (select `test`.`t3`.`b`,`test`.`t3`.`b1` from `test`.`t3` where 1 ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`b`) and (`test`.`t1`.`a1` = ``.`b1`))))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where ((`test`.`t1`.`a`,`test`.`t1`.`a1`),(`test`.`t1`.`a`,`test`.`t1`.`a1`) in ( (select `test`.`t3`.`b`,`test`.`t3`.`b1` from `test`.`t3` where 1 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`b` and `test`.`t1`.`a1` = ``.`b1`))) -- NO EXIST2IN set optimizer_switch='exists_to_in=off,subquery_cache=off'; SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); @@ -429,7 +429,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where exists(select 1 from `test`.`t3` where ((`test`.`t3`.`b` = `test`.`t1`.`a`) and (`test`.`t3`.`b1` = `test`.`t1`.`a1`))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where exists(select 1 from `test`.`t3` where `test`.`t3`.`b` = `test`.`t1`.`a` and `test`.`t3`.`b1` = `test`.`t1`.`a1`) set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; drop table t1,t3; @@ -466,7 +466,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'v.d' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'v.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`b`,(select `test`.`t2`.`b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <= `test`.`t2`.`d`) and ((`test`.`t2`.`b`) = `test`.`t2`.`b`)))) and (`test`.`t2`.`b` < 1)) +Note 1003 select `test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`b`,(select `test`.`t2`.`b` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <= `test`.`t2`.`d` and (`test`.`t2`.`b`) = `test`.`t2`.`b`)) and `test`.`t2`.`b` < 1 set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; drop view v; @@ -544,7 +544,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.alias2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.alias1.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias1`.`b` AS `b`,`test`.`alias2`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t1` `alias2` where (<`test`.`alias1`.`b`,`test`.`alias2`.`a`>((`test`.`alias1`.`b`,(select `test`.`t2`.`c` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <= `test`.`alias2`.`a`) and ((`test`.`alias1`.`b`) = `test`.`t2`.`c`))))) or (`test`.`alias1`.`a` = 'foo')) +Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias1`.`b` AS `b`,`test`.`alias2`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t1` `alias2` where <`test`.`alias1`.`b`,`test`.`alias2`.`a`>((`test`.`alias1`.`b`,(select `test`.`t2`.`c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <= `test`.`alias2`.`a` and (`test`.`alias1`.`b`) = `test`.`t2`.`c`))) or `test`.`alias1`.`a` = 'foo' drop table t1,t2; set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; @@ -568,7 +568,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not(((`test`.`t1`.`a` is not null) and <`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where ((`test`.`t2`.`b` is not null) and ((`test`.`t1`.`a`) = `test`.`t2`.`b`)))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where !(`test`.`t1`.`a` is not null and <`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where `test`.`t2`.`b` is not null and (`test`.`t1`.`a`) = `test`.`t2`.`b`)))) drop table t1,t2; set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; @@ -592,7 +592,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`alias`.`b`) and (`test`.`alias`.`b` > `test`.`alias`.`a`)) +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`alias`.`b` and `test`.`alias`.`b` > `test`.`alias`.`a` SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' ); SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=off'; SELECT * FROM t1 AS alias @@ -608,7 +608,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` where (`test`.`alias`.`b`,(select `test`.`t1`.`a` from `test`.`t1` where ((`test`.`t1`.`a` > `test`.`alias`.`a`) and ((`test`.`alias`.`b`) = `test`.`t1`.`a`)))) +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` where (`test`.`alias`.`b`,(select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` > `test`.`alias`.`a` and (`test`.`alias`.`b`) = `test`.`t1`.`a`)) SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=on'; SELECT * FROM t1 AS alias WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); @@ -623,7 +623,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`alias`.`b`) and (`test`.`alias`.`b` > `test`.`alias`.`a`)) +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`alias`.`b` and `test`.`alias`.`b` > `test`.`alias`.`a` drop table t1; set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; @@ -661,7 +661,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.alias1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.alias2.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t2` `alias2` where (<`test`.`alias1`.`a`,`test`.`alias2`.`b`>((`test`.`alias1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where ((`test`.`t2`.`b` > `test`.`alias2`.`b`) and ((`test`.`alias1`.`a`) = `test`.`t2`.`b`))))) or (`test`.`alias1`.`a` = 5)) +Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t2` `alias2` where <`test`.`alias1`.`a`,`test`.`alias2`.`b`>((`test`.`alias1`.`a`,(select `test`.`t2`.`b` from `test`.`t2` where `test`.`t2`.`b` > `test`.`alias2`.`b` and (`test`.`alias1`.`a`) = `test`.`t2`.`b`))) or `test`.`alias1`.`a` = 5 drop table t1, t2; set optimizer_switch=default; set optimizer_switch='exists_to_in=on'; diff --git a/mysql-test/r/subselect_extra.result b/mysql-test/r/subselect_extra.result index 48b80e02e1a..73642c09324 100644 --- a/mysql-test/r/subselect_extra.result +++ b/mysql-test/r/subselect_extra.result @@ -71,7 +71,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where ((`test`.`x1`.`id` = `test`.`t1`.`id`) and (`test`.`t1`.`cur_date` = 0)) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date @@ -83,7 +83,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t2); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where ((`test`.`x1`.`id` = `test`.`t2`.`id`) and (`test`.`t2`.`cur_date` = 0)) +Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date diff --git a/mysql-test/r/subselect_extra_no_semijoin.result b/mysql-test/r/subselect_extra_no_semijoin.result index 7cfce6dd006..8ed260cb31a 100644 --- a/mysql-test/r/subselect_extra_no_semijoin.result +++ b/mysql-test/r/subselect_extra_no_semijoin.result @@ -75,7 +75,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <`test`.`t1`.`id`,`test`.`t1`.`cur_date`>((`test`.`t1`.`id`,(select `test`.`x1`.`id` from `test`.`t1` `x1` where ((`test`.`t1`.`cur_date` = 0) and ((`test`.`t1`.`id`) = `test`.`x1`.`id`))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <`test`.`t1`.`id`,`test`.`t1`.`cur_date`>((`test`.`t1`.`id`,(select `test`.`x1`.`id` from `test`.`t1` `x1` where `test`.`t1`.`cur_date` = 0 and (`test`.`t1`.`id`) = `test`.`x1`.`id`))) select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date @@ -87,7 +87,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <`test`.`t2`.`id`,`test`.`t2`.`cur_date`>((`test`.`t2`.`id`,(select `test`.`x1`.`id` from `test`.`t2` `x1` where ((`test`.`t2`.`cur_date` = 0) and ((`test`.`t2`.`id`) = `test`.`x1`.`id`))))) +Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <`test`.`t2`.`id`,`test`.`t2`.`cur_date`>((`test`.`t2`.`id`,(select `test`.`x1`.`id` from `test`.`t2` `x1` where `test`.`t2`.`cur_date` = 0 and (`test`.`t2`.`id`) = `test`.`x1`.`id`))) select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date @@ -351,7 +351,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <0>((0,(select 0 from dual where ((0) = 0)))) +Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <0>((0,(select 0 from dual where (0) = 0))) SELECT * FROM t2 RIGHT JOIN v1 AS t ON t.a != 0 WHERE t.a IN (SELECT b FROM t1); a a b @@ -364,7 +364,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <0>((0,(select 0 from dual where ((0) = 0)))) +Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <0>((0,(select 0 from dual where (0) = 0))) DROP VIEW v1; DROP TABLE t1,t2; # diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index af3df9ec811..0d40ca3d01f 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b1` from `test`.`t2` where (`test`.`t2`.`b1` > '0') ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b1` from `test`.`t2` where `test`.`t2`.`b1` > '0' ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1`)))) select * from t1 where a1 in (select b1 from t2 where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -61,7 +61,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b1` from `test`.`t2` where (`test`.`t2`.`b1` > '0') ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b1` from `test`.`t2` where `test`.`t2`.`b1` > '0' ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1`)))) select * from t1 where a1 in (select b1 from t2 where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -72,7 +72,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (`test`.`t2`.`b1` > '0') ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`b2`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` > '0' ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`b2`)))) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b1 > '0' group by b1, b2); a1 a2 1 - 01 2 - 01 @@ -83,7 +83,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using temporary Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where (`test`.`t2`.`b1` > '0') group by `test`.`t2`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`min(b2)`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`b1` > '0' group by `test`.`t2`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`min(b2)`)))) select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -94,7 +94,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where; 2 MATERIALIZED t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`>((`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( (select `test`.`t2i`.`b1` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`>((`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( (select `test`.`t2i`.`b1` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1`)))) select * from t1i where a1 in (select b1 from t2i where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -105,7 +105,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL # 18 # 3 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # 9 # 5 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`>((`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`max(b1)`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`>((`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`max(b1)`)))) select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -116,7 +116,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where; 2 MATERIALIZED t2i index it2i1,it2i3 it2i3 # NULL 5 100.00 Using where; Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`b2`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`b2`)))) select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -127,7 +127,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL # # # 3 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`max(b2)`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`max(b2)`)))) select * from t1i where (a1, a2) in (select b1, max(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -138,7 +138,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL # # # 3 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`min(b2)`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1` ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`min(b2)`)))) select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -149,7 +149,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2i range NULL it2i3 9 NULL 3 100.00 Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`max(b2)`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`max(b2)`)))) select * from t1 where (a1, a2) in (select b1, max(b2) from t2i group by b1); a1 a2 1 - 01 2 - 01 @@ -178,7 +178,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2i range it2i1,it2i3 it2i3 18 NULL 3 100.00 Using where; Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`min(b2)`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1` ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`min(b2)`)))) select * from t1 where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -225,7 +225,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2` ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`b2`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2` ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`b2`)))) select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -236,7 +236,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index 2 MATERIALIZED t2i index NULL it2i3 18 NULL 5 100.00 Using index Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2` ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`b2`)))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2` ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`b2`)))) select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -291,7 +291,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 MATERIALIZED t2i index it2i2 it2i3 18 NULL 5 100.00 Using where; Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (`test`.`t2`.`b1` > '0') ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`b2`)))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`b1`) and (`test`.`t3`.`c2` = ``.`b2`)))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`c1`) and (`test`.`t1`.`a2` = ``.`c2`))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` > '0' ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`b2`)))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`b1` and `test`.`t3`.`c2` = ``.`b2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`c1` and `test`.`t1`.`a2` = ``.`c2`)))) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and (a1, a2) in (select c1, c2 from t3 @@ -310,7 +310,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 MATERIALIZED t2i index it2i2 # # # 5 100.00 # 2 MATERIALIZED t2i index it2i1,it2i3 # # # 5 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where (<`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`b2`)))))) and <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3i`.`c1` in on distinct_key where ((`test`.`t3i`.`c1` = ``.`b1`) and (`test`.`t3i`.`c2` = ``.`b2`)))))) ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`c1`) and (`test`.`t1i`.`a2` = ``.`c2`))))))) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`b2`)))) and <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3i`.`c1` in on distinct_key where `test`.`t3i`.`c1` = ``.`b1` and `test`.`t3i`.`c2` = ``.`b2`)))) ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`c1` and `test`.`t1i`.`a2` = ``.`c2`)))) select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and (a1, a2) in (select c1, c2 from t3i @@ -333,7 +333,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`)))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`b2`)))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`b1`) and (`test`.`t3`.`c2` = ``.`b2`)))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`c1`) and (`test`.`t1`.`a2` = ``.`c2`))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`b2`)))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`b1` and `test`.`t3`.`c2` = ``.`b2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`c1` and `test`.`t1`.`a2` = ``.`c2`)))) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -358,7 +358,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and ((`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3c`.`c1`,`test`.`t3c`.`c2` from `test`.`t3` `t3c` where <`test`.`t3c`.`c1`,`test`.`t3c`.`c2`>(((`test`.`t3c`.`c1`,`test`.`t3c`.`c2`),(`test`.`t3c`.`c1`,`test`.`t3c`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3c`.`c1` in on distinct_key where ((`test`.`t3c`.`c1` = ``.`b1`) and (`test`.`t3c`.`c2` = ``.`b2`)))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`c1`) and (`test`.`t1`.`a2` = ``.`c2`))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3c`.`c1`,`test`.`t3c`.`c2` from `test`.`t3` `t3c` where <`test`.`t3c`.`c1`,`test`.`t3c`.`c2`>(((`test`.`t3c`.`c1`,`test`.`t3c`.`c2`),(`test`.`t3c`.`c1`,`test`.`t3c`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3c`.`c1` in on distinct_key where `test`.`t3c`.`c1` = ``.`b1` and `test`.`t3c`.`c2` = ``.`b2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`c1` and `test`.`t1`.`a2` = ``.`c2`)))) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 t3a where c1 = a1) or @@ -394,7 +394,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 8 MATERIALIZED t2i index it2i1,it2i3 # # # 5 100.00 # NULL UNION RESULT ALL NULL # # # NULL NULL # Warnings: -Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`)))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b1`) and (`test`.`t1`.`a2` = ``.`b2`)))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`b1`) and (`test`.`t3`.`c2` = ``.`b2`)))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`c1`) and (`test`.`t1`.`a2` = ``.`c2`)))))))) union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where (<`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`b1`) and (`test`.`t1i`.`a2` = ``.`b2`)))))) and <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3i`.`c1` in on distinct_key where ((`test`.`t3i`.`c1` = ``.`b1`) and (`test`.`t3i`.`c2` = ``.`b2`)))))) ), (`test`.`t1i`.`a1` in on distinct_key where ((`test`.`t1i`.`a1` = ``.`c1`) and (`test`.`t1i`.`a2` = ``.`c2`)))))))) +Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b1` and `test`.`t1`.`a2` = ``.`b2`)))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`b1` and `test`.`t3`.`c2` = ``.`b2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`c1` and `test`.`t1`.`a2` = ``.`c2`))))) union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`b1` and `test`.`t1i`.`a2` = ``.`b2`)))) and <`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( (select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3i`.`c1` in on distinct_key where `test`.`t3i`.`c1` = ``.`b1` and `test`.`t3i`.`c2` = ``.`b2`)))) ), (`test`.`t1i`.`a1` in on distinct_key where `test`.`t1i`.`a1` = ``.`c1` and `test`.`t1i`.`a2` = ``.`c2`))))) (select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -423,7 +423,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and ((`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`b1`) and (`test`.`t3`.`c2` = ``.`b2`)))))) ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`c1`) and (`test`.`t1`.`a2` = ``.`c2`))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t1`.`a1`) = `test`.`t1`.`a1` and (`test`.`t1`.`a2`) = `test`.`t1`.`a2` union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`b1` and `test`.`t3`.`c2` = ``.`b2`)))) ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`c1` and `test`.`t1`.`a2` = ``.`c2`)))) select * from t1 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (a1, a2) in (select c1, c2 from t3 @@ -446,7 +446,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`c1` = `test`.`t1`.`a1`) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and ((`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where (`test`.`t2i`.`b2` > '0') ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`b1`) and (`test`.`t3`.`c2` = ``.`b2`)))))) ), (`test`.`t3`.`c1` in on distinct_key where ((`test`.`t3`.`c1` = ``.`c1`) and (`test`.`t3`.`c2` = ``.`c2`))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`c1` = `test`.`t1`.`a1` and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t1`.`a1`) = `test`.`t1`.`a1` and (`test`.`t1`.`a2`) = `test`.`t1`.`a2` union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <`test`.`t3`.`c1`,`test`.`t3`.`c2`>(((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`b1` and `test`.`t3`.`c2` = ``.`b2`)))) ), (`test`.`t3`.`c1` in on distinct_key where `test`.`t3`.`c1` = ``.`c1` and `test`.`t3`.`c2` = ``.`c2`)))) select * from t1, t3 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (c1, c2) in (select c1, c2 from t3 @@ -468,7 +468,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <`test`.`t3`.`c1`>((`test`.`t3`.`c1`,(select `test`.`t1`.`a1` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t3`.`c1`) = `test`.`t1`.`a1`)) union select `test`.`t2`.`b1` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t3`.`c1`) = `test`.`t2`.`b1`))))) +Note 1003 select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <`test`.`t3`.`c1`>((`test`.`t3`.`c1`,(select `test`.`t1`.`a1` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t3`.`c1`) = `test`.`t1`.`a1` union select `test`.`t2`.`b1` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t3`.`c1`) = `test`.`t2`.`b1`))) select * from t3 where c1 in (select a1 from t1 where a1 > '0' UNION select b1 from t2 where b1 < '9'); c1 c2 @@ -492,14 +492,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a2' of SELECT #6 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (<`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and ((`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t3c`.`c1`,`test`.`t3c`.`c2` from `test`.`t3` `t3c` where (<`test`.`t3c`.`c1`,`test`.`t3c`.`c2`,`test`.`t1`.`a2`>(((`test`.`t3c`.`c1`,`test`.`t3c`.`c2`),(((`test`.`t3c`.`c1`) in t2i on it2i3 where (((`test`.`t2i`.`b2` > '0') or (`test`.`t2i`.`b2` = `test`.`t1`.`a2`)) and ((`test`.`t3c`.`c1`) = `test`.`t2i`.`b1`) and ((`test`.`t3c`.`c2`) = `test`.`t2i`.`b2`)))))) and ((`test`.`t1`.`a1`) = `test`.`t3c`.`c1`) and ((`test`.`t1`.`a2`) = `test`.`t3c`.`c2`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t3c`.`c1`,`test`.`t3c`.`c2` from `test`.`t3` `t3c` where <`test`.`t3c`.`c1`,`test`.`t3c`.`c2`,`test`.`t1`.`a2`>(((`test`.`t3c`.`c1`,`test`.`t3c`.`c2`),(((`test`.`t3c`.`c1`) in t2i on it2i3 where (`test`.`t2i`.`b2` > '0' or `test`.`t2i`.`b2` = `test`.`t1`.`a2`) and (`test`.`t3c`.`c1`) = `test`.`t2i`.`b1` and (`test`.`t3c`.`c2`) = `test`.`t2i`.`b2`)))) and (`test`.`t1`.`a1`) = `test`.`t3c`.`c1` and (`test`.`t1`.`a2`) = `test`.`t3c`.`c2`))) explain extended select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((((`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and (((`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and ('1 - 01') and ('2 - 01'))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or '1 - 01' is null) and ((`test`.`t1`.`a2`) = '2 - 01' or '2 - 01' is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); a1 a2 1 - 01 2 - 01 @@ -509,7 +509,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((((`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and (((`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and ('1 - 01') and ('2 - 01'))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or '1 - 01' is null) and ((`test`.`t1`.`a2`) = '2 - 01' or '2 - 01' is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual); a1 a2 1 - 01 2 - 01 @@ -541,7 +541,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort 2 DEPENDENT SUBQUERY columns unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` group by <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(((`test`.`t1`.`a1`) in columns on PRIMARY where trigcond(((`test`.`t1`.`a1`) = `test`.`columns`.`col`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` group by <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(((`test`.`t1`.`a1`) in columns on PRIMARY where trigcond((`test`.`t1`.`a1`) = `test`.`columns`.`col`))))) select * from t1 group by (a1 in (select col from columns)); a1 a2 1 - 00 2 - 00 @@ -602,7 +602,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select `test`.`t2_16`.`b1` from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select `test`.`t2_16`.`b1` from `test`.`t2_16` where `test`.`t2_16`.`b1` > '0' and (`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select b1 from t2_16 where b1 > '0'); @@ -616,7 +616,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),(select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`) and ((`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),(select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` where `test`.`t2_16`.`b1` > '0' and (`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1` and (`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))) select left(a1,7), left(a2,7) from t1_16 where (a1,a2) in (select b1, b2 from t2_16 where b1 > '0'); @@ -630,7 +630,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( (select substr(`test`.`t2_16`.`b1`,1,16) from `test`.`t2_16` where (`test`.`t2_16`.`b1` > '0') ), (`test`.`t1_16`.`a1` in on distinct_key where ((`test`.`t1_16`.`a1` = ``.`substring(b1,1,16)`)))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( (select substr(`test`.`t2_16`.`b1`,1,16) from `test`.`t2_16` where `test`.`t2_16`.`b1` > '0' ), (`test`.`t1_16`.`a1` in on distinct_key where `test`.`t1_16`.`a1` = ``.`substring(b1,1,16)`)))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select substring(b1,1,16) from t2_16 where b1 > '0'); @@ -644,7 +644,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having ((`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ',')))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having (`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -659,7 +659,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( (select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` ), (`test`.`t1_16`.`a1` in on distinct_key where ((`test`.`t1_16`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( (select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` ), (`test`.`t1_16`.`a1` in on distinct_key where `test`.`t1_16`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -681,7 +681,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) 4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where ((concat(`test`.`t1`.`a1`,'x'),(select left(`test`.`t1_16`.`a1`,8) from `test`.`t1_16` where (<`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),(select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` join `test`.`t2` where ((`test`.`t2`.`b2` = substr(`test`.`t2_16`.`b2`,1,6)) and <`test`.`t2`.`b1`>((`test`.`t2`.`b1`,`test`.`t2`.`b1` in ( (select `test`.`t3`.`c1` from `test`.`t3` where (`test`.`t3`.`c2` > '0') ), (`test`.`t2`.`b1` in on distinct_key where ((`test`.`t2`.`b1` = ``.`c1`)))))) and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`) and ((`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))))) and ((concat(`test`.`t1`.`a1`,'x')) = left(`test`.`t1_16`.`a1`,8)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where ((concat(`test`.`t1`.`a1`,'x'),(select left(`test`.`t1_16`.`a1`,8) from `test`.`t1_16` where <`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),(select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` join `test`.`t2` where `test`.`t2`.`b2` = substr(`test`.`t2_16`.`b2`,1,6) and <`test`.`t2`.`b1`>((`test`.`t2`.`b1`,`test`.`t2`.`b1` in ( (select `test`.`t3`.`c1` from `test`.`t3` where `test`.`t3`.`c2` > '0' ), (`test`.`t2`.`b1` in on distinct_key where `test`.`t2`.`b1` = ``.`c1`)))) and (`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1` and (`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))) and (concat(`test`.`t1`.`a1`,'x')) = left(`test`.`t1_16`.`a1`,8)))) drop table t1_16, t2_16, t3_16; set @blob_len = 512; set @suffix_len = @blob_len - @prefix_len; @@ -715,7 +715,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(select `test`.`t2_512`.`b1` from `test`.`t2_512` where ((`test`.`t2_512`.`b1` > '0') and ((`test`.`t1_512`.`a1`) = `test`.`t2_512`.`b1`))))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(select `test`.`t2_512`.`b1` from `test`.`t2_512` where `test`.`t2_512`.`b1` > '0' and (`test`.`t1_512`.`a1`) = `test`.`t2_512`.`b1`))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select b1 from t2_512 where b1 > '0'); @@ -729,7 +729,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`,`test`.`t1_512`.`a2`>(((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a2`),(select `test`.`t2_512`.`b1`,`test`.`t2_512`.`b2` from `test`.`t2_512` where ((`test`.`t2_512`.`b1` > '0') and ((`test`.`t1_512`.`a1`) = `test`.`t2_512`.`b1`) and ((`test`.`t1_512`.`a2`) = `test`.`t2_512`.`b2`))))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`,`test`.`t1_512`.`a2`>(((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a2`),(select `test`.`t2_512`.`b1`,`test`.`t2_512`.`b2` from `test`.`t2_512` where `test`.`t2_512`.`b1` > '0' and (`test`.`t1_512`.`a1`) = `test`.`t2_512`.`b1` and (`test`.`t1_512`.`a2`) = `test`.`t2_512`.`b2`))) select left(a1,7), left(a2,7) from t1_512 where (a1,a2) in (select b1, b2 from t2_512 where b1 > '0'); @@ -743,7 +743,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select substr(`test`.`t2_512`.`b1`,1,512) from `test`.`t2_512` where (`test`.`t2_512`.`b1` > '0') ), (`test`.`t1_512`.`a1` in on distinct_key where ((`test`.`t1_512`.`a1` = ``.`substring(b1,1,512)`)))))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select substr(`test`.`t2_512`.`b1`,1,512) from `test`.`t2_512` where `test`.`t2_512`.`b1` > '0' ), (`test`.`t1_512`.`a1` in on distinct_key where `test`.`t1_512`.`a1` = ``.`substring(b1,1,512)`)))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select substring(b1,1,512) from t2_512 where b1 > '0'); @@ -757,7 +757,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where ((`test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where `test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -774,7 +774,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where ((`test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where `test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -816,7 +816,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(select `test`.`t2_1024`.`b1` from `test`.`t2_1024` where ((`test`.`t2_1024`.`b1` > '0') and ((`test`.`t1_1024`.`a1`) = `test`.`t2_1024`.`b1`))))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(select `test`.`t2_1024`.`b1` from `test`.`t2_1024` where `test`.`t2_1024`.`b1` > '0' and (`test`.`t1_1024`.`a1`) = `test`.`t2_1024`.`b1`))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select b1 from t2_1024 where b1 > '0'); @@ -830,7 +830,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a2`>(((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a2`),(select `test`.`t2_1024`.`b1`,`test`.`t2_1024`.`b2` from `test`.`t2_1024` where ((`test`.`t2_1024`.`b1` > '0') and ((`test`.`t1_1024`.`a1`) = `test`.`t2_1024`.`b1`) and ((`test`.`t1_1024`.`a2`) = `test`.`t2_1024`.`b2`))))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a2`>(((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a2`),(select `test`.`t2_1024`.`b1`,`test`.`t2_1024`.`b2` from `test`.`t2_1024` where `test`.`t2_1024`.`b1` > '0' and (`test`.`t1_1024`.`a1`) = `test`.`t2_1024`.`b1` and (`test`.`t1_1024`.`a2`) = `test`.`t2_1024`.`b2`))) select left(a1,7), left(a2,7) from t1_1024 where (a1,a2) in (select b1, b2 from t2_1024 where b1 > '0'); @@ -844,7 +844,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(select substr(`test`.`t2_1024`.`b1`,1,1024) from `test`.`t2_1024` where ((`test`.`t2_1024`.`b1` > '0') and ((`test`.`t1_1024`.`a1`) = substr(`test`.`t2_1024`.`b1`,1,1024)))))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(select substr(`test`.`t2_1024`.`b1`,1,1024) from `test`.`t2_1024` where `test`.`t2_1024`.`b1` > '0' and (`test`.`t1_1024`.`a1`) = substr(`test`.`t2_1024`.`b1`,1,1024)))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0'); @@ -858,7 +858,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where ((`test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -875,7 +875,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where ((`test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -917,7 +917,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(select `test`.`t2_1025`.`b1` from `test`.`t2_1025` where ((`test`.`t2_1025`.`b1` > '0') and ((`test`.`t1_1025`.`a1`) = `test`.`t2_1025`.`b1`))))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(select `test`.`t2_1025`.`b1` from `test`.`t2_1025` where `test`.`t2_1025`.`b1` > '0' and (`test`.`t1_1025`.`a1`) = `test`.`t2_1025`.`b1`))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select b1 from t2_1025 where b1 > '0'); @@ -931,7 +931,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a2`>(((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a2`),(select `test`.`t2_1025`.`b1`,`test`.`t2_1025`.`b2` from `test`.`t2_1025` where ((`test`.`t2_1025`.`b1` > '0') and ((`test`.`t1_1025`.`a1`) = `test`.`t2_1025`.`b1`) and ((`test`.`t1_1025`.`a2`) = `test`.`t2_1025`.`b2`))))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a2`>(((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a2`),(select `test`.`t2_1025`.`b1`,`test`.`t2_1025`.`b2` from `test`.`t2_1025` where `test`.`t2_1025`.`b1` > '0' and (`test`.`t1_1025`.`a1`) = `test`.`t2_1025`.`b1` and (`test`.`t1_1025`.`a2`) = `test`.`t2_1025`.`b2`))) select left(a1,7), left(a2,7) from t1_1025 where (a1,a2) in (select b1, b2 from t2_1025 where b1 > '0'); @@ -945,7 +945,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(select substr(`test`.`t2_1025`.`b1`,1,1025) from `test`.`t2_1025` where ((`test`.`t2_1025`.`b1` > '0') and ((`test`.`t1_1025`.`a1`) = substr(`test`.`t2_1025`.`b1`,1,1025)))))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(select substr(`test`.`t2_1025`.`b1`,1,1025) from `test`.`t2_1025` where `test`.`t2_1025`.`b1` > '0' and (`test`.`t1_1025`.`a1`) = substr(`test`.`t2_1025`.`b1`,1,1025)))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0'); @@ -959,7 +959,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where ((`test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -976,7 +976,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where ((`test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -1001,7 +1001,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1bit ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t2bit ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select conv(`test`.`t1bit`.`a1`,10,2) AS `bin(a1)`,conv(`test`.`t1bit`.`a2`,10,2) AS `bin(a2)` from `test`.`t1bit` where <`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`>(((`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`),(`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`) in ( (select `test`.`t2bit`.`b1`,`test`.`t2bit`.`b2` from `test`.`t2bit` ), (`test`.`t1bit`.`a1` in on distinct_key where ((`test`.`t1bit`.`a1` = ``.`b1`) and (`test`.`t1bit`.`a2` = ``.`b2`)))))) +Note 1003 select conv(`test`.`t1bit`.`a1`,10,2) AS `bin(a1)`,conv(`test`.`t1bit`.`a2`,10,2) AS `bin(a2)` from `test`.`t1bit` where <`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`>(((`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`),(`test`.`t1bit`.`a1`,`test`.`t1bit`.`a2`) in ( (select `test`.`t2bit`.`b1`,`test`.`t2bit`.`b2` from `test`.`t2bit` ), (`test`.`t1bit`.`a1` in on distinct_key where `test`.`t1bit`.`a1` = ``.`b1` and `test`.`t1bit`.`a2` = ``.`b2`)))) select bin(a1), bin(a2) from t1bit where (a1, a2) in (select b1, b2 from t2bit); @@ -1024,7 +1024,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1bb ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2bb ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` where <`test`.`t1bb`.`a1`,`test`.`t1bb`.`a2`>(((`test`.`t1bb`.`a1`,`test`.`t1bb`.`a2`),(select `test`.`t2bb`.`b1`,`test`.`t2bb`.`b2` from `test`.`t2bb` where (((`test`.`t1bb`.`a1`) = `test`.`t2bb`.`b1`) and ((`test`.`t1bb`.`a2`) = `test`.`t2bb`.`b2`))))) +Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` where <`test`.`t1bb`.`a1`,`test`.`t1bb`.`a2`>(((`test`.`t1bb`.`a1`,`test`.`t1bb`.`a2`),(select `test`.`t2bb`.`b1`,`test`.`t2bb`.`b2` from `test`.`t2bb` where (`test`.`t1bb`.`a1`) = `test`.`t2bb`.`b1` and (`test`.`t1bb`.`a2`) = `test`.`t2bb`.`b2`))) select bin(a1), a2 from t1bb where (a1, a2) in (select b1, b2 from t2bb); @@ -1072,7 +1072,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1086,7 +1086,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using where; Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1100,7 +1100,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using where; Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1113,7 +1113,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 group by a having a in (select c from t2 where d >= 20); a 2 @@ -1125,7 +1125,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 group by a having a in (select c from t2 where d >= 20); a 2 @@ -1140,7 +1140,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 Note 1981 Aggregate function 'max()' of SELECT #3 belongs to SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where ((<`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where (max(`test`.`t1`.`b`) = `test`.`t3`.`e`) having ((`test`.`t2`.`d`) >= (`test`.`t3`.`e`)))))) and ((`test`.`t1`.`a`) = `test`.`t2`.`c`))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where (<`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where max(`test`.`t1`.`b`) = `test`.`t3`.`e` having (`test`.`t2`.`d`) >= (`test`.`t3`.`e`))))) and (`test`.`t1`.`a`) = `test`.`t2`.`c`))) select a from t1 group by a having a in (select c from t2 where d >= some(select e from t3 where max(b)=e)); a @@ -1155,7 +1155,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`,`test`.`t1`.`b`>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where ((<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`)))))) and ((`test`.`t1`.`a`) = `test`.`t2`.`c`))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`,`test`.`t1`.`b`>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) and (`test`.`t1`.`a`) = `test`.`t2`.`c`))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -1824,7 +1824,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select 8 AS `a` from dual where <8>((8,(select min(`test`.`t1`.`a`) from `test`.`t1` having ((8) = (min(`test`.`t1`.`a`)))))) +Note 1003 select 8 AS `a` from dual where <8>((8,(select min(`test`.`t1`.`a`) from `test`.`t1` having (8) = (min(`test`.`t1`.`a`))))) DROP TABLE t1; # # BUG#904432: Wrong result with LEFT JOIN, constant table, semijoin=ON,materialization=ON @@ -1925,7 +1925,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = ``.`MAX(c)`) and ((isnull(``.`MAX(c)`)) or (``.`MAX(c)` = 7))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where `test`.`t1`.`b` = 7 and `test`.`t1`.`a` = ``.`MAX(c)` and ((``.`MAX(c)` is null) or ``.`MAX(c)` = 7) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b @@ -2168,7 +2168,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index 2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where (`test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME`) order by `test`.`t1`.`db` desc +Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where `test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME` order by `test`.`t1`.`db` desc drop table t1; drop database mysqltest1; drop database mysqltest2; diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result index 24640154c59..c7b0f0d46c6 100644 --- a/mysql-test/r/subselect_mat_cost_bugs.result +++ b/mysql-test/r/subselect_mat_cost_bugs.result @@ -100,7 +100,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 index c3 c3 9 NULL 2 100.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on(((`test`.`t1a`.`c2` = `test`.`t1b`.`pk`) and 2)) where ((`test`.`t1`.`pk` <> 0) and ((`test`.`t1`.`c1`) = `test`.`t1a`.`c1`) and (`test`.`t2`.`c3` = `test`.`t1b`.`c4`))))) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on(`test`.`t1a`.`c2` = `test`.`t1b`.`pk` and 2) where `test`.`t1`.`pk` <> 0 and (`test`.`t1`.`c1`) = `test`.`t1a`.`c1` and `test`.`t2`.`c3` = `test`.`t1b`.`c4`))) SELECT pk FROM t1 WHERE c1 IN diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result index 303303f4619..df9f1872a8c 100644 --- a/mysql-test/r/subselect_no_exists_to_in.result +++ b/mysql-test/r/subselect_no_exists_to_in.result @@ -60,7 +60,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -201,7 +201,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -241,7 +241,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -287,7 +287,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -331,7 +331,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -349,7 +349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 100.00 Using index Warnings: Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <`test`.`t6`.`clinic_uq`>(exists(select 1 from `test`.`t7` where (`test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`))) +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <`test`.`t6`.`clinic_uq`>(exists(select 1 from `test`.`t7` where `test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`)) select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; @@ -410,13 +410,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -563,7 +563,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -745,7 +745,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -758,7 +758,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -766,7 +766,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3))))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -892,7 +892,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -914,7 +914,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having (`test`.`t2`.`a`))))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -929,7 +929,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (((`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having (`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and ((`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1329,7 +1329,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1339,7 +1339,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1384,7 +1384,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1446,7 +1446,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1456,7 +1456,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1467,7 +1467,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1489,7 +1489,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1499,7 +1499,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1510,7 +1510,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1526,7 +1526,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1617,25 +1617,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1650,7 +1650,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1658,7 +1658,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1669,7 +1669,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1677,7 +1677,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1720,7 +1720,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1890,14 +1890,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and ((`test`.`t1`.`id`) = `test`.`t1`.`id`)))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1923,7 +1923,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2433,7 +2433,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <`test`.`up`.`a`>(exists(select 1 from `test`.`t1` where (`test`.`t1`.`a` = `test`.`up`.`a`))) +Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <`test`.`up`.`a`>(exists(select 1 from `test`.`t1` where `test`.`t1`.`a` = `test`.`up`.`a`)) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2980,20 +2980,20 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4446,7 +4446,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`)) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); @@ -4458,7 +4458,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`))) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4539,14 +4539,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 6bdb5d1fbc2..331e0840b0d 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -63,7 +63,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -204,7 +204,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -244,7 +244,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -290,7 +290,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -334,7 +334,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -352,7 +352,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t6 ALL i1 NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where (`test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`) +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq` select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; @@ -413,13 +413,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -566,7 +566,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -748,7 +748,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -761,7 +761,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -769,7 +769,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3))))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -895,7 +895,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -917,7 +917,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having (`test`.`t2`.`a`))))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -932,7 +932,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (((`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having (`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and ((`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1332,7 +1332,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1342,7 +1342,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1387,7 +1387,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1449,7 +1449,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1459,7 +1459,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1470,7 +1470,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1492,7 +1492,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1502,7 +1502,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1513,7 +1513,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1529,7 +1529,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1620,25 +1620,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond((`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1653,7 +1653,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1661,7 +1661,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1672,7 +1672,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1680,7 +1680,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1723,7 +1723,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1893,14 +1893,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and ((`test`.`t1`.`id`) = `test`.`t1`.`id`)))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not((1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null)))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1926,7 +1926,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2436,7 +2436,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`up`.`a`) +Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`up`.`a` drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2983,19 +2983,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 9 100.00 Using where; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`flag` = 'N') and (`test`.`t2`.`one` = `test`.`t1`.`one`) and (`test`.`t2`.`two` = `test`.`t1`.`two`)) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' and `test`.`t2`.`one` = `test`.`t1`.`one` and `test`.`t2`.`two` = `test`.`t1`.`two` explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4446,7 +4446,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`a` = `test`.`t1`.`a`) +Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); @@ -4458,7 +4458,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`))) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 2ce0188cc6d..b010a1880e2 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -59,7 +59,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -200,7 +200,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -240,7 +240,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,(select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,(select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -286,7 +286,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -330,7 +330,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select (select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select (select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -409,13 +409,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -562,7 +562,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -744,7 +744,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -757,7 +757,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -765,7 +765,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3)))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -891,7 +891,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -913,7 +913,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having (`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -928,7 +928,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (((`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having (`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and ((`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1328,7 +1328,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1338,7 +1338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1383,7 +1383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1455,7 +1455,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY where ((`test`.`t1`.`b` <> 30) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1466,7 +1466,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where 2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`)))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and (`test`.`t2`.`a`) = `test`.`t1`.`a`)) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1498,7 +1498,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1509,7 +1509,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`)))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` and (`test`.`t2`.`a`) = `test`.`t1`.`a`)) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1525,7 +1525,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1616,25 +1616,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond((`test`.`t2`.`s1`))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1649,7 +1649,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1657,7 +1657,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1668,7 +1668,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1676,7 +1676,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1719,7 +1719,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1889,14 +1889,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and ((`test`.`t1`.`id`) = `test`.`t1`.`id`))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !(`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not((1,exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1922,7 +1922,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2432,7 +2432,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where (`test`.`up`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where ((`test`.`up`.`a`) = `test`.`t1`.`a`))) +Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where (`test`.`up`.`a`,(select `test`.`t1`.`a` from `test`.`t1` where (`test`.`up`.`a`) = `test`.`t1`.`a`)) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2979,19 +2979,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where ((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = 'N') and ((`test`.`t1`.`one`) = `test`.`t2`.`one`) and ((`test`.`t1`.`two`) = `test`.`t2`.`two`)))) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where ((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = 'N' and (`test`.`t1`.`one`) = `test`.`t2`.`one` and (`test`.`t1`.`two`) = `test`.`t2`.`two`)) explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4442,7 +4442,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where (`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` where ((`test`.`t1`.`a`) = `test`.`t2`.`a`))) +Note 1003 select 2 AS `2` from `test`.`t1` where (`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t1`.`a`) = `test`.`t2`.`a`)) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); @@ -4454,7 +4454,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))) +Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 22f25cb0d50..59e50de30e4 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -62,7 +62,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -203,7 +203,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -243,7 +243,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,(select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,(select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -289,7 +289,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -333,7 +333,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select (select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select (select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -351,7 +351,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t6 ALL i1 NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where (`test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`) +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq` select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; @@ -412,13 +412,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -565,7 +565,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -747,7 +747,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -760,7 +760,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -768,7 +768,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3)))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -894,7 +894,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -916,7 +916,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having (`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -931,7 +931,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (((`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having (`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and ((`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1331,7 +1331,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1341,7 +1341,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1386,7 +1386,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1448,7 +1448,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1458,7 +1458,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1469,7 +1469,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1491,7 +1491,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1501,7 +1501,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1512,7 +1512,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1528,7 +1528,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1619,25 +1619,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond((`test`.`t2`.`s1`))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond((`test`.`t2`.`s1`))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1652,7 +1652,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1660,7 +1660,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1671,7 +1671,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1679,7 +1679,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1722,7 +1722,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1892,14 +1892,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and ((`test`.`t1`.`id`) = `test`.`t1`.`id`))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !(`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not((1,exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1925,7 +1925,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2983,20 +2983,20 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond((((`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond((((`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond((`test`.`t2`.`one`)) and trigcond((`test`.`t2`.`two`))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4462,7 +4462,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))) +Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4543,14 +4543,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: -Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a`) join `test`.`t1` where (``.`min(a)` = 1) +Note 1003 select 1 AS `1` from (select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 017e9623c76..2b6c103a4af 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -59,7 +59,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +Note 1003 select 1 AS `1` from dual having (select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -200,7 +200,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`))) +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1)) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where `test`.`t4`.`b` = (select max(`test`.`t2`.`a`) * 4 from `test`.`t2`)) select (select a from t3 where a 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`a` < 8 order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`a` > 1) `tt` set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a @@ -240,7 +240,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((select avg(`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -286,7 +286,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(`test`.`t2`.`b`) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2); a 7 @@ -330,7 +330,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select <`test`.`t2`.`a`>((select 2 from dual where 2 = `test`.`t2`.`a` union select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -348,7 +348,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index Warnings: Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <`test`.`t6`.`clinic_uq`>((`test`.`t6`.`clinic_uq`,`test`.`t6`.`clinic_uq` in ( (select `test`.`t7`.`uq` from `test`.`t7` where 1 ), (`test`.`t6`.`clinic_uq` in on distinct_key where ((`test`.`t6`.`clinic_uq` = ``.`uq`)))))) +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <`test`.`t6`.`clinic_uq`>((`test`.`t6`.`clinic_uq`,`test`.`t6`.`clinic_uq` in ( (select `test`.`t7`.`uq` from `test`.`t7` where 1 ), (`test`.`t6`.`clinic_uq` in on distinct_key where `test`.`t6`.`clinic_uq` = ``.`uq`)))) select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; @@ -409,13 +409,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03') +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03' EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = DATE'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where `test`.`t1`.`date` = DATE'2002-08-03') AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -562,7 +562,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index @@ -744,7 +744,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref id id 5 const 1 100.00 Using index Warnings: Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = 1 SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -757,7 +757,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1249 Select 3 was reduced during optimization Note 1249 Select 2 was reduced during optimization -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = ((1 + 1))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where `test`.`t2`.`id` = (1 + 1) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index @@ -765,7 +765,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having ((`test`.`t2`.`id`) = (1)) union select 3 having ((`test`.`t2`.`id`) = (3))))) +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <`test`.`t2`.`id`>((`test`.`t2`.`id`,(select 1 having (`test`.`t2`.`id`) = (1) union select 3 having (`test`.`t2`.`id`) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -891,7 +891,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization -Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -913,7 +913,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index 2 MATERIALIZED t2 index a a 5 NULL 3 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`a`)))))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`a`)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -928,7 +928,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 index a a 5 NULL 3 100.00 Using index 2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where (`test`.`t3`.`a` = `test`.`t2`.`a`) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`a`)))))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1328,7 +1328,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from dual where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1338,7 +1338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select (0,(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 from `test`.`t1` `a` where 0 = 1)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1383,7 +1383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1445,7 +1445,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index 2 MATERIALIZED t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` ), (`test`.`t2`.`a` in on distinct_key where ((`test`.`t2`.`a` = ``.`a`)))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` ), (`test`.`t2`.`a` in on distinct_key where `test`.`t2`.`a` = ``.`a`)))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1455,7 +1455,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index 2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` where (`test`.`t1`.`b` <> 30) ), (`test`.`t2`.`a` in on distinct_key where ((`test`.`t2`.`a` = ``.`a`)))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`b` <> 30 ), (`test`.`t2`.`a` in on distinct_key where `test`.`t2`.`a` = ``.`a`)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1466,7 +1466,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using index 2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where (`test`.`t1`.`b` = `test`.`t3`.`a`) ), (`test`.`t2`.`a` in on distinct_key where ((`test`.`t2`.`a` = ``.`a`)))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` ), (`test`.`t2`.`a` in on distinct_key where `test`.`t2`.`a` = ``.`a`)))) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1498,7 +1498,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`)))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1509,7 +1509,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1525,7 +1525,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`)))))) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`)))) drop table t0, t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1616,25 +1616,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where ((`test`.`t1`.`s1` = ``.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where `test`.`t1`.`s1` = ``.`s1`)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where ((`test`.`t1`.`s1` = ``.`s1`)))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where `test`.`t1`.`s1` = ``.`s1`)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where ((`test`.`t1`.`s1` = ``.`s1`)))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` ), (`test`.`t1`.`s1` in on distinct_key where `test`.`t1`.`s1` = ``.`s1`)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index 2 MATERIALIZED t2 index s1 s1 6 NULL 2 50.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` where (`test`.`t2`.`s1` < 'a2') ), (`test`.`t1`.`s1` in on distinct_key where ((`test`.`t1`.`s1` = ``.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( (select `test`.`t2`.`s1` from `test`.`t2` where `test`.`t2`.`s1` < 'a2' ), (`test`.`t1`.`s1` in on distinct_key where `test`.`t1`.`s1` = ``.`s1`)))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1649,7 +1649,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1657,7 +1657,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1668,7 +1668,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1676,7 +1676,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1719,7 +1719,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,((select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`)))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1889,14 +1889,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where 2 MATERIALIZED t1 range PRIMARY PRIMARY 4 NULL 7 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<`test`.`t1`.`id`>((`test`.`t1`.`id`,`test`.`t1`.`id` in ( (select `test`.`t1`.`id` from `test`.`t1` where (`test`.`t1`.`id` < 8) ), (`test`.`t1`.`id` in on distinct_key where ((`test`.`t1`.`id` = ``.`id`)))))))) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,`test`.`t1`.`id` in ( (select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 ), (`test`.`t1`.`id` in on distinct_key where `test`.`t1`.`id` = ``.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not((1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null)))))) +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1922,7 +1922,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -2432,7 +2432,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <`test`.`up`.`a`>((`test`.`up`.`a`,`test`.`up`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` where 1 ), (`test`.`up`.`a` in on distinct_key where ((`test`.`up`.`a` = ``.`a`)))))) +Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <`test`.`up`.`a`>((`test`.`up`.`a`,`test`.`up`.`a` in ( (select `test`.`t1`.`a` from `test`.`t1` where 1 ), (`test`.`up`.`a` in on distinct_key where `test`.`up`.`a` = ``.`a`)))) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2979,19 +2979,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where (`test`.`t2`.`flag` = '0') ), (`test`.`t1`.`one` in on distinct_key where ((`test`.`t1`.`one` = ``.`one`) and (`test`.`t1`.`two` = ``.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where <`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where (`test`.`t2`.`flag` = 'N') ), (`test`.`t1`.`one` in on distinct_key where ((`test`.`t1`.`one` = ``.`one`) and (`test`.`t1`.`two` = ``.`two`)))))) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where <`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = 'N' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where (`test`.`t2`.`flag` = '0') ), (`test`.`t1`.`one` in on distinct_key where ((`test`.`t1`.`one` = ``.`one`) and (`test`.`t1`.`two` = ``.`two`)))))) AS `test` from `test`.`t1` +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -4442,7 +4442,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` where 1 ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`a`)))))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`a` from `test`.`t2` where 1 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`a`)))) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); @@ -4454,7 +4454,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))) +Note 1003 select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`))) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); diff --git a/mysql-test/r/subselect_partial_match.result b/mysql-test/r/subselect_partial_match.result index 9dc2b44fd30..256295cef28 100644 --- a/mysql-test/r/subselect_partial_match.result +++ b/mysql-test/r/subselect_partial_match.result @@ -775,7 +775,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using where 3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 select `table1`.`a1` AS `a1`,`table1`.`a2` AS `a2` from (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where (not((`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b2` from `test`.`t2` ), (`test`.`t1`.`a1` in on distinct_key where ((`test`.`t1`.`a1` = ``.`b2`)))))))) `table1` +Note 1003 select `table1`.`a1` AS `a1`,`table1`.`a2` AS `a2` from (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where !(`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( (select `test`.`t2`.`b2` from `test`.`t2` ), (`test`.`t1`.`a1` in on distinct_key where `test`.`t1`.`a1` = ``.`b2`)))) `table1` set optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1, t2; # diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index fdcfa800d1f..91d05a31dfa 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -74,7 +74,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where 1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t12`.`pk` = `test`.`t10`.`a`) and (`test`.`t10`.`pk` = `test`.`t1`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where `test`.`t12`.`pk` = `test`.`t10`.`a` and `test`.`t10`.`pk` = `test`.`t1`.`a` subqueries within outer joins go into ON expr. explAin extended select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10)); @@ -84,7 +84,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(((`test`.`A`.`A` = `test`.`t1`.`A`) And (`test`.`B`.`A`,`test`.`B`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`B`.`A` in on distinct_key where ((`test`.`B`.`A` = ``.`pk`))))))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And (`test`.`B`.`A`,`test`.`B`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`B`.`A` in on distinct_key where `test`.`B`.`A` = ``.`pk`)))) where 1 t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)" explAin extended select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10)); @@ -93,7 +93,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(((`test`.`t2`.`A` = `test`.`t1`.`A`) And (`test`.`t1`.`A`,`test`.`t1`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`t1`.`A` in on distinct_key where ((`test`.`t1`.`A` = ``.`pk`))))))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And (`test`.`t1`.`A`,`test`.`t1`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`t1`.`A` in on distinct_key where `test`.`t1`.`A` = ``.`pk`)))) where 1 set join_buffer_size=8*1024; we shouldn't flatten if we're going to get a join of > MAX_TABLES. explain select * from @@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t10`.`pk`) and (`test`.`t10`.`pk` < 3)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -503,7 +503,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where 1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t1`.`pk` = `test`.`t0`.`pk`) and (`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`)) +Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where `test`.`t1`.`pk` = `test`.`t0`.`pk` and `test`.`t2`.`vkey` = `test`.`t1`.`vnokey` SELECT vkey FROM t0 WHERE pk IN (SELECT t1.pk FROM t0 t1 JOIN t0 t2 ON t2.vkey = t1.vnokey); vkey @@ -767,11 +767,11 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) show warnings; Level Code Message Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -807,7 +807,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 11 func,func 1 100.00 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0); pk 2 @@ -816,7 +816,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`c` = `test`.`t1`.`c` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0); pk 1 @@ -826,7 +826,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`d` = `test`.`t1`.`d` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0); pk 2 @@ -835,7 +835,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`e` = `test`.`t1`.`e` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0); pk 1 @@ -845,7 +845,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`f` = `test`.`t1`.`f` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0); pk 1 @@ -855,7 +855,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`g` = `test`.`t1`.`g` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0); pk 1 @@ -865,7 +865,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`h` = `test`.`t1`.`h` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0); pk 1 @@ -875,7 +875,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`i` = `test`.`t1`.`i` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0); pk 1 @@ -885,7 +885,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`j` = `test`.`t1`.`j` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0); pk 1 @@ -895,7 +895,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`k` = `test`.`t1`.`k` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0); pk 1 @@ -976,7 +976,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 18 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t1 ALL varchar_key NULL NULL NULL 15 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`varchar_nokey` = `test`.`t1`.`varchar_key`) and (`test`.`t2`.`varchar_nokey` = `test`.`t1`.`varchar_key`) and ((`test`.`t1`.`varchar_key` < 'n') xor `test`.`t1`.`pk`)) +Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`varchar_nokey` = `test`.`t1`.`varchar_key` and `test`.`t2`.`varchar_nokey` = `test`.`t1`.`varchar_key` and (`test`.`t1`.`varchar_key` < 'n' xor `test`.`t1`.`pk`) SELECT varchar_nokey FROM t2 WHERE ( `varchar_nokey` , `varchar_nokey` ) IN ( @@ -1996,7 +1996,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t4`.`f2` = `test`.`t2`.`f3`) and (`test`.`t3`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f2` = `test`.`t2`.`f2`)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f2` = `test`.`t2`.`f3` and `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 @@ -2973,7 +2973,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where; End temporary Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1` +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on(`test`.`t1`.`c1` = `test`.`t3`.`c3`)) where `test`.`t1`.`pk` = `test`.`t1`.`pk` order by 'x',`test`.`t1`.`c1` DROP TABLE t1,t2,t3; # # MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 98a8907f741..8f37c09efcf 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -456,7 +456,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where `test`.`t2`.`a` = `test`.`t0`.`a` and `test`.`t1`.`a` = `test`.`t0`.`a` and `test`.`t1`.`b` = `test`.`t2`.`b` update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; select * from t0 where t0.a in diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index 1b8c1fc1158..021646a7599 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -468,7 +468,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2); Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where `test`.`t2`.`a` = `test`.`t0`.`a` and `test`.`t1`.`a` = `test`.`t0`.`a` and `test`.`t1`.`b` = `test`.`t2`.`b` update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; # Not anymore: diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index ac38e57d60a..46da52fe0eb 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -458,7 +458,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where `test`.`t2`.`a` = `test`.`t0`.`a` and `test`.`t1`.`a` = `test`.`t0`.`a` and `test`.`t1`.`b` = `test`.`t2`.`b` update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; select * from t0 where t0.a in @@ -1473,7 +1473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref idx idx 2 test.t4.a4 1 100.00 Using index; End temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on((`test`.`t2`.`a2` = `test`.`t4`.`a4`)) where ((`test`.`t4`.`b4` = `test`.`t4`.`a4`) and (`test`.`t1`.`b1` = `test`.`t4`.`a4`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`a2` = `test`.`t4`.`a4`) where `test`.`t4`.`b4` = `test`.`t4`.`a4` and `test`.`t1`.`b1` = `test`.`t4`.`a4` SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); a1 b1 a2 b2 @@ -1492,7 +1492,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t1`.`b1` = `test`.`t4`.`a4`) and (`test`.`t2`.`a2` = `test`.`t4`.`a4`))) where ((`test`.`t4`.`b4` = `test`.`t4`.`a4`) and (`test`.`t1`.`b1` = `test`.`t4`.`a4`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t1`.`b1` = `test`.`t4`.`a4` and `test`.`t2`.`a2` = `test`.`t4`.`a4`) where `test`.`t4`.`b4` = `test`.`t4`.`a4` and `test`.`t1`.`b1` = `test`.`t4`.`a4` SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); a1 b1 a2 b2 @@ -1527,7 +1527,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 10 100.00 Using where; End temporary; Using join buffer (flat, BNL join) 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) or (`test`.`t1`.`c1` > 'z'))) where ((`test`.`t4`.`c4` = `test`.`t1`.`c1`) and (`test`.`t3`.`c3` = `test`.`t1`.`c1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`c2` = `test`.`t1`.`c1` or `test`.`t1`.`c1` > 'z') where `test`.`t4`.`c4` = `test`.`t1`.`c1` and `test`.`t3`.`c3` = `test`.`t1`.`c1` SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); a1 c1 c2 @@ -1545,7 +1545,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t3 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) or (`test`.`t1`.`c1` > 'z'))) where (`test`.`t3`.`c3` = `test`.`t4`.`c4`) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`c2` = `test`.`t1`.`c1` or `test`.`t1`.`c1` > 'z') where `test`.`t3`.`c3` = `test`.`t4`.`c4` SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); a1 c1 c2 @@ -1575,7 +1575,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 100.00 Using where; Using join buffer (flat, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <`test`.`t1`.`i1`>((`test`.`t1`.`i1`,(select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and ((`test`.`t1`.`i1`) = `test`.`t3`.`i3`))))) +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <`test`.`t1`.`i1`>((`test`.`t1`.`i1`,(select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and (`test`.`t1`.`i1`) = `test`.`t3`.`i3`))) SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); i1 7 @@ -1588,7 +1588,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where 2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`)) +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); i1 7 @@ -1601,7 +1601,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where 2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t3`.`i3` > 0)) +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0 SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); i1 diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 2886118db30..09d88c9996f 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -87,7 +87,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t12`.`pk` = `test`.`t10`.`a`) and (`test`.`t10`.`pk` = `test`.`t1`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where `test`.`t12`.`pk` = `test`.`t10`.`a` and `test`.`t10`.`pk` = `test`.`t1`.`a` subqueries within outer joins go into ON expr. explAin extended select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10)); @@ -97,7 +97,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (incrementAl, BNL join) 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(((`test`.`A`.`A` = `test`.`t1`.`A`) And (`test`.`B`.`A`,`test`.`B`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`B`.`A` in on distinct_key where ((`test`.`B`.`A` = ``.`pk`))))))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And (`test`.`B`.`A`,`test`.`B`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`B`.`A` in on distinct_key where `test`.`B`.`A` = ``.`pk`)))) where 1 t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)" explAin extended select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10)); @@ -106,7 +106,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (flAt, BNL join) 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(((`test`.`t2`.`A` = `test`.`t1`.`A`) And (`test`.`t1`.`A`,`test`.`t1`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`t1`.`A` in on distinct_key where ((`test`.`t1`.`A` = ``.`pk`))))))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And (`test`.`t1`.`A`,`test`.`t1`.`A` in ( (select `test`.`t10`.`pk` from `test`.`t10` ), (`test`.`t1`.`A` in on distinct_key where `test`.`t1`.`A` = ``.`pk`)))) where 1 set join_buffer_size=8*1024; we shouldn't flatten if we're going to get a join of > MAX_TABLES. explain select * from @@ -220,7 +220,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 4 100.00 Using where; Using index 1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t10`.`pk`) and (`test`.`t10`.`pk` < 3)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -516,7 +516,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t1`.`pk` = `test`.`t0`.`pk`) and (`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`)) +Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where `test`.`t1`.`pk` = `test`.`t0`.`pk` and `test`.`t2`.`vkey` = `test`.`t1`.`vnokey` SELECT vkey FROM t0 WHERE pk IN (SELECT t1.pk FROM t0 t1 JOIN t0 t2 ON t2.vkey = t1.vnokey); vkey @@ -780,11 +780,11 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) show warnings; Level Code Message Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -820,7 +820,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 11 func,func 1 100.00 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0); pk 2 @@ -829,7 +829,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`c` = `test`.`t1`.`c` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0); pk 1 @@ -839,7 +839,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`d` = `test`.`t1`.`d` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0); pk 2 @@ -848,7 +848,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`e` = `test`.`t1`.`e` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0); pk 1 @@ -858,7 +858,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`f` = `test`.`t1`.`f` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0); pk 1 @@ -868,7 +868,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`g` = `test`.`t1`.`g` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0); pk 1 @@ -878,7 +878,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`h` = `test`.`t1`.`h` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0); pk 1 @@ -888,7 +888,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`i` = `test`.`t1`.`i` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0); pk 1 @@ -898,7 +898,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`j` = `test`.`t1`.`j` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0); pk 1 @@ -908,7 +908,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`k` = `test`.`t1`.`k` and `test`.`t2`.`pk` > 0 SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0); pk 1 @@ -989,7 +989,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 18 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t1 ALL varchar_key NULL NULL NULL 15 100.00 Using where Warnings: -Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`varchar_nokey` = `test`.`t1`.`varchar_key`) and (`test`.`t2`.`varchar_nokey` = `test`.`t1`.`varchar_key`) and ((`test`.`t1`.`varchar_key` < 'n') xor `test`.`t1`.`pk`)) +Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`varchar_nokey` = `test`.`t1`.`varchar_key` and `test`.`t2`.`varchar_nokey` = `test`.`t1`.`varchar_key` and (`test`.`t1`.`varchar_key` < 'n' xor `test`.`t1`.`pk`) SELECT varchar_nokey FROM t2 WHERE ( `varchar_nokey` , `varchar_nokey` ) IN ( @@ -2010,7 +2010,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (incremental, BNL join) 2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f2` = `test`.`t2`.`f2`)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 @@ -2987,7 +2987,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where; End temporary; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1` +Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on(`test`.`t1`.`c1` = `test`.`t3`.`c3`)) where `test`.`t1`.`pk` = `test`.`t1`.`pk` order by 'x',`test`.`t1`.`c1` DROP TABLE t1,t2,t3; # # MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index 9aa223b83f2..fa74cc36612 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 8 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b1` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b1` > '0' select * from t1 where a1 in (select b1 from t2 where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -62,7 +62,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 8 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b1` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b1` > '0' select * from t1 where a1 in (select b1 from t2 where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -74,7 +74,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b1` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b1` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b1 > '0' group by b1, b2); a1 a2 1 - 01 2 - 01 @@ -86,7 +86,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using temporary Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where (`test`.`t2`.`b1` > '0') group by `test`.`t2`.`b1`) join `test`.`t1` where ((``.`b1` = `test`.`t1`.`a1`) and (``.`min(b2)` = `test`.`t1`.`a2`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`b1` > '0' group by `test`.`t2`.`b1`) join `test`.`t1` where ``.`b1` = `test`.`t1`.`a1` and ``.`min(b2)` = `test`.`t1`.`a2` select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -97,7 +97,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2i index it2i1,it2i3 it2i1 # NULL 5 50.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00 Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0')) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` > '0' select * from t1i where a1 in (select b1 from t2i where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -109,7 +109,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key # 8 # 1 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # 9 # 5 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where (``.`max(b1)` = `test`.`t1i`.`a1`) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select max(`test`.`t2i`.`b1`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where ``.`max(b1)` = `test`.`t1i`.`a1` select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -120,7 +120,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 50.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00 Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0')) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -132,7 +132,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key # # # 1 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((``.`b1` = `test`.`t1i`.`a1`) and (``.`max(b2)` = `test`.`t1i`.`a2`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where ``.`b1` = `test`.`t1i`.`a1` and ``.`max(b2)` = `test`.`t1i`.`a2` select * from t1i where (a1, a2) in (select b1, max(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -144,7 +144,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key # # # 1 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((``.`b1` = `test`.`t1i`.`a1`) and (``.`min(b2)` = `test`.`t1i`.`a2`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where ``.`b1` = `test`.`t1i`.`a1` and ``.`min(b2)` = `test`.`t1i`.`a2` select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -156,7 +156,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2i range NULL it2i3 9 NULL 3 100.00 Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1`) join `test`.`t1` where ((``.`b1` = `test`.`t1`.`a1`) and (``.`max(b2)` = `test`.`t1`.`a2`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1`) join `test`.`t1` where ``.`b1` = `test`.`t1`.`a1` and ``.`max(b2)` = `test`.`t1`.`a2` select * from t1 where (a1, a2) in (select b1, max(b2) from t2i group by b1); a1 a2 1 - 01 2 - 01 @@ -188,7 +188,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2i range it2i1,it2i3 it2i3 18 NULL 3 100.00 Using where; Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1` where ((``.`b1` = `test`.`t1`.`a1`) and (``.`min(b2)` = `test`.`t1`.`a2`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1` where ``.`b1` = `test`.`t1`.`a1` and ``.`min(b2)` = `test`.`t1`.`a2` select * from t1 where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -236,7 +236,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2`) join `test`.`t1` where ((``.`b1` = `test`.`t1`.`a1`) and (``.`b2` = `test`.`t1`.`a2`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2`) join `test`.`t1` where ``.`b1` = `test`.`t1`.`a1` and ``.`b2` = `test`.`t1`.`a2` select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -248,7 +248,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 16 test.t1i.a1,test.t1i.a2 1 100.00 2 MATERIALIZED t2i index NULL it2i3 18 NULL 5 100.00 Using index Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2`) join `test`.`t1i` where ((``.`b1` = `test`.`t1i`.`a1`) and (``.`b2` = `test`.`t1i`.`a2`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2`) join `test`.`t1i` where ``.`b1` = `test`.`t1i`.`a1` and ``.`b2` = `test`.`t1i`.`a2` select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -305,7 +305,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 80.00 Using where; Using index; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2`.`b1` > '0') and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and `test`.`t2`.`b1` > '0' and `test`.`t3`.`c2` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and (a1, a2) in (select c1, c2 from t3 @@ -324,7 +324,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # 1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 2 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0')) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0' select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and (a1, a2) in (select c1, c2 from t3i @@ -349,7 +349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`)))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t3`.`c2` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -375,7 +375,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b1` = `test`.`t3c`.`c1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b2` = `test`.`t3c`.`c2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and ((`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) and (`test`.`t3c`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t3c`.`c1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t3c`.`c2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t3c`.`c2` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 t3a where c1 = a1) or @@ -413,7 +413,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 7 UNION t2i ref it2i1,it2i2,it2i3 # # # 2 100.00 # NULL UNION RESULT ALL NULL # # # NULL NULL # Warnings: -Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`)))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`))))))) and (`test`.`t3`.`c2` > '0'))) union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0'))) +Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t3`.`c2` > '0') union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0') (select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -443,7 +443,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and ((`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t1`.`a1`) = `test`.`t1`.`a1` and (`test`.`t1`.`a2`) = `test`.`t1`.`a2` union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and `test`.`t3`.`c2` > '0' select * from t1 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (a1, a2) in (select c1, c2 from t3 @@ -467,7 +467,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) join `test`.`t3` where ((`test`.`t3`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and ((`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and ((`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) join `test`.`t3` where `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t1`.`a1`) = `test`.`t1`.`a1` and (`test`.`t1`.`a2`) = `test`.`t1`.`a2` union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t1`.`a1`) = `test`.`t2`.`b1` and (`test`.`t1`.`a2`) = `test`.`t2`.`b2`))) and `test`.`t3`.`c2` > '0' select * from t1, t3 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (c1, c2) in (select c1, c2 from t3 @@ -489,7 +489,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <`test`.`t3`.`c1`>((`test`.`t3`.`c1`,(select `test`.`t1`.`a1` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and ((`test`.`t3`.`c1`) = `test`.`t1`.`a1`)) union select `test`.`t2`.`b1` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and ((`test`.`t3`.`c1`) = `test`.`t2`.`b1`))))) +Note 1003 select `test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t3` where <`test`.`t3`.`c1`>((`test`.`t3`.`c1`,(select `test`.`t1`.`a1` from `test`.`t1` where `test`.`t1`.`a1` > '0' and (`test`.`t3`.`c1`) = `test`.`t1`.`a1` union select `test`.`t2`.`b1` from `test`.`t2` where `test`.`t2`.`b1` < '9' and (`test`.`t3`.`c1`) = `test`.`t2`.`b1`))) select * from t3 where c1 in (select a1 from t1 where a1 > '0' UNION select b1 from t2 where b1 < '9'); c1 c2 @@ -513,14 +513,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a2' of SELECT #6 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b1` = `test`.`t1`.`a1`) and (`test`.`t3c`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b2` = `test`.`t1`.`a2`) and (`test`.`t3c`.`c2` = `test`.`t1`.`a2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and ((`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), (`test`.`t2`.`b2` in on distinct_key where ((`test`.`t2`.`b2` = ``.`c2`)))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) explain extended select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((((`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and (((`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and ('1 - 01') and ('2 - 01'))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or '1 - 01' is null) and ((`test`.`t1`.`a2`) = '2 - 01' or '2 - 01' is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); a1 a2 1 - 01 2 - 01 @@ -530,7 +530,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((((`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and (((`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and ('1 - 01') and ('2 - 01'))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or '1 - 01' is null) and ((`test`.`t1`.`a2`) = '2 - 01' or '2 - 01' is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual); a1 a2 1 - 01 2 - 01 @@ -562,7 +562,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort 2 DEPENDENT SUBQUERY columns unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where; Full scan on NULL key Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` group by <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(((`test`.`t1`.`a1`) in columns on PRIMARY where trigcond(((`test`.`t1`.`a1`) = `test`.`columns`.`col`)))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` group by <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(((`test`.`t1`.`a1`) in columns on PRIMARY where trigcond((`test`.`t1`.`a1`) = `test`.`columns`.`col`))))) select * from t1 group by (a1 in (select col from columns)); a1 a2 1 - 00 2 - 00 @@ -623,7 +623,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where ((`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t1_16`.`a1` > '0')) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t1_16`.`a1` > '0' select left(a1,7), left(a2,7) from t1_16 where a1 in (select b1 from t2_16 where b1 > '0'); @@ -637,7 +637,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where ((`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t1_16`.`a1` > '0')) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t1_16`.`a1` > '0' select left(a1,7), left(a2,7) from t1_16 where (a1,a2) in (select b1, b2 from t2_16 where b1 > '0'); @@ -652,7 +652,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 19 func 1 100.00 Using where 2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where ((`test`.`t2_16`.`b1` > '0') and (`test`.`t1_16`.`a1` = substr(`test`.`t2_16`.`b1`,1,16))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` > '0' and `test`.`t1_16`.`a1` = substr(`test`.`t2_16`.`b1`,1,16) select left(a1,7), left(a2,7) from t1_16 where a1 in (select substring(b1,1,16) from t2_16 where b1 > '0'); @@ -666,7 +666,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having ((`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ',')))))) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having (`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -682,7 +682,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_16.a1 1 100.00 Using where 2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2`) join `test`.`t1_16` where (`test`.`t1_16`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2`) join `test`.`t1_16` where `test`.`t1_16`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -704,7 +704,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where ((`test`.`t2`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6)) and (`test`.`t3`.`c2` > '0') and (concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where `test`.`t2`.`b1` = `test`.`t3`.`c1` and `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6) and `test`.`t3`.`c2` > '0' and concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8) drop table t1_16, t2_16, t3_16; set @blob_len = 512; set @suffix_len = @blob_len - @prefix_len; @@ -738,7 +738,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where ((`test`.`t2_512`.`b1` = `test`.`t1_512`.`a1`) and (`test`.`t1_512`.`a1` > '0')) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` = `test`.`t1_512`.`a1` and `test`.`t1_512`.`a1` > '0' select left(a1,7), left(a2,7) from t1_512 where a1 in (select b1 from t2_512 where b1 > '0'); @@ -752,7 +752,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where ((`test`.`t2_512`.`b1` = `test`.`t1_512`.`a1`) and (`test`.`t2_512`.`b2` = `test`.`t1_512`.`a2`) and (`test`.`t1_512`.`a1` > '0')) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` = `test`.`t1_512`.`a1` and `test`.`t2_512`.`b2` = `test`.`t1_512`.`a2` and `test`.`t1_512`.`a1` > '0' select left(a1,7), left(a2,7) from t1_512 where (a1,a2) in (select b1, b2 from t2_512 where b1 > '0'); @@ -767,7 +767,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 516 func 1 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where ((`test`.`t2_512`.`b1` > '0') and (`test`.`t1_512`.`a1` = substr(`test`.`t2_512`.`b1`,1,512))) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` > '0' and `test`.`t1_512`.`a1` = substr(`test`.`t2_512`.`b1`,1,512) select left(a1,7), left(a2,7) from t1_512 where a1 in (select substring(b1,1,512) from t2_512 where b1 > '0'); @@ -782,7 +782,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_512.a1 1 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where (`test`.`t1_512`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where `test`.`t1_512`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -800,7 +800,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_512.a1 1 100.00 Using where 2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where (`test`.`t1_512`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where `test`.`t1_512`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -842,7 +842,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1`) and (`test`.`t1_1024`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1` and `test`.`t1_1024`.`a1` > '0' select left(a1,7), left(a2,7) from t1_1024 where a1 in (select b1 from t2_1024 where b1 > '0'); @@ -856,7 +856,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1`) and (`test`.`t2_1024`.`b2` = `test`.`t1_1024`.`a2`) and (`test`.`t1_1024`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1` and `test`.`t2_1024`.`b2` = `test`.`t1_1024`.`a2` and `test`.`t1_1024`.`a1` > '0' select left(a1,7), left(a2,7) from t1_1024 where (a1,a2) in (select b1, b2 from t2_1024 where b1 > '0'); @@ -870,7 +870,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b1` > '0') and (`test`.`t1_1024`.`a1` = substr(`test`.`t2_1024`.`b1`,1,1024))) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` > '0' and `test`.`t1_1024`.`a1` = substr(`test`.`t2_1024`.`b1`,1,1024) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0'); @@ -885,7 +885,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1024.a1 1 100.00 Using where 2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where (`test`.`t1_1024`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -903,7 +903,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1024.a1 1 100.00 Using where 2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where (`test`.`t1_1024`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -945,7 +945,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1`) and (`test`.`t1_1025`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1` and `test`.`t1_1025`.`a1` > '0' select left(a1,7), left(a2,7) from t1_1025 where a1 in (select b1 from t2_1025 where b1 > '0'); @@ -959,7 +959,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1`) and (`test`.`t2_1025`.`b2` = `test`.`t1_1025`.`a2`) and (`test`.`t1_1025`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1` and `test`.`t2_1025`.`b2` = `test`.`t1_1025`.`a2` and `test`.`t1_1025`.`a1` > '0' select left(a1,7), left(a2,7) from t1_1025 where (a1,a2) in (select b1, b2 from t2_1025 where b1 > '0'); @@ -973,7 +973,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b1` > '0') and (`test`.`t1_1025`.`a1` = substr(`test`.`t2_1025`.`b1`,1,1025))) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` > '0' and `test`.`t1_1025`.`a1` = substr(`test`.`t2_1025`.`b1`,1,1025) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0'); @@ -988,7 +988,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1025.a1 1 100.00 Using where 2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where (`test`.`t1_1025`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -1006,7 +1006,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1025.a1 1 100.00 Using where 2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where (`test`.`t1_1025`.`a1` = ``.`group_concat(b1)`) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)` select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -1055,7 +1055,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1bb ALL NULL NULL NULL NULL 3 100.00 1 PRIMARY t2bb ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` semi join (`test`.`t2bb`) where ((`test`.`t2bb`.`b1` = `test`.`t1bb`.`a1`) and (`test`.`t2bb`.`b2` = `test`.`t1bb`.`a2`)) +Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` semi join (`test`.`t2bb`) where `test`.`t2bb`.`b1` = `test`.`t1bb`.`a1` and `test`.`t2bb`.`b2` = `test`.`t1bb`.`a2` select bin(a1), a2 from t1bb where (a1, a2) in (select b1, b2 from t2bb); @@ -1104,7 +1104,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` >= 20)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and `test`.`t2`.`d` >= 20 select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1119,7 +1119,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`d` >= 20)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`d` >= 20 select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1134,7 +1134,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`d` >= 20)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`d` >= 20 select a from t1 where a in (select c from t2 where d >= 20); a 2 @@ -1147,7 +1147,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 group by a having a in (select c from t2 where d >= 20); a 2 @@ -1159,7 +1159,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL it1a 4 NULL 7 100.00 Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where (`test`.`t2`.`d` >= 20) ), (`test`.`t1`.`a` in on distinct_key where ((`test`.`t1`.`a` = ``.`c`)))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`c`)))) select a from t1 group by a having a in (select c from t2 where d >= 20); a 2 @@ -1174,7 +1174,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 Note 1981 Aggregate function 'max()' of SELECT #3 belongs to SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where ((<`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where (max(`test`.`t1`.`b`) = `test`.`t3`.`e`) having ((`test`.`t2`.`d`) >= (`test`.`t3`.`e`)))))) and ((`test`.`t1`.`a`) = `test`.`t2`.`c`))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <`test`.`t1`.`a`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t1`.`a`,(select `test`.`t2`.`c` from `test`.`t2` where (<`test`.`t2`.`d`,`test`.`t1`.`b`,max(`test`.`t1`.`b`),max(`test`.`t1`.`b`)>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where max(`test`.`t1`.`b`) = `test`.`t3`.`e` having (`test`.`t2`.`d`) >= (`test`.`t3`.`e`))))) and (`test`.`t1`.`a`) = `test`.`t2`.`c`))) select a from t1 group by a having a in (select c from t2 where d >= some(select e from t3 where max(b)=e)); a @@ -1189,7 +1189,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t1`.`a` = `test`.`t2`.`c`) and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`e`) and ((`test`.`t2`.`d`) >= `test`.`t3`.`e`))))))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -1963,7 +1963,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = ``.`MAX(c)`) and ((isnull(``.`MAX(c)`)) or (``.`MAX(c)` = 7))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where `test`.`t1`.`b` = 7 and `test`.`t1`.`a` = ``.`MAX(c)` and ((``.`MAX(c)` is null) or ``.`MAX(c)` = 7) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b @@ -2208,7 +2208,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index 2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where (`test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME`) order by `test`.`t1`.`db` desc +Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where `test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME` order by `test`.`t1`.`db` desc drop table t1; drop database mysqltest1; drop database mysqltest2; diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index 3e0cc480aec..a7b0842d14f 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -62,7 +62,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 4 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t0` left join (`test`.`t1`) on((`test`.`t1`.`a` = `test`.`t0`.`a`)) where 1 +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t0` left join (`test`.`t1`) on(`test`.`t1`.`a` = `test`.`t0`.`a`) where 1 # Elimination with aggregate functions explain select count(*) from t1 left join t2 on t2.a=t1.a; id select_type table type possible_keys key key_len ref rows Extra @@ -126,7 +126,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY f range PRIMARY PRIMARY 4 NULL 4 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.a2.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` where (`f`.`id` in (1,2,3,4)) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` where `f`.`id` in (1,2,3,4) This should use facts and a1 tables: explain extended select id from v1 where attr1 between 12 and 14; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -134,7 +134,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a1.id 1 100.00 Using index Warnings: Note 1276 Field or reference 'test.a2.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where ((`f`.`id` = `a1`.`id`) and (`a1`.`attr1` between 12 and 14)) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where `f`.`id` = `a1`.`id` and `a1`.`attr1` between 12 and 14 This should use facts, a2 and its subquery: explain extended select id from v1 where attr2 between 12 and 14; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -143,7 +143,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ref PRIMARY PRIMARY 4 test.a2.id 2 100.00 Using index Warnings: Note 1276 Field or reference 'test.a2.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t2` `a2` where ((`f`.`id` = `a2`.`id`) and (`a2`.`attr2` between 12 and 14) and (`a2`.`fromdate` = (select max(`test`.`t2`.`fromdate`) from `test`.`t2` where (`test`.`t2`.`id` = `a2`.`id`)))) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t2` `a2` where `f`.`id` = `a2`.`id` and `a2`.`attr2` between 12 and 14 and `a2`.`fromdate` = (select max(`test`.`t2`.`fromdate`) from `test`.`t2` where `test`.`t2`.`id` = `a2`.`id`) This should use one table: explain select id from v2 where id=2; id select_type table type possible_keys key key_len ref rows Extra @@ -154,7 +154,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY f range PRIMARY PRIMARY 4 NULL 4 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.f.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` where (`f`.`id` in (1,2,3,4)) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` where `f`.`id` in (1,2,3,4) This should use facts and a1 tables: explain extended select id from v2 where attr1 between 12 and 14; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -162,7 +162,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a1.id 1 100.00 Using index Warnings: Note 1276 Field or reference 'test.f.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where ((`f`.`id` = `a1`.`id`) and (`a1`.`attr1` between 12 and 14)) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where `f`.`id` = `a1`.`id` and `a1`.`attr1` between 12 and 14 This should use facts, a2 and its subquery: explain extended select id from v2 where attr2 between 12 and 14; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -171,7 +171,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ref PRIMARY PRIMARY 4 test.f.id 2 100.00 Using index Warnings: Note 1276 Field or reference 'test.f.id' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t2` `a2` where ((`f`.`id` = `a2`.`id`) and (`a2`.`attr2` between 12 and 14) and (`a2`.`fromdate` = (select max(`test`.`t2`.`fromdate`) from `test`.`t2` where (`test`.`t2`.`id` = `f`.`id`)))) +Note 1003 select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t2` `a2` where `f`.`id` = `a2`.`id` and `a2`.`attr2` between 12 and 14 and `a2`.`fromdate` = (select max(`test`.`t2`.`fromdate`) from `test`.`t2` where `test`.`t2`.`id` = `f`.`id`) drop view v1, v2; drop table t0, t1, t2; create table t1 (a int); @@ -654,7 +654,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL b 5 NULL 2 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t2` where <`test`.`t2`.`b`>((`test`.`t2`.`b`,(select sum(1) from dual where 1 having ((`test`.`t2`.`b`) = (sum(1)))))) +Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t2` where <`test`.`t2`.`b`>((`test`.`t2`.`b`,(select sum(1) from dual where 1 having (`test`.`t2`.`b`) = (sum(1))))) DROP TABLE t1,t2; # # MDEV-4840: Wrong result (missing rows) on LEFT JOIN with InnoDB tables diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index d2587d7199e..b28cf54f53a 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -550,12 +550,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' DROP TABLE t1; # # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x' @@ -587,7 +587,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect date value: '2001-01-01x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and ((hex(DATE'2001-01-01')) <> concat('xx',rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' and (hex(DATE'2001-01-01')) <> concat('xx',rand()) DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02'); @@ -606,14 +606,14 @@ SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' 2001-01-01'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and ((length(DATE'2001-01-01')) = (11 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' and (length(DATE'2001-01-01')) = 11 + rand() EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Incorrect datetime value: ' garbage ' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and ((length(DATE'0000-00-00')) = (11 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'0000-00-00' and (length(DATE'0000-00-00')) = 11 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-01'); @@ -632,7 +632,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=8+RAND() AND a='20010101'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2001-01-01') and ((length(DATE'2001-01-01')) = (8 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' and (length(DATE'2001-01-01')) = 8 + rand() DROP TABLE t1; # # MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00' @@ -655,13 +655,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-30' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and ((length(DATE'2015-08-30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-30' and (length(DATE'2015-08-30')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31'); @@ -680,13 +680,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIME'24:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-31') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-31' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'24:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-31') and ((length(DATE'2015-08-31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-31' and (length(DATE'2015-08-31')) = 30 + rand() DROP TABLE t1; # In this example '00:00:00' is not recognized as TIME'00:00:00' # and is treated as DATE'0000-00-00'. @@ -706,13 +706,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'0000-00-00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'0000-00-00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'0000-00-00') and ((length(DATE'0000-00-00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'0000-00-00' and (length(DATE'0000-00-00')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31'); @@ -731,13 +731,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00') and ((length(DATE'2015-08-30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00' and (length(DATE'2015-08-30')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31'); @@ -754,13 +754,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a=TIMESTAMP'2015-08-30 00:00:00.1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2015-08-30 00:00:00.1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1') and ((length(DATE'2015-08-30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2015-08-30 00:00:00.1' and (length(DATE'2015-08-30')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31'); @@ -779,13 +779,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=10 AND a='2015-08-30 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2015-08-30') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-30' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='2015-08-30 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = DATE'2015-08-30') and ((length(DATE'2015-08-30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2015-08-30' and (length(DATE'2015-08-30')) = 30 + rand() DROP TABLE t1; SET timestamp=DEFAULT; # @@ -797,7 +797,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE'2001-01-01' AND COALESC id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2001-01-01') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2001-01-01' DROP TABLE t1; # # MDEV-8658 DATE(zerofill_column) and DATE(COALESCE(zerofill_column)) return different results diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 41696aa2d7d..8588ad185ed 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -544,7 +544,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where ((`test`.`x1`.`id` = `test`.`t1`.`id`) and (`test`.`t1`.`cur_date` = 0)) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date @@ -556,7 +556,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where ((`test`.`x1`.`id` = `test`.`t2`.`id`) and (`test`.`t2`.`cur_date` = 0)) +Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date @@ -747,7 +747,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref AtTime AtTime 6 const 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = TIMESTAMP'2010-02-22 18:40:07') +Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where `test`.`t1`.`AtTime` = TIMESTAMP'2010-02-22 18:40:07' DROP TABLE t1; SET NAMES latin1; # @@ -977,14 +977,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) <> 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATETIME);; INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01'); @@ -1000,20 +1000,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 19 + rand() EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Incorrect datetime value: ' garbage ' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and ((length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00' and (length(TIMESTAMP'0000-00-00 00:00:00')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATETIME);; INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01'); @@ -1032,13 +1032,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATETIME(6));; INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000'); @@ -1057,13 +1057,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and ((length(TIMESTAMP'2001-01-01 00:00:00.000000')) = (40 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and (length(TIMESTAMP'2001-01-01 00:00:00.000000')) = 40 + rand() DROP TABLE t1; SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30'); CREATE TABLE t1 (a DATETIME);; @@ -1083,13 +1083,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 40 + rand() DROP TABLE t1; # # MDEV-8795 Equal expression propagation does not work for temporal literals @@ -1100,7 +1100,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIMESTAMP'2001-01-01 00:00:0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIMESTAMP'2001-01-01 00:00:00' DROP TABLE t1; # # MDEV-8875 Wrong metadata for MAX(CAST(time_column AS DATETIME)) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 7d0e5a39d91..db03e61fcdd 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -2104,7 +2104,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a ') and (hex(`test`.`t1`.`a`) = '61')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a ' and hex(`test`.`t1`.`a`) = '61' DROP TABLE t1; CREATE TABLE t1 (a ENUM('a','a ') CHARACTER SET BINARY); INSERT INTO t1 VALUES ('a'),('a '); @@ -2124,7 +2124,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index eab55b2272d..58dba89745d 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -556,13 +556,13 @@ SELECT * FROM t1 WHERE LENGTH(a)!=6 AND a=100e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 100e0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 100e0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=100e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 100e0) and ((length(100)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 100e0 and (length(100)) <> rand() DROP TABLE t1; CREATE TABLE t1 (a DOUBLE(10,1)); INSERT INTO t1 VALUES (1.1),(1.2),(1.3); @@ -582,7 +582,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and ((length(1.1)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10e0 and (length(1.1)) <> rand() DROP TABLE t1; CREATE TABLE t1 (a DOUBLE(10,2)); INSERT INTO t1 VALUES (1.1),(1.2),(1.3); @@ -602,7 +602,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and ((length(1.10)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10e0 and (length(1.10)) <> rand() DROP TABLE t1; CREATE TABLE t1 (a DOUBLE(10,3)); INSERT INTO t1 VALUES (1.1),(1.2),(1.3); @@ -622,7 +622,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=RAND() AND a=1.10e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10e0) and ((length(1.100)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10e0 and (length(1.100)) <> rand() DROP TABLE t1; # # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010 @@ -633,7 +633,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010e0 AND a>=2010e0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010e0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010e0 DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/type_int.result b/mysql-test/r/type_int.result index 530a4134f4a..39e2e91ecc7 100644 --- a/mysql-test/r/type_int.result +++ b/mysql-test/r/type_int.result @@ -10,7 +10,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 DROP TABLE t1; # # MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field @@ -31,7 +31,7 @@ SELECT * FROM t1 WHERE a=128 AND hex(a)='80'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 128) and (hex(`test`.`t1`.`a`) = '80')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 128 and hex(`test`.`t1`.`a`) = '80' DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 1c1bb43b915..bc45d6d2789 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1387,7 +1387,7 @@ Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values( 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); -ERROR 22003: DECIMAL value is out of range in '(99999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999)' +ERROR 22003: DECIMAL value is out of range in '99999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999' insert into t1 values(1e100); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -2086,7 +2086,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and ((length(1.1)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10 and (length(1.1)) <> rand() DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(10,2)); INSERT INTO t1 VALUES (1.1),(1.2),(1.3); @@ -2106,7 +2106,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and ((length(1.10)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10 and (length(1.10)) <> rand() DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(10,3)); INSERT INTO t1 VALUES (1.1),(1.2),(1.3); @@ -2126,7 +2126,7 @@ SELECT * FROM t1 WHERE LENGTH(a)!=rand() AND a=1.10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1.10) and ((length(1.100)) <> rand())) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1.10 and (length(1.100)) <> rand() DROP TABLE t1; # # MDEV-8741 Equal field propagation leaves some remainders after simplifying WHERE zerofill_column=2010 AND zerofill_column>=2010 @@ -2137,7 +2137,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010.0 AND a>=2010.0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010.0) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010.0 DROP TABLE t1; # # MDEV-8635 Redundant warnings on WHERE decimal_column='ax' diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 586c6345e00..9d3a6e3bcb4 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -285,7 +285,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a ') and (hex(`test`.`t1`.`a`) = '61')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a ' and hex(`test`.`t1`.`a`) = '61' DROP TABLE t1; CREATE TABLE t1 (a SET('a','a ') CHARACTER SET BINARY); INSERT INTO t1 VALUES ('a'),('a '); @@ -305,7 +305,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE HEX(a)='61' AND a='a '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index e4525f34ab4..ce1cb424a6c 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -417,14 +417,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect time value: '00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00x'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect time value: '00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and ((length(TIME'00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and (length(TIME'00:00:00')) = 30 + rand() DROP TABLE t1; # Trailing fractional digits in string literals CREATE TABLE t1 (a TIME); @@ -441,13 +441,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and ((length(TIME'00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and (length(TIME'00:00:00')) = 30 + rand() DROP TABLE t1; # Trailing fractional digits in temporal literals CREATE TABLE t1 (a TIME); @@ -464,13 +464,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00.000000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.000000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.000000') and ((length(TIME'00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.000000' and (length(TIME'00:00:00')) = 30 + rand() DROP TABLE t1; # Trailing fractional digits in temporal literals, same precision CREATE TABLE t1 (a TIME(6)); @@ -490,7 +490,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.000000') and ((length(TIME'00:00:00.000000')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.000000' and (length(TIME'00:00:00.000000')) = 30 + rand() DROP TABLE t1; # Leading spaces in string literals CREATE TABLE t1 (a TIME); @@ -507,13 +507,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=' 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and ((length(TIME'00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and (length(TIME'00:00:00')) = 30 + rand() DROP TABLE t1; # Numeric format in string literals CREATE TABLE t1 (a TIME); @@ -530,13 +530,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and ((length(TIME'00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and (length(TIME'00:00:00')) = 30 + rand() DROP TABLE t1; # # MDEV-8766 Wrong result for SELECT..WHERE LENGTH(time_column)=8 AND time_column=TIMESTAMP'2001-01-01 10:20:31' @@ -559,13 +559,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a bigger scale and fractional second truncation # Ok to propagate with precision truncation @@ -583,13 +583,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a bigger scale and no fractional second truncation # Ok to propagate @@ -609,13 +609,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a smaller scale # Ok to propagate @@ -638,7 +638,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and ((length(TIME'10:20:31.123000')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' and (length(TIME'10:20:31.123000')) = 30 + rand() DROP TABLE t1; # TIME literal with a bigger scale and fractional second truncation # Ok to propagate with precision truncation @@ -656,13 +656,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIME literal with a bigger scale and no fractional second truncation # Ok to propagate @@ -682,13 +682,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIME'10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.000') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.000' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIME literal with a smaller scale # Ok to propagate @@ -711,7 +711,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123') and ((length(TIME'10:20:31.123000')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123' and (length(TIME'10:20:31.123000')) = 30 + rand() DROP TABLE t1; # TIME-alike string literal with a bigger scale and fractional second truncation # Ok to propagate with precision truncation @@ -729,13 +729,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31.123000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIME-alike string literal with a bigger scale and no fractional second truncation # Ok to propagate @@ -755,13 +755,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=8 AND a='10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:31') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31') and ((length(TIME'10:20:31')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' and (length(TIME'10:20:31')) = 30 + rand() DROP TABLE t1; # TIME-alike string literal with a smaller scale # Ok to propagate @@ -784,7 +784,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a='10:20:31.123'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:31.123000') and ((length(TIME'10:20:31.123000')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' and (length(TIME'10:20:31.123000')) = 30 + rand() DROP TABLE t1; SET timestamp=DEFAULT; SET @@old_mode=zero_date_time_cast; @@ -815,13 +815,13 @@ SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:30') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:30') and ((length(TIME'10:20:30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and (length(TIME'10:20:30')) = 30 + rand() # Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30'; a @@ -834,13 +834,13 @@ SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = 8)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30' and length(`test`.`t1`.`a`) = 8 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=30+RAND(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30' and length(`test`.`t1`.`a`) = 30 + rand() # Old mode, TIMESTAMP-alike string literal, zero YYYYMMDD, Ok to propagate SELECT * FROM t1 WHERE a='0000-00-00 10:20:30'; a @@ -853,13 +853,13 @@ SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'10:20:30') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'10:20:30') and ((length(TIME'10:20:30')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and (length(TIME'10:20:30')) = 30 + rand() # Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; a @@ -872,13 +872,13 @@ SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = 8)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '0000-00-01 10:20:30' and length(`test`.`t1`.`a`) = 8 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=30+RAND(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '0000-00-01 10:20:30') and (length(`test`.`t1`.`a`) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '0000-00-01 10:20:30' and length(`test`.`t1`.`a`) = 30 + rand() DROP TABLE t1; SET @@old_mode=DEFAULT; # @@ -904,7 +904,7 @@ SELECT * FROM t1 WHERE a>=TIMESTAMP'2015-08-30 00:00:00' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' DROP TABLE t1; SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30'); CREATE TABLE t1 (a TIME); @@ -917,19 +917,19 @@ SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= TIMESTAMP'2015-08-30 00:00:00.1')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and timestamp('2015-08-08',TIME'00:00:00' + rand()) <= TIMESTAMP'2015-08-30 00:00:00.1' EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00.1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.100000') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= TIMESTAMP'2015-08-30 00:00:00.1')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.100000' and timestamp('2015-08-08',TIME'00:00:00' + rand()) <= TIMESTAMP'2015-08-30 00:00:00.1' DROP TABLE t1; SET timestamp=UNIX_TIMESTAMP('2015-08-30 10:20:30'); CREATE TABLE t1 (a TIME); @@ -942,19 +942,19 @@ SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= DATE'2015-08-30')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' and timestamp('2015-08-08',TIME'00:00:00' + rand()) <= DATE'2015-08-30' EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00.1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00.100000') and (timestamp('2015-08-08',(TIME'00:00:00' + rand())) <= DATE'2015-08-30')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.100000' and timestamp('2015-08-08',TIME'00:00:00' + rand()) <= DATE'2015-08-30' DROP TABLE t1; SET timestamp=DEFAULT; # @@ -966,7 +966,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:01' AND COALESCE( id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:01') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIME'00:00:01' DROP TABLE t1; # # MDEV-8793 Wrong result set for SELECT ... WHERE COALESCE(time_column)=TIME('00:00:00') AND COALESCE(time_column)=DATE('2015-09-11') @@ -989,7 +989,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 00:00:00 # TIME cast + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11'; a @@ -999,7 +999,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 00:00:00 # TIME literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11'); a @@ -1009,7 +1009,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09- id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIME'00:00:00' # TIME literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11'; a @@ -1019,7 +1019,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = TIME'00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIME'00:00:00' # TIME-alike string literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11'); a @@ -1029,7 +1029,7 @@ SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11') id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' and coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 # TIME-alike string literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11'; a @@ -1039,7 +1039,7 @@ SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' and coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' # TIME-alike integer literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11'); a @@ -1049,7 +1049,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 0 and coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 # TIME-alike integer literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11'; a @@ -1059,7 +1059,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 0 and coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' # DATE cast + TIME cast SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00'); a @@ -1069,7 +1069,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 # DATE cast + TIME literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00'; a @@ -1079,7 +1079,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 # DATE cast + TIME-alike string literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00'; a @@ -1089,7 +1089,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = '00:00:00')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 and coalesce(`test`.`t1`.`a`) = '00:00:00' # DATE cast + TIME-alike integer literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0; a @@ -1099,7 +1099,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = 0)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 and coalesce(`test`.`t1`.`a`) = 0 # DATE literal + TIME cast SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00'); a @@ -1109,7 +1109,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00: id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' # DATE literal + TIME literal SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00'; a @@ -1119,7 +1119,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' # DATE literal + TIME-alike string literal SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00'; a @@ -1129,7 +1129,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') and (coalesce(`test`.`t1`.`a`) = '00:00:00')) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' and coalesce(`test`.`t1`.`a`) = '00:00:00' # DATE literal + TIME-alike integer literal SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0; a @@ -1139,7 +1139,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = DATE'2015-09-11') and (coalesce(`test`.`t1`.`a`) = 0)) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' and coalesce(`test`.`t1`.`a`) = 0 DROP TABLE t1; SET timestamp=DEFAULT; # diff --git a/mysql-test/r/type_time_6065.result b/mysql-test/r/type_time_6065.result index a61c658d50e..341fc9fe98e 100644 --- a/mysql-test/r/type_time_6065.result +++ b/mysql-test/r/type_time_6065.result @@ -12,7 +12,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -33,7 +33,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -54,7 +54,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where 1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -75,7 +75,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where 1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -96,7 +96,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -117,7 +117,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -138,7 +138,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index 1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -159,7 +159,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index 1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -180,7 +180,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -201,7 +201,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -222,7 +222,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where 1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -243,7 +243,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where 1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -264,7 +264,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -285,7 +285,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -306,7 +306,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index 1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -327,7 +327,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index 1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -348,7 +348,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -379,7 +379,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -410,7 +410,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -441,7 +441,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -472,7 +472,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -503,7 +503,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -534,7 +534,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -565,7 +565,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -596,7 +596,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -627,7 +627,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -658,7 +658,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -689,7 +689,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -720,7 +720,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -751,7 +751,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -782,7 +782,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -813,7 +813,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -844,7 +844,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -870,7 +870,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -896,7 +896,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -922,7 +922,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -948,7 +948,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -974,7 +974,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1000,7 +1000,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1026,7 +1026,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1052,7 +1052,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1078,7 +1078,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1104,7 +1104,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1130,7 +1130,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1156,7 +1156,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1182,7 +1182,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1208,7 +1208,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1234,7 +1234,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1260,7 +1260,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1291,7 +1291,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1322,7 +1322,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1353,7 +1353,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1384,7 +1384,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1415,7 +1415,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1446,7 +1446,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1477,7 +1477,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1508,7 +1508,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1539,7 +1539,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1570,7 +1570,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1601,7 +1601,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1632,7 +1632,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1663,7 +1663,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1694,7 +1694,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1725,7 +1725,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1756,7 +1756,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1782,7 +1782,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1808,7 +1808,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1834,7 +1834,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t1 ignore INDEX (col_time_key) STRAIGHT_JOIN @@ -1860,7 +1860,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1886,7 +1886,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1912,7 +1912,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1938,7 +1938,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index 1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t1 force INDEX (col_time_key) STRAIGHT_JOIN @@ -1964,7 +1964,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -1990,7 +1990,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2016,7 +2016,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2042,7 +2042,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t2 ignore INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2068,7 +2068,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2094,7 +2094,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2120,7 +2120,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2146,7 +2146,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index 1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1) Warnings: -Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where (`test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`) +Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key` SELECT * FROM t2 force INDEX (col_datetime_key) STRAIGHT_JOIN @@ -2198,7 +2198,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system col_datetime_key NULL NULL NULL 1 100.00 1 SIMPLE t3 index col_time_key col_time_key 4 NULL 20 100.00 Using where; Using index Warnings: -Note 1003 select 1 AS `col_int_nokey`,'2001-11-04 19:07:55' AS `col_datetime_key`,'k' AS `col_varchar_key`,`test`.`t3`.`col_time_key` AS `col_time_key` from `test`.`t3` FORCE INDEX (`col_time_key`) where (`test`.`t3`.`col_time_key` > '2001-11-04 19:07:55') +Note 1003 select 1 AS `col_int_nokey`,'2001-11-04 19:07:55' AS `col_datetime_key`,'k' AS `col_varchar_key`,`test`.`t3`.`col_time_key` AS `col_time_key` from `test`.`t3` FORCE INDEX (`col_time_key`) where `test`.`t3`.`col_time_key` > '2001-11-04 19:07:55' SELECT * FROM t2 STRAIGHT_JOIN t3 FORCE INDEX (col_time_key) ON t3.col_time_key > t2.col_datetime_key; col_int_nokey col_datetime_key col_varchar_key col_time_key @@ -2228,7 +2228,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system col_datetime_key NULL NULL NULL 1 100.00 1 SIMPLE t3 ALL NULL NULL NULL NULL 20 100.00 Using where Warnings: -Note 1003 select 1 AS `col_int_nokey`,'2001-11-04 19:07:55' AS `col_datetime_key`,'k' AS `col_varchar_key`,`test`.`t3`.`col_time_key` AS `col_time_key` from `test`.`t3` IGNORE INDEX (`col_time_key`) where (`test`.`t3`.`col_time_key` > '2001-11-04 19:07:55') +Note 1003 select 1 AS `col_int_nokey`,'2001-11-04 19:07:55' AS `col_datetime_key`,'k' AS `col_varchar_key`,`test`.`t3`.`col_time_key` AS `col_time_key` from `test`.`t3` IGNORE INDEX (`col_time_key`) where `test`.`t3`.`col_time_key` > '2001-11-04 19:07:55' SELECT * FROM t2 STRAIGHT_JOIN t3 IGNORE INDEX (col_time_key) ON t3.col_time_key > t2.col_datetime_key; col_int_nokey col_datetime_key col_varchar_key col_time_key @@ -2271,7 +2271,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY outr2 index col_time_key col_time_key 4 NULL 20 100.00 Using where; Using index; Using join buffer (flat, BNL join) 2 MATERIALIZED innr ref col_int_key col_int_key 4 const 2 100.00 Using where Warnings: -Note 1003 select 1 AS `col_int_nokey` from `test`.`t3` `outr2` semi join (`test`.`t1` `innr`) where ((`test`.`innr`.`col_int_key` = 1) and (`test`.`innr`.`pk` >= `test`.`innr`.`col_int_nokey`) and (`test`.`outr2`.`col_time_key` > '2001-11-04 19:07:55')) +Note 1003 select 1 AS `col_int_nokey` from `test`.`t3` `outr2` semi join (`test`.`t1` `innr`) where `test`.`innr`.`col_int_key` = 1 and `test`.`innr`.`pk` >= `test`.`innr`.`col_int_nokey` and `test`.`outr2`.`col_time_key` > '2001-11-04 19:07:55' SELECT outr.col_int_nokey FROM t2 as outr STRAIGHT_JOIN t3 AS outr2 diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 90246fed831..93180218fe4 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -833,14 +833,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) <> 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP);; INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01'); @@ -856,20 +856,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 19 + rand() EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Warning 1292 Incorrect datetime value: ' garbage ' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and ((length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00' and (length(TIMESTAMP'0000-00-00 00:00:00')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP);; INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01'); @@ -888,13 +888,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (30 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP(6));; INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000'); @@ -913,13 +913,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000') and ((length(TIMESTAMP'2001-01-01 00:00:00.000000')) = (40 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and (length(TIMESTAMP'2001-01-01 00:00:00.000000')) = 40 + rand() DROP TABLE t1; SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30'); CREATE TABLE t1 (a TIMESTAMP);; @@ -939,13 +939,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and ((length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand()))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and (length(TIMESTAMP'2001-01-01 00:00:00')) = 40 + rand() DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 5d4aa24c9c6..93672abce44 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -410,7 +410,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=2010; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 SELECT * FROM t1 WHERE a=2010 AND a>=10; a 2010 @@ -418,7 +418,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2010 AND a>=10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 SELECT * FROM t1 WHERE a=10 AND a>=2010; a 2010 @@ -426,7 +426,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=2010; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 SELECT * FROM t1 WHERE a=10 AND a>=10; a 2010 @@ -434,7 +434,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 2010) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 DROP TABLE t1; # # End of 10.1 tests diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index 737ed32f1ee..98aa2b50fc6 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -440,7 +440,7 @@ EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`f1` = ((1 + myfunc_double(1 AS `1`)))) +Note 1003 select 1 AS `1` from `test`.`t1` where `test`.`t1`.`f1` = (1 + myfunc_double(1 AS `1`)) DROP FUNCTION myfunc_double; DROP TABLE t1; # diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index a692af93b37..adaaf084a3d 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1674,7 +1674,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 UNION t1 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (`a` + 12) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `a` + 12 # Should not crash SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY a + 12; a @@ -1713,7 +1713,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #-1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <`a`>((select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <`a`>((select `a` from `test`.`t2` where `test`.`t2`.`b` = 12)) # Should not crash SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY (SELECT a FROM t2 WHERE b = 12); diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result index 74b888e49c5..887a53887fe 100644 --- a/mysql-test/r/upgrade.result +++ b/mysql-test/r/upgrade.result @@ -110,7 +110,7 @@ Database (%a-b-c%) a-b-c show create view `a-b-c`.v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`) utf8 utf8_general_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME` utf8 utf8_general_ci select * from `a-b-c`.v1; f1 drop database `a-b-c`; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 760e11e8193..d6762e5a1c5 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -77,7 +77,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@`t1`) AS `@t1`,(@`t2`) AS `@t2`,(@`t3`) AS `@t3` +Note 1003 select @t1:=(@t2:=1) + (@t3:=4) AS `@t1:=(@t2:=1)+@t3:=4`,@`t1` AS `@t1`,@`t2` AS `@t2`,@`t3` AS `@t3` select @t5; @t5 1.23456 @@ -1805,19 +1805,19 @@ explain extended select @@VERsion from dual where rand() > @@verSION; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select @@VERsion AS "@@VERsion" from DUAL where (rand() > @@version) +Note 1003 select @@VERsion AS "@@VERsion" from DUAL where rand() > @@version explain extended select @@SESsion.SQL_mode from dual where rand() > @@sesSION.sql_MODE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select @@SESsion.SQL_mode AS "@@SESsion.SQL_mode" from DUAL where (rand() > @@sql_mode) +Note 1003 select @@SESsion.SQL_mode AS "@@SESsion.SQL_mode" from DUAL where rand() > @@sql_mode explain extended select @@GLObal.COLLATION_connection from dual where rand() > @@gloBAL.collation_CONNECTION; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select @@GLObal.COLLATION_connection AS "@@GLObal.COLLATION_connection" from DUAL where (rand() > @@global.collation_connection) +Note 1003 select @@GLObal.COLLATION_connection AS "@@GLObal.COLLATION_connection" from DUAL where rand() > @@global.collation_connection explain extended select @@FOObar.KEY_BUFfer_size from dual where rand() > @@fooBAR.key_bufFER_SIZE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select @@FOObar.KEY_BUFfer_size AS "@@FOObar.KEY_BUFfer_size" from DUAL where (rand() > @@fooBAR.key_buffer_size) +Note 1003 select @@FOObar.KEY_BUFfer_size AS "@@FOObar.KEY_BUFfer_size" from DUAL where rand() > @@fooBAR.key_buffer_size diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index faf645d9468..c1ec95beef7 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -40,10 +40,10 @@ c 11 show create table v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci show create view t1; ERROR HY000: 'test.t1' is not VIEW drop table t1; @@ -59,11 +59,11 @@ explain extended select c from v1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1` +Note 1003 select `test`.`t1`.`b` + 1 AS `c` from `test`.`t1` create algorithm=temptable view v2 (c) as select b+1 from t1; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci select c from v2; c 3 @@ -93,7 +93,7 @@ explain extended select c from v3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select ((`test`.`t1`.`b` + 1) + 1) AS `c` from `test`.`t1` +Note 1003 select `test`.`t1`.`b` + 1 + 1 AS `c` from `test`.`t1` create algorithm=temptable view v4 (c) as select c+1 from v2; select c from v4; c @@ -122,7 +122,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 5 100.00 3 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select (`v2`.`c` + 1) AS `c` from `test`.`v2` +Note 1003 select `v2`.`c` + 1 AS `c` from `test`.`v2` create algorithm=temptable view v6 (c) as select c+1 from v1; select c from v6; c @@ -392,7 +392,7 @@ explain extended select * from v1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`b` AS `c` from `test`.`t1` where (`test`.`t1`.`a` < 3) +Note 1003 select `test`.`t1`.`b` AS `c` from `test`.`t1` where `test`.`t1`.`a` < 3 update v1 set c=c+1; select * from t1; a b @@ -793,7 +793,7 @@ a b 1 1 show create view v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`) latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where `v1`.`col1` = `v2`.`col1` latin1 latin1_swedish_ci drop view v3, v2, v1; drop table t2, t1; create function `f``1` () returns int return 5; @@ -817,10 +817,10 @@ create table t2 (col1 char collate latin1_german2_ci); create view v2 as select col1 collate latin1_german1_ci from t2; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`col1` collate latin1_german1_ci AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`col1` collate latin1_german1_ci AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci drop view v2; drop table t2; create table t1 (a int); @@ -1447,7 +1447,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join `test`.`t2` on((`test`.`t2`.`a` = `test`.`t3`.`a`))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join `test`.`t2` on(`test`.`t2`.`a` = `test`.`t3`.`a`)) on(`test`.`t1`.`a` = `test`.`t3`.`a`) where 1 create view v1 (a) as select a from t1; create view v2 (a) as select a from t2; create view v4 (a,b) as select v1.a as a, v2.a as b from v1 left join v2 on (v1.a=v2.a); @@ -1462,7 +1462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join (`test`.`t2`) on((`test`.`t2`.`a` = `test`.`t3`.`a`))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join (`test`.`t2`) on(`test`.`t2`.`a` = `test`.`t3`.`a`)) on(`test`.`t1`.`a` = `test`.`t3`.`a`) where 1 prepare stmt1 from "select * from t3 left join v4 on (t3.a = v4.a);"; execute stmt1; a a b @@ -1920,24 +1920,24 @@ create table t2 (b timestamp default now()); create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < current_timestamp()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < current_timestamp()) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,`t1`.`a` < current_timestamp() AS `t1.a < now()` from (`t1` join `t2`) where `t1`.`a` < current_timestamp() latin1 latin1_swedish_ci drop view v1; drop table t1, t2; CREATE TABLE t1 ( a varchar(50) ); CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = CURRENT_USER(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = current_user()) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` = current_user() latin1 latin1_swedish_ci DROP VIEW v1; CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = VERSION(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = version()) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` = version() latin1 latin1_swedish_ci DROP VIEW v1; CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = DATABASE(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = database()) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` = database() latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (col1 time); @@ -2712,7 +2712,7 @@ SELECT id, date(d) + INTERVAL TIME_TO_SEC(d) SECOND AS t, COUNT(*) FROM t1 GROUP BY id, t; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second latin1 latin1_swedish_ci SELECT * FROM v1; id t COUNT(*) DROP VIEW v1; @@ -2741,7 +2741,7 @@ SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(`t1`.`test_date`) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select year(`t1`.`test_date`) - year(`t1`.`DOB`) AS `Age` from `t1` having `Age` < 75 latin1 latin1_swedish_ci SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75; Age 43 @@ -2948,7 +2948,7 @@ create table t1 (f1 datetime); create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between current_timestamp() and (current_timestamp() + interval 1 minute)) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where `t1`.`f1` between current_timestamp() and current_timestamp() + interval 1 minute latin1 latin1_swedish_ci drop view v1; drop table t1; DROP TABLE IF EXISTS t1; @@ -3025,7 +3025,7 @@ SHOW WARNINGS; Level Code Message SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(`t2`.`fk` = `t1`.`pk` and `t2`.`ver` = (select max(`t`.`ver`) from `t2` `t` where `t`.`org` = `t2`.`org`))) latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1, t2; DROP FUNCTION IF EXISTS f1; @@ -3089,7 +3089,7 @@ DROP TABLE t1; CREATE VIEW v AS SELECT !0 * 5 AS x FROM DUAL; SHOW CREATE VIEW v; View Create View character_set_client collation_connection -v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select ((not(0)) * 5) AS `x` latin1 latin1_swedish_ci +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select !0 * 5 AS `x` latin1 latin1_swedish_ci SELECT !0 * 5 AS x FROM DUAL; x 5 @@ -3323,7 +3323,7 @@ a IS NOT FALSE int(1) NO 0 old_isnotfalse int(1) NO 0 show create view view_24532_b; View Create View character_set_client collation_connection -view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select (`table_24532`.`a` is true) AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,(`table_24532`.`a` is not true) AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,(`table_24532`.`a` is false) AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,(`table_24532`.`a` is not false) AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532` latin1 latin1_swedish_ci +view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select `table_24532`.`a` is true AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,`table_24532`.`a` is not true AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,`table_24532`.`a` is false AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,`table_24532`.`a` is not false AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532` latin1 latin1_swedish_ci insert into table_24532 values (0, 0, 0, 0); select * from view_24532_b; a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT FALSE old_isnotfalse @@ -3860,7 +3860,7 @@ CREATE TABLE t1 (c INT); CREATE VIEW v1 (view_column) AS SELECT c AS alias FROM t1 HAVING alias; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c` AS `view_column` from `t1` having (`view_column` <> 0) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c` AS `view_column` from `t1` having `view_column` <> 0 latin1 latin1_swedish_ci SELECT * FROM v1; view_column @@ -4258,7 +4258,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 8)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8 FLUSH STATUS; SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8; a c @@ -4282,7 +4282,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = `test`.`t1`.`a`) and (`test`.`t1`.`a` > 8)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8 FLUSH STATUS; SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8; a c @@ -4341,7 +4341,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 3)) or ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t1`.`b` >= 4))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 or `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t1`.`b` >= 4 create view v1 as select * from t2; select * from t1,v1 where v1.c=t1.a and v1.c < 3 or v1.c=t1.b and v1.c >=4; a b c @@ -4355,7 +4355,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 3)) or ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t1`.`b` >= 4))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 or `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t1`.`b` >= 4 create view v2 as select * from v1; select * from t1,v2 where v2.c=t1.a and v2.c < 3 or v2.c=t1.b and v2.c >=4; a b c @@ -4369,7 +4369,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 3)) or ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t1`.`b` >= 4))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 or `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t1`.`b` >= 4 create view v3 as select * from t1; select * from v3,v2 where v2.c=v3.a and v2.c < 3 or v2.c=v3.b and v2.c >=4; a b c @@ -4383,7 +4383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 3)) or ((`test`.`t2`.`c` = `test`.`t1`.`b`) and (`test`.`t1`.`b` >= 4))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 or `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t1`.`b` >= 4 drop view v1,v2,v3; drop table t1,t2; # @@ -4406,7 +4406,7 @@ SELECT * FROM v1 WHERE a > -1 OR a > 6 AND a = 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > -1 SELECT * FROM v1 WHERE a > -1 OR a AND a = 0; a 2 @@ -4421,7 +4421,7 @@ SELECT * FROM v1 WHERE a > -1 OR a AND a = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > -1 CREATE VIEW v2 AS SELECT * FROM v1; SELECT * FROM v2 WHERE a > -1 OR a AND a = 0; a @@ -4437,7 +4437,7 @@ SELECT * FROM v2 WHERE a > -1 OR a AND a = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > -1 DROP VIEW v1,v2; DROP TABLE t1; CREATE TABLE t1 (a varchar(10), KEY (a)) ; @@ -4463,13 +4463,13 @@ SELECT * FROM v1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 'JJ' or `test`.`t1`.`a` = 'VV' and `test`.`t1`.`a` <> 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 'JJ' OR a <> 0 AND a = 'VV'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 'JJ' or `test`.`t1`.`a` = 'VV' and `test`.`t1`.`a` <> 0 # t1 and v1 should return the same result set SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV'; a @@ -4489,13 +4489,13 @@ SELECT * FROM v1 WHERE a > 'JJ' OR a AND a = 'VV'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 'JJ' or `test`.`t1`.`a` = 'VV' and `test`.`t1`.`a` <> 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 'JJ' OR a AND a = 'VV'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 13 NULL 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` > 'JJ') or ((`test`.`t1`.`a` = 'VV') and (`test`.`t1`.`a` <> 0))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 'JJ' or `test`.`t1`.`a` = 'VV' and `test`.`t1`.`a` <> 0 DROP VIEW v1; DROP TABLE t1; # @@ -4564,7 +4564,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where ((`test`.`t1`.`b` = 1) or ((`test`.`t1`.`a` = 'a') and (length(`test`.`t1`.`a`) >= `test`.`t1`.`b`))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t1`.`b` = 1 or `test`.`t1`.`a` = 'a' and length(`test`.`t1`.`a`) >= `test`.`t1`.`b` DROP VIEW v1; DROP TABLE t1,t2; # Bug#798625: duplicate of the previous one, but without crash @@ -4671,7 +4671,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,10 AS `a` from `test`.`t1` where (not(<10,`test`.`t1`.`a`>((10,(select NULL from `test`.`t4` where ((`test`.`t4`.`a` >= `test`.`t1`.`a`) and trigcond((((10) = NULL) or (isnull(NULL))))) having trigcond((NULL))))))) +Note 1003 select `test`.`t1`.`a` AS `a`,10 AS `a` from `test`.`t1` where !<10,`test`.`t1`.`a`>((10,(select NULL from `test`.`t4` where `test`.`t4`.`a` >= `test`.`t1`.`a` and trigcond((10) = NULL or (NULL is null)) having trigcond(NULL is null)))) SELECT * FROM t1, t2 WHERE t2.a NOT IN (SELECT t3.b FROM t3 RIGHT JOIN t4 ON (t4.a = t3.a) WHERE t4.a >= t1.a); @@ -4687,7 +4687,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'v1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a` AS `a`,10 AS `a` from `test`.`t1` where (not(<10,`test`.`t1`.`a`>((10,(select NULL from `test`.`t4` where ((`test`.`t4`.`a` >= `test`.`t1`.`a`) and trigcond((((10) = NULL) or (isnull(NULL))))) having trigcond((NULL))))))) +Note 1003 select `test`.`t1`.`a` AS `a`,10 AS `a` from `test`.`t1` where !<10,`test`.`t1`.`a`>((10,(select NULL from `test`.`t4` where `test`.`t4`.`a` >= `test`.`t1`.`a` and trigcond((10) = NULL or (NULL is null)) having trigcond(NULL is null)))) SELECT * FROM v1, t2 WHERE t2.a NOT IN (SELECT t3.b FROM t3 RIGHT JOIN t4 ON (t4.a = t3.a) WHERE t4.a >= v1.a); @@ -4718,7 +4718,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: Note 1276 Field or reference 'test.t4.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where (`test`.`t4`.`c` <= <`test`.`t4`.`b`>((select 0 from dual where (7 > `test`.`t4`.`b`)))) +Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where `test`.`t4`.`c` <= <`test`.`t4`.`b`>((select 0 from dual where 7 > `test`.`t4`.`b`)) SELECT * FROM t3 , t4 WHERE t4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d ) WHERE t2.b > t4.b); @@ -4735,7 +4735,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found Warnings: Note 1276 Field or reference 'v4.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where (`test`.`t4`.`c` <= <`test`.`t4`.`b`>((select 0 from dual where (7 > `test`.`t4`.`b`)))) +Note 1003 select 0 AS `c`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c` from `test`.`t4` where `test`.`t4`.`c` <= <`test`.`t4`.`b`>((select 0 from dual where 7 > `test`.`t4`.`b`)) SELECT * FROM t3, v4 WHERE v4.c <= (SELECT t2.e FROM t2 LEFT JOIN t1 ON ( t1.a = t2.d ) WHERE t2.b > v4.b); @@ -5496,15 +5496,15 @@ create table t1 (a int, b int); create algorithm=temptable view v2 (c) as select b+1 from t1; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci alter algorithm=undefined view v2 (c) as select b+1 from t1; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci alter algorithm=merge view v2 (c) as select b+1 from t1; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`b` + 1 AS `c` from `t1` latin1 latin1_swedish_ci drop view v2; drop table t1; # @@ -5594,7 +5594,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) AS `c` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) AS `c` from `test`.`t1` select * from v1; a c 1 2 @@ -5611,7 +5611,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) AS `c` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) AS `c` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2, v1 where t2.a=v1.a; a b a c 1 2 1 2 @@ -5630,7 +5630,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) AS `c` from `test`.`t1` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) AS `c` from `test`.`t1` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t1`.`a` select * from t1, v1 where t1.a=v1.a; a b a c 1 2 1 2 @@ -5649,7 +5649,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) AS `c` from `test`.`t1` join `test`.`t1` where (`test`.`t1`.`b` = (select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) AS `c` from `test`.`t1` join `test`.`t1` where `test`.`t1`.`b` = (select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) select * from t1, v1 where t1.b=v1.c; a b a c 1 2 1 2 @@ -5667,7 +5667,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) AS `c` from `test`.`t2` join `test`.`t1` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a`,(select max(`test`.`t2`.`b`) from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) AS `c` from `test`.`t2` join `test`.`t1` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2, t1, v1 where t1.a=t2.a and t1.a=v1.a; a b a b a c 1 2 1 2 1 2 @@ -6241,7 +6241,7 @@ INSERT INTO t3 VALUES (1),(8); CREATE VIEW v1 AS SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i`,`alias1`.`j` AS `j` from (`test`.`t1` left join (select `test`.`t2`.`j` AS `j` from (`test`.`t2` join `test`.`t3` on((`test`.`t3`.`k` = `test`.`t2`.`j`)))) `alias1` on((`test`.`t1`.`i` = `alias1`.`j`))) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i`,`alias1`.`j` AS `j` from (`test`.`t1` left join (select `test`.`t2`.`j` AS `j` from (`test`.`t2` join `test`.`t3` on(`test`.`t3`.`k` = `test`.`t2`.`j`))) `alias1` on(`test`.`t1`.`i` = `alias1`.`j`)) latin1 latin1_swedish_ci SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); i j 3 NULL diff --git a/mysql-test/r/view_alias.result b/mysql-test/r/view_alias.result index e07b40dba13..f3ae7aef3a6 100644 --- a/mysql-test/r/view_alias.result +++ b/mysql-test/r/view_alias.result @@ -90,7 +90,7 @@ CREATE TABLE t2 LIKE t1; # Test alias in subquery CREATE VIEW v1 AS SELECT a FROM t1 WHERE EXISTS (SELECT 1 FROM t2 AS b WHERE b.a = 0); DROP VIEW v1; -CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select 1 from `test`.`t2` `b` where (`b`.`a` = 0)); +CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select 1 from `test`.`t2` `b` where `b`.`a` = 0); DROP VIEW v1; # Test column alias in subquery CREATE VIEW v1 AS SELECT a FROM t1 WHERE EXISTS (SELECT a AS alias FROM t1 GROUP BY alias); diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 948e88a1804..04ad19c5ddc 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -132,7 +132,7 @@ grant select on mysqltest.v5 to mysqltest_1@localhost; connection user1; show create view mysqltest.v5; View Create View character_set_client collation_connection -v5 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v5` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v5` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v1; ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show create view mysqltest.v1; @@ -147,7 +147,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found show create view mysqltest.v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v2; ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show create view mysqltest.v2; @@ -170,24 +170,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found show create view mysqltest.v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY system NULL NULL NULL NULL 0 const row not found 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v3; ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show create view mysqltest.v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select `mysqltest`.`t2`.`a` + 1 AS `c`,`mysqltest`.`t2`.`b` + 1 AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci explain select c from mysqltest.v4; ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show create view mysqltest.v4; View Create View character_set_client collation_connection -v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci +v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select `mysqltest`.`t2`.`a` + 1 AS `c`,`mysqltest`.`t2`.`b` + 1 AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci connection root; revoke all privileges on mysqltest.* from mysqltest_1@localhost; drop user mysqltest_1@localhost; diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index 746ce5a2e59..c8c55b91016 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -1497,7 +1497,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "having_condition": "(MX in (3,5,7))", + "having_condition": "MX in (3,5,7)", "filesort": { "sort_key": "t1.b", "window_functions_computation": { @@ -2275,7 +2275,7 @@ rows between 1 preceding and 2 following) as CNT from t1; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,(`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following )) AS `CNT` from `t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following ) AS `CNT` from `t1` latin1 latin1_swedish_ci select * from v1; pk c CNT 1 1 0.3333 @@ -2305,7 +2305,7 @@ create view v2 as select pk, c, c/count(*) over w1 as CNT from t1 window w1 as (partition by c order by pk rows between 1 preceding and 2 following); show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,(`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following )) AS `CNT` from `t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following ) AS `CNT` from `t1` latin1 latin1_swedish_ci select * from v2; pk c CNT 1 1 0.3333 @@ -2335,7 +2335,7 @@ create view v3 as select pk, c, c/count(*) over w1 as CNT from t1 window w1 as (partition by c order by pk rows unbounded preceding); show create view v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,(`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between unbounded preceding and current row )) AS `CNT` from `t1` latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between unbounded preceding and current row ) AS `CNT` from `t1` latin1 latin1_swedish_ci select * from v3; pk c CNT 1 1 1.0000 @@ -2367,7 +2367,7 @@ range between 3 preceding and current row) as CNT from t1; show create view v4; View Create View character_set_client collation_connection -v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,(`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` range between 3 preceding and current row )) AS `CNT` from `t1` latin1 latin1_swedish_ci +v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` range between 3 preceding and current row ) AS `CNT` from `t1` latin1 latin1_swedish_ci select * from v4; pk c CNT 1 1 1.0000 diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index 7be443ec658..04e689cc651 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -1544,7 +1544,7 @@ IS NOT NULL 2000 4 IS NOT NULL 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year` is null,'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1573,7 +1573,7 @@ IS NOT NULL 13:00:00 4 IS NOT NULL 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time` is null,'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1602,7 +1602,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp` is null,'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1631,7 +1631,7 @@ IS NOT NULL 2004-02-29 4 IS NOT NULL 2005-06-28 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date` is null,'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1660,7 +1660,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime` is null,'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1689,7 +1689,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double` is null,'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1718,7 +1718,7 @@ IS NOT NULL 0.000000000000000000000000000000 4 IS NOT NULL -1.000000000000000000000000000000 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal` is null,'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1747,7 +1747,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint` is null,'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1776,7 +1776,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1805,7 +1805,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1834,7 +1834,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1863,7 +1863,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index 93fe4dc6b5f..0ce0130e727 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -21556,7 +21556,7 @@ CREATE OR REPLACE VIEW test1.v27 AS SELECT f1, f2 FROM test1.t1 tab1 NATURAL JOIN test1.v26 tab2; SHOW CREATE VIEW test1.v27; View Create View character_set_client collation_connection -v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v27; f1 f2 @@ -21572,7 +21572,7 @@ CREATE VIEW test1.v28 AS SELECT f1, f2 FROM test3.t1 tab1 NATURAL JOIN test1.v27 tab2; SHOW CREATE VIEW test1.v28; View Create View character_set_client collation_connection -v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v28; f1 f2 diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index f7a02411502..765869a312d 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -1545,7 +1545,7 @@ IS NOT NULL 2000 4 IS NOT NULL 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year` is null,'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1574,7 +1574,7 @@ IS NOT NULL 13:00:00 4 IS NOT NULL 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time` is null,'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1603,7 +1603,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp` is null,'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1632,7 +1632,7 @@ IS NOT NULL 2004-02-29 4 IS NOT NULL 2005-06-28 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date` is null,'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1661,7 +1661,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime` is null,'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1690,7 +1690,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double` is null,'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1719,7 +1719,7 @@ IS NOT NULL 0.000000000000000000000000000000 4 IS NOT NULL -1.000000000000000000000000000000 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal` is null,'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1748,7 +1748,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint` is null,'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1777,7 +1777,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1806,7 +1806,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1835,7 +1835,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1864,7 +1864,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 885e2a7dfe7..0ca6e8d94d8 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -21558,7 +21558,7 @@ CREATE OR REPLACE VIEW test1.v27 AS SELECT f1, f2 FROM test1.t1 tab1 NATURAL JOIN test1.v26 tab2; SHOW CREATE VIEW test1.v27; View Create View character_set_client collation_connection -v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v27; f1 f2 @@ -21574,7 +21574,7 @@ CREATE VIEW test1.v28 AS SELECT f1, f2 FROM test3.t1 tab1 NATURAL JOIN test1.v27 tab2; SHOW CREATE VIEW test1.v28; View Create View character_set_client collation_connection -v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v28; f1 f2 diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index f7a02411502..765869a312d 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -1545,7 +1545,7 @@ IS NOT NULL 2000 4 IS NOT NULL 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year` is null,'IS NULL','IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1574,7 +1574,7 @@ IS NOT NULL 13:00:00 4 IS NOT NULL 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time` is null,'IS NULL','IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1603,7 +1603,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp` is null,'IS NULL','IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1632,7 +1632,7 @@ IS NOT NULL 2004-02-29 4 IS NOT NULL 2005-06-28 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date` is null,'IS NULL','IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1661,7 +1661,7 @@ IS NOT NULL 2004-02-29 23:59:59 4 IS NOT NULL 2005-06-28 10:00:00 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime` is null,'IS NULL','IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1690,7 +1690,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double` is null,'IS NULL','IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1719,7 +1719,7 @@ IS NOT NULL 0.000000000000000000000000000000 4 IS NOT NULL -1.000000000000000000000000000000 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal` is null,'IS NULL','IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1748,7 +1748,7 @@ IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint` is null,'IS NULL','IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1777,7 +1777,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1806,7 +1806,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1835,7 +1835,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000` is null,'IS NULL','IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values @@ -1864,7 +1864,7 @@ IS NOT NULL ---äÖüß@µ*$-- 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30` is null,'IS NULL','IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL', 'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci SELECT v1.* FROM v1 WHERE v1.id IN (SELECT id FROM t1_values diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 3103056ce3f..7a27703a1ec 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -16316,7 +16316,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); return f1; END// SELECT fn4(-9.22e+15); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP FUNCTION IF EXISTS fn5; CREATE FUNCTION fn5( f1 decimal) returns decimal BEGIN @@ -16797,7 +16797,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); return f1; END// SELECT fn56(-8388601); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP FUNCTION IF EXISTS fn57; CREATE FUNCTION fn57( f1 numeric) returns numeric BEGIN @@ -17065,7 +17065,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); return f1; END// SELECT fn84(-32601); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP FUNCTION IF EXISTS fn85; CREATE FUNCTION fn85( f1 tinyint) returns tinyint BEGIN @@ -17100,7 +17100,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); return f1; END// SELECT fn88(-101); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP FUNCTION IF EXISTS fn89; CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum') BEGIN @@ -17319,7 +17319,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); SELECT f1; END// CALL sp4(-9.22e+15); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE IF EXISTS sp5; CREATE PROCEDURE sp5( f1 decimal) BEGIN @@ -17876,7 +17876,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); SELECT f1; END// CALL sp56(-8388601); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE IF EXISTS sp57; CREATE PROCEDURE sp57( f1 numeric) BEGIN @@ -18208,7 +18208,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); SELECT f1; END// CALL sp84(-32601); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE IF EXISTS sp85; CREATE PROCEDURE sp85( f1 tinyint) BEGIN @@ -18243,7 +18243,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10); SELECT f1; END// CALL sp88(-101); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE IF EXISTS sp89; CREATE PROCEDURE sp89( f1 enum('1enum', '2enum')) BEGIN @@ -18570,7 +18570,7 @@ CALL sp4(-9.22e+18, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute04(); -ERROR 22003: BIGINT value is out of range in '(f1@0 * 2)' +ERROR 22003: BIGINT value is out of range in 'f1@0 * 2' DROP PROCEDURE spexecute04; DROP PROCEDURE sp4; DROP PROCEDURE IF EXISTS sp6; @@ -18683,7 +18683,7 @@ f7 f8 f9 -9220000000000000000 -9220000000000000000 NULL f10 f11 f12 -9220000000000000000 -9220000000000000000 NULL -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 * 2)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 * 2' DROP PROCEDURE spexecute07; DROP PROCEDURE sp07; DROP PROCEDURE IF EXISTS sp8; @@ -18734,7 +18734,7 @@ CALL sp8(1.84e+17, var1, var2, -9.22e+18, var3, var4, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute08(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute08; DROP PROCEDURE sp8; DROP PROCEDURE IF EXISTS sp9; @@ -18785,7 +18785,7 @@ CALL sp9(-9.22e+15, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute09(); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE spexecute09; DROP PROCEDURE sp9; DROP PROCEDURE IF EXISTS sp10; @@ -18828,7 +18828,7 @@ CALL sp10(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute10(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute10; DROP PROCEDURE sp10; DROP PROCEDURE IF EXISTS sp11; @@ -18860,7 +18860,7 @@ CALL sp11(--1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute11(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute11; DROP PROCEDURE sp11; DROP PROCEDURE IF EXISTS sp12; @@ -18892,7 +18892,7 @@ CALL sp12(99999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute12(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute12; DROP PROCEDURE sp12; DROP PROCEDURE IF EXISTS sp13; @@ -18924,7 +18924,7 @@ CALL sp13(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute13(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute13; DROP PROCEDURE sp13; DROP PROCEDURE IF EXISTS sp14; @@ -18956,7 +18956,7 @@ CALL sp14(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute14(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute14; DROP PROCEDURE sp14; DROP PROCEDURE IF EXISTS sp15; @@ -18987,7 +18987,7 @@ CALL sp15(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute15(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute15; DROP PROCEDURE sp15; DROP PROCEDURE IF EXISTS sp16; @@ -19018,7 +19018,7 @@ CALL sp16(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute16(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute16; DROP PROCEDURE sp16; DROP PROCEDURE IF EXISTS sp17; @@ -19049,7 +19049,7 @@ CALL sp17(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute17(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute17; DROP PROCEDURE sp17; DROP PROCEDURE IF EXISTS sp18; @@ -19080,7 +19080,7 @@ CALL sp18(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute18(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute18; DROP PROCEDURE sp18; DROP PROCEDURE IF EXISTS sp19; @@ -19111,7 +19111,7 @@ CALL sp19(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute19(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute19; DROP PROCEDURE sp19; DROP PROCEDURE IF EXISTS sp20; @@ -19142,7 +19142,7 @@ CALL sp20(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute20(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute20; DROP PROCEDURE sp20; DROP PROCEDURE IF EXISTS sp21; @@ -19173,7 +19173,7 @@ CALL sp21(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute21(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute21; DROP PROCEDURE sp21; DROP PROCEDURE IF EXISTS sp22; @@ -19204,7 +19204,7 @@ CALL sp22(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute22(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute22; DROP PROCEDURE sp22; DROP PROCEDURE IF EXISTS sp23; @@ -19235,7 +19235,7 @@ CALL sp23(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute23(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute23; DROP PROCEDURE sp23; DROP PROCEDURE IF EXISTS sp24; @@ -19266,7 +19266,7 @@ CALL sp24(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute24(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute24; DROP PROCEDURE sp24; DROP PROCEDURE IF EXISTS sp25; @@ -19297,7 +19297,7 @@ CALL sp25(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute25(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute25; DROP PROCEDURE sp25; DROP PROCEDURE IF EXISTS sp26; @@ -19328,7 +19328,7 @@ CALL sp26( '1997-12-31', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute26(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute26; DROP PROCEDURE sp26; DROP PROCEDURE IF EXISTS sp27; @@ -19359,7 +19359,7 @@ CALL sp27( '23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute27(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute27; DROP PROCEDURE sp27; DROP PROCEDURE IF EXISTS sp28; @@ -19390,7 +19390,7 @@ CALL sp28('1997-12-31 23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute28(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute28; DROP PROCEDURE sp28; DROP PROCEDURE IF EXISTS sp29; @@ -19421,7 +19421,7 @@ CALL sp29(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute29(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute29; DROP PROCEDURE sp29; DROP PROCEDURE IF EXISTS sp30; @@ -19452,7 +19452,7 @@ CALL sp30(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute30(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute30; DROP PROCEDURE sp30; DROP PROCEDURE IF EXISTS sp31; @@ -19483,7 +19483,7 @@ CALL sp31(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute31(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute31; DROP PROCEDURE sp31; DROP PROCEDURE IF EXISTS sp32; @@ -19514,7 +19514,7 @@ CALL sp32(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute32(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute32; DROP PROCEDURE sp32; DROP PROCEDURE IF EXISTS sp33; @@ -19545,7 +19545,7 @@ CALL sp33(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute33(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute33; DROP PROCEDURE sp33; DROP PROCEDURE IF EXISTS sp34; @@ -19576,7 +19576,7 @@ CALL sp34(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute34(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute34; DROP PROCEDURE sp34; DROP PROCEDURE IF EXISTS sp35; @@ -19607,7 +19607,7 @@ CALL sp35(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute35(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute35; DROP PROCEDURE sp35; DROP PROCEDURE IF EXISTS sp36; @@ -19638,7 +19638,7 @@ CALL sp36(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute36(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute36; DROP PROCEDURE sp36; DROP PROCEDURE IF EXISTS sp37; @@ -19669,7 +19669,7 @@ CALL sp37(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute37(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute37; DROP PROCEDURE sp37; DROP PROCEDURE IF EXISTS sp38; @@ -19700,7 +19700,7 @@ CALL sp38(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute38(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute38; DROP PROCEDURE sp38; DROP PROCEDURE IF EXISTS sp39; @@ -19731,7 +19731,7 @@ CALL sp39(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute39(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute39; DROP PROCEDURE sp39; DROP PROCEDURE IF EXISTS sp40; @@ -19762,7 +19762,7 @@ CALL sp40(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute40(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute40; DROP PROCEDURE sp40; DROP PROCEDURE IF EXISTS sp41; @@ -19793,7 +19793,7 @@ CALL sp41(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute41(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute41; DROP PROCEDURE sp41; DROP PROCEDURE IF EXISTS sp42; @@ -19824,7 +19824,7 @@ CALL sp42(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute42(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute42; DROP PROCEDURE sp42; DROP PROCEDURE IF EXISTS sp43; @@ -19855,7 +19855,7 @@ CALL sp43(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute43(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute43; DROP PROCEDURE sp43; DROP PROCEDURE IF EXISTS sp44; @@ -19886,7 +19886,7 @@ CALL sp44(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute44(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute44; DROP PROCEDURE sp44; DROP PROCEDURE IF EXISTS sp45; @@ -19917,7 +19917,7 @@ CALL sp45(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute45(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute45; DROP PROCEDURE sp45; DROP PROCEDURE IF EXISTS sp46; @@ -19948,7 +19948,7 @@ CALL sp46(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute46(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute46; DROP PROCEDURE sp46; DROP PROCEDURE IF EXISTS sp47; @@ -19979,7 +19979,7 @@ CALL sp47(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute47(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute47; DROP PROCEDURE sp47; DROP PROCEDURE IF EXISTS sp48; @@ -20010,7 +20010,7 @@ CALL sp48(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute48(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute48; DROP PROCEDURE sp48; DROP PROCEDURE IF EXISTS sp49; @@ -20041,7 +20041,7 @@ CALL sp49(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute49(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute49; DROP PROCEDURE sp49; DROP PROCEDURE IF EXISTS sp50; @@ -20072,7 +20072,7 @@ CALL sp50(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute50(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute50; DROP PROCEDURE sp50; DROP PROCEDURE IF EXISTS sp51; @@ -20103,7 +20103,7 @@ CALL sp51(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute51(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute51; DROP PROCEDURE sp51; DROP PROCEDURE IF EXISTS sp52; @@ -20134,7 +20134,7 @@ CALL sp52(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute52(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute52; DROP PROCEDURE sp52; DROP PROCEDURE IF EXISTS sp53; @@ -20165,7 +20165,7 @@ CALL sp53(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute53(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute53; DROP PROCEDURE sp53; DROP PROCEDURE IF EXISTS sp54; @@ -20196,7 +20196,7 @@ CALL sp54(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute54(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute54; DROP PROCEDURE sp54; DROP PROCEDURE IF EXISTS sp55; @@ -20227,7 +20227,7 @@ CALL sp55(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute55(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute55; DROP PROCEDURE sp55; DROP PROCEDURE IF EXISTS sp56; @@ -20564,7 +20564,7 @@ CALL sp65(999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute65(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute65; DROP PROCEDURE sp65; DROP PROCEDURE IF EXISTS sp66; @@ -20595,7 +20595,7 @@ CALL sp66(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute66(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute66; DROP PROCEDURE sp66; DROP PROCEDURE IF EXISTS sp67; @@ -20626,7 +20626,7 @@ CALL sp67(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute67(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute67; DROP PROCEDURE sp67; DROP PROCEDURE IF EXISTS sp68; @@ -20657,7 +20657,7 @@ CALL sp68(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute68(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute68; DROP PROCEDURE sp68; DROP PROCEDURE IF EXISTS sp69; @@ -20688,7 +20688,7 @@ CALL sp69(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute69(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute69; DROP PROCEDURE sp69; DROP PROCEDURE IF EXISTS sp70; @@ -20719,7 +20719,7 @@ CALL sp70(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute70(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute70; DROP PROCEDURE sp70; DROP PROCEDURE IF EXISTS sp71; @@ -20750,7 +20750,7 @@ CALL sp71(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute71(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute71; DROP PROCEDURE sp71; DROP PROCEDURE IF EXISTS sp72; @@ -20781,7 +20781,7 @@ CALL sp72(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute72(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute72; DROP PROCEDURE sp72; DROP PROCEDURE IF EXISTS sp73; @@ -20812,7 +20812,7 @@ CALL sp73(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute73(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute73; DROP PROCEDURE sp73; DROP PROCEDURE IF EXISTS sp74; @@ -20843,7 +20843,7 @@ CALL sp74(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute74(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute74; DROP PROCEDURE sp74; DROP PROCEDURE IF EXISTS sp75; @@ -20874,7 +20874,7 @@ CALL sp75(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute75(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute75; DROP PROCEDURE sp75; DROP PROCEDURE IF EXISTS sp76; @@ -20905,7 +20905,7 @@ CALL sp76(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute76(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute76; DROP PROCEDURE sp76; DROP PROCEDURE IF EXISTS sp77; @@ -20936,7 +20936,7 @@ CALL sp77(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute77(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute77; DROP PROCEDURE sp77; DROP PROCEDURE IF EXISTS sp78; @@ -20967,7 +20967,7 @@ CALL sp78(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute78(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute78; DROP PROCEDURE sp78; DROP PROCEDURE IF EXISTS sp79; @@ -20998,7 +20998,7 @@ CALL sp79(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute79(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute79; DROP PROCEDURE sp79; DROP PROCEDURE IF EXISTS sp80; @@ -21029,7 +21029,7 @@ CALL sp80(-2.15e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute80(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute80; DROP PROCEDURE sp80; DROP PROCEDURE IF EXISTS sp81; @@ -21060,7 +21060,7 @@ CALL sp81(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute81(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute81; DROP PROCEDURE sp81; DROP PROCEDURE IF EXISTS sp82; @@ -21091,7 +21091,7 @@ CALL sp82(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute82(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute82; DROP PROCEDURE sp82; DROP PROCEDURE IF EXISTS sp83; @@ -21122,7 +21122,7 @@ CALL sp83(2.15e+08, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute83(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute83; DROP PROCEDURE sp83; DROP PROCEDURE IF EXISTS sp84; @@ -21153,7 +21153,7 @@ CALL sp84(-8388600, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute84(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute84; DROP PROCEDURE sp84; DROP PROCEDURE IF EXISTS sp85; @@ -21184,7 +21184,7 @@ CALL sp85(16777201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute85(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute85; DROP PROCEDURE sp85; DROP PROCEDURE IF EXISTS sp86; @@ -21215,7 +21215,7 @@ CALL sp86(16777210, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute86(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute86; DROP PROCEDURE sp86; DROP PROCEDURE IF EXISTS sp87; @@ -21246,7 +21246,7 @@ CALL sp87(-8388601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute87(); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE spexecute87; DROP PROCEDURE sp87; DROP PROCEDURE IF EXISTS sp88; @@ -21277,7 +21277,7 @@ CALL sp88(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute88(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute88; DROP PROCEDURE sp88; DROP PROCEDURE IF EXISTS sp89; @@ -21308,7 +21308,7 @@ CALL sp89(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute89(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute89; DROP PROCEDURE sp89; DROP PROCEDURE IF EXISTS sp90; @@ -21339,7 +21339,7 @@ CALL sp90(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute90(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute90; DROP PROCEDURE sp90; DROP PROCEDURE IF EXISTS sp91; @@ -21370,7 +21370,7 @@ CALL sp91(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute91(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute91; DROP PROCEDURE sp91; DROP PROCEDURE IF EXISTS sp92; @@ -21401,7 +21401,7 @@ CALL sp92(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, - SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute92(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute92; DROP PROCEDURE sp92; DROP PROCEDURE IF EXISTS sp93; @@ -21432,7 +21432,7 @@ CALL sp93(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute93(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute93; DROP PROCEDURE sp93; DROP PROCEDURE IF EXISTS sp94; @@ -21463,7 +21463,7 @@ CALL sp94(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute94(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute94; DROP PROCEDURE sp94; DROP PROCEDURE IF EXISTS sp95; @@ -21494,7 +21494,7 @@ CALL sp95(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute95(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute95; DROP PROCEDURE sp95; DROP PROCEDURE IF EXISTS sp96; @@ -21525,7 +21525,7 @@ CALL sp96(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute96(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute96; DROP PROCEDURE sp96; DROP PROCEDURE IF EXISTS sp97; @@ -21556,7 +21556,7 @@ CALL sp97(-32601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute97(); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE spexecute97; DROP PROCEDURE sp97; DROP PROCEDURE IF EXISTS sp98; @@ -21587,7 +21587,7 @@ CALL sp98(-115, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute98(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute98; DROP PROCEDURE sp98; DROP PROCEDURE IF EXISTS sp99; @@ -21618,7 +21618,7 @@ CALL sp99(251, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute99(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute99; DROP PROCEDURE sp99; DROP PROCEDURE IF EXISTS sp100; @@ -21649,7 +21649,7 @@ CALL sp100(201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute100(); -ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)' +ERROR 22003: BIGINT value is out of range in 'f5@4 * 2' DROP PROCEDURE spexecute100; DROP PROCEDURE sp100; DROP PROCEDURE IF EXISTS sp101; @@ -21680,7 +21680,7 @@ CALL sp101(-101, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22 SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute101(); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' +ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10' DROP PROCEDURE spexecute101; DROP PROCEDURE sp101; USE db_storedproc; diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index 6586393a236..ff7100817f5 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -486,7 +486,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, `b` char(1) DEFAULT NULL, - `c` char(2) GENERATED ALWAYS AS (((`a` <> 0) or (`b` <> 0))) VIRTUAL + `c` char(2) GENERATED ALWAYS AS (`a` <> 0 or `b` <> 0) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (a,b) VALUES('1','1'); SELECT * FROM t1; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index 9cce19f49b0..37be09b221f 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -94,7 +94,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -114,7 +114,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -136,7 +136,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -191,7 +191,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -216,7 +216,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -229,7 +229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((5 * 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (5 * 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -294,7 +294,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -307,7 +307,7 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index a8cd61b413b..f6d0830ee3d 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -94,7 +94,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -114,7 +114,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -136,7 +136,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -158,7 +158,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a % 2) virtual); @@ -168,7 +168,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table t2; @@ -191,7 +191,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -203,7 +203,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -216,7 +216,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -229,7 +229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((5 * 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (5 * 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -294,7 +294,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -307,7 +307,7 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL, `c` varchar(12) GENERATED ALWAYS AS ('aaaabb') STORED, `d` blob GENERATED ALWAYS AS (`c`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index 12918988a5f..80605b8b0b2 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -11,7 +11,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -46,7 +46,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -59,7 +59,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index cd29d7d02ef..a331b1d2154 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -11,7 +11,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -37,7 +37,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) VIRTUAL, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -50,7 +50,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -75,7 +75,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) VIRTUAL, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) VIRTUAL, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -103,7 +103,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result index b6b18b7df70..d0a00b6221e 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_innodb.result @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -101,7 +101,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE diff --git a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result index cf5037461d8..1ed96d0345b 100644 --- a/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_non_stored_columns_myisam.result @@ -90,7 +90,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -101,7 +101,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result index d7b2de3ac8a..d4812d8880c 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` / 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` - 1) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(pi() * `a` * `a`,6)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` * 3) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-`a`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` like 'H%o') VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` regexp 'H.+o')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (soundex(`a`) = soundex(`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS (case `a` when NULL then 'asd' when 'b' then 'B' else `a` end) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if(`a` = 1,`a`,`b`)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` > 0 and `a` < 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` between 0 and 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` & 5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~`a`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` | 5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` ^ 5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` DIV 5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <=> `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` = `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` >= `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` > `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is not null) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is null) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` << 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <= `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` < `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not between 0 and 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` > 5 or `a` < 3) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` >> 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` xor 5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (to_days(`a`) - to_days('2000-01-01')) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (`a` + interval 1 minute) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result index 6ec1c256eec..92eb889c6dc 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` / 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` - 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(pi() * `a` * `a`,6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` * 3) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` like 'H%o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (soundex(`a`) = soundex(`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1497,7 +1497,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS (case `a` when NULL then 'asd' when 'b' then 'B' else `a` end) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1517,7 +1517,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if(`a` = 1,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1572,7 +1572,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` > 0 and `a` < 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1589,7 +1589,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1623,7 +1623,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` & 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1640,7 +1640,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1657,7 +1657,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` | 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1676,7 +1676,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` ^ 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1695,7 +1695,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` DIV 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1713,7 +1713,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <=> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1733,7 +1733,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` = `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1751,7 +1751,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` >= `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1769,7 +1769,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` > `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1786,7 +1786,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is not null) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1803,7 +1803,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is null) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1820,7 +1820,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` << 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1838,7 +1838,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <= `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1858,7 +1858,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` < `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1877,7 +1877,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1895,7 +1895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1915,7 +1915,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1934,7 +1934,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` > 5 or `a` < 3) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1951,7 +1951,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` >> 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1968,7 +1968,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` xor 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` bigint(20) GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (to_days(`a`) - to_days('2000-01-01')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2462,7 +2462,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2568,7 +2568,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (`a` + interval 1 minute) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result index a79524691c2..9b55af7af0e 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result @@ -546,9 +546,9 @@ t1 CREATE TABLE `t1` ( `col2` int(11) NOT NULL, `col3` int(11) NOT NULL, `col4` int(11) DEFAULT NULL, - `col5` int(11) GENERATED ALWAYS AS ((`col2` % `col3`)) VIRTUAL, - `col7` int(11) GENERATED ALWAYS AS ((`col5` * `col5`)) VIRTUAL, - `col8` int(11) GENERATED ALWAYS AS ((`col5` % `col5`)) VIRTUAL, + `col5` int(11) GENERATED ALWAYS AS (`col2` % `col3`) VIRTUAL, + `col7` int(11) GENERATED ALWAYS AS (`col5` * `col5`) VIRTUAL, + `col8` int(11) GENERATED ALWAYS AS (`col5` % `col5`) VIRTUAL, `col9` text DEFAULT NULL, `col6` int(11) DEFAULT NULL, UNIQUE KEY `uidx` (`col5`) @@ -968,11 +968,11 @@ SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( `col_int_nokey` int(11) DEFAULT NULL, - `col_int` int(11) GENERATED ALWAYS AS ((`col_int_nokey` + `col_int_nokey`)) STORED, - `col_int_key` int(11) GENERATED ALWAYS AS ((`col_int` + `col_int_nokey`)) VIRTUAL, + `col_int` int(11) GENERATED ALWAYS AS (`col_int_nokey` + `col_int_nokey`) STORED, + `col_int_key` int(11) GENERATED ALWAYS AS (`col_int` + `col_int_nokey`) VIRTUAL, `col_date_nokey` date DEFAULT NULL, - `col_date` date GENERATED ALWAYS AS ((`col_date_nokey` + interval 30 day)) STORED, - `col_date_key` date GENERATED ALWAYS AS ((`col_date` + interval 30 day)) VIRTUAL, + `col_date` date GENERATED ALWAYS AS (`col_date_nokey` + interval 30 day) STORED, + `col_date_key` date GENERATED ALWAYS AS (`col_date` + interval 30 day) VIRTUAL, `col_datetime_nokey` datetime DEFAULT NULL, `col_time_nokey` time DEFAULT NULL, `col_datetime` datetime GENERATED ALWAYS AS (addtime(`col_datetime_nokey`,`col_time_nokey`)) STORED, @@ -1058,10 +1058,10 @@ ALTER TABLE t1 CHANGE d d INT GENERATED ALWAYS AS(a+b) FIRST; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `d` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `d` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `h` varchar(10) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1366,7 +1366,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `d` int(11) GENERATED ALWAYS AS (((`a` + `b`) + `b`)) VIRTUAL, + `d` int(11) GENERATED ALWAYS AS (`a` + `b` + `b`) VIRTUAL, `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx` (`d`), @@ -1384,7 +1384,7 @@ t CREATE TABLE `t` ( `b` int(11) DEFAULT NULL, `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, KEY `idx2` (`e`), KEY `idx` (`e`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -1396,7 +1396,7 @@ t CREATE TABLE `t` ( `b` int(11) DEFAULT NULL, `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, KEY `idx2` (`e`), KEY `idx4` (`c`,`e`) @@ -1411,7 +1411,7 @@ t CREATE TABLE `t` ( `b` int(11) DEFAULT NULL, `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, `j` int(11) DEFAULT NULL, KEY `idx2` (`e`), @@ -1428,10 +1428,10 @@ t CREATE TABLE `t` ( `b` int(11) DEFAULT NULL, `e` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL, `h` varchar(10) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `x` varchar(10) GENERATED ALWAYS AS (`h`) VIRTUAL, `j` int(11) DEFAULT NULL, - `i` int(11) GENERATED ALWAYS AS (((`a` + `a`) + `b`)) VIRTUAL, + `i` int(11) GENERATED ALWAYS AS (`a` + `a` + `b`) VIRTUAL, KEY `idx2` (`e`), KEY `idx4` (`c`,`e`), KEY `x` (`x`), diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result index 75b31324e6b..a80ec95a2ca 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result @@ -43,7 +43,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -112,7 +112,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, `h` varchar(10) DEFAULT NULL, KEY `idx_1` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result index eba83694c16..e09d52d6dd1 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -89,7 +89,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1; @@ -128,7 +128,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` + `b`)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL, KEY `idx` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1; diff --git a/mysql-test/suite/gcol/r/rpl_gcol.result b/mysql-test/suite/gcol/r/rpl_gcol.result index de1fe9029da..a7950b75bd0 100644 --- a/mysql-test/suite/gcol/r/rpl_gcol.result +++ b/mysql-test/suite/gcol/r/rpl_gcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index 1a0225b344b..6fbb7dcc58f 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -30,7 +30,7 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -136,14 +136,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -193,14 +193,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`), KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`) @@ -270,14 +270,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) diff --git a/mysql-test/suite/innodb_fts/r/fulltext_misc.result b/mysql-test/suite/innodb_fts/r/fulltext_misc.result index ce7fe46f4e1..6a24d9aea58 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext_misc.result +++ b/mysql-test/suite/innodb_fts/r/fulltext_misc.result @@ -148,7 +148,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 UNION t1 ALL NULL NULL NULL NULL 2 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (`a` + 12) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `a` + 12 # Should not crash SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY a + 12; a @@ -181,7 +181,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #-1 -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <`a`>((select `a` from `test`.`t2` where (`test`.`t2`.`b` = 12))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by <`a`>((select `a` from `test`.`t2` where `test`.`t2`.`b` = 12)) # Should not crash SELECT * FROM t1 UNION SELECT * FROM t1 ORDER BY (SELECT a FROM t2 WHERE b = 12); diff --git a/mysql-test/suite/innodb_gis/r/create_spatial_index.result b/mysql-test/suite/innodb_gis/r/create_spatial_index.result index a44a19a5d5c..1d47fd9688c 100644 --- a/mysql-test/suite/innodb_gis/r/create_spatial_index.result +++ b/mysql-test/suite/innodb_gis/r/create_spatial_index.result @@ -1244,7 +1244,7 @@ Table Create Table tab CREATE TABLE `tab` ( `c1` point NOT NULL, SPATIAL KEY `idx1` (`c1`), - CONSTRAINT `tab_const` CHECK (c1 > 0) + CONSTRAINT `tab_const` CHECK (`c1` > 0) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SHOW INDEX FROM tab; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result index e3b2d6ac758..8346171ba3f 100644 --- a/mysql-test/suite/roles/definer.result +++ b/mysql-test/suite/roles/definer.result @@ -20,18 +20,18 @@ set role role1; create definer=current_role view test.v1 as select a+b,c from t1; show create view test.v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`role1` SQL SECURITY DEFINER VIEW `test`.`v1` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`role1` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci set role none; create definer=role2 view test.v2 as select a+b,c,current_role() from t1; show create view test.v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `test`.`v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` latin1 latin1_swedish_ci create definer=role3 view test.v3 as select a+b,c from t1; Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist show create view test.v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`role3`@`%` SQL SECURITY DEFINER VIEW `test`.`v3` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`role3`@`%` SQL SECURITY DEFINER VIEW `test`.`v3` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist connect c1, localhost, foo,,mysqltest1; @@ -77,7 +77,7 @@ connection default; drop role role4; show create view test.v5; View Create View character_set_client collation_connection -v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4` SQL SECURITY DEFINER VIEW `test`.`v5` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4` SQL SECURITY DEFINER VIEW `test`.`v5` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci Warnings: Note 1449 The user specified as a definer ('role4'@'') does not exist select * from test.v5; @@ -86,7 +86,7 @@ create user role4; grant select on mysqltest1.t1 to role4; show create view test.v5; View Create View character_set_client collation_connection -v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4` SQL SECURITY DEFINER VIEW `test`.`v5` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4` SQL SECURITY DEFINER VIEW `test`.`v5` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci Warnings: Note 1449 The user specified as a definer ('role4'@'') does not exist select * from test.v5; @@ -94,7 +94,7 @@ ERROR HY000: The user specified as a definer ('role4'@'') does not exist flush tables; show create view test.v5; View Create View character_set_client collation_connection -v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4`@`%` SQL SECURITY DEFINER VIEW `test`.`v5` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`role4`@`%` SQL SECURITY DEFINER VIEW `test`.`v5` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci select * from test.v5; a+b c 11 100 @@ -543,7 +543,7 @@ USE `test`; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role1` SQL SECURITY DEFINER VIEW `v1` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role1` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -554,7 +554,7 @@ USE `test`; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` */; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `v2` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -567,7 +567,7 @@ USE `test`; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`role3`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `v3` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; +/*!50001 VIEW `v3` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -580,7 +580,7 @@ USE `test`; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`foo`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `v4` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; +/*!50001 VIEW `v4` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -593,7 +593,7 @@ USE `test`; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`role4`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `v5` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; +/*!50001 VIEW `v5` AS select `mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b` AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; diff --git a/mysql-test/suite/rpl/r/rpl_default.result b/mysql-test/suite/rpl/r/rpl_default.result index 3195046a42d..32e93a976ac 100644 --- a/mysql-test/suite/rpl/r/rpl_default.result +++ b/mysql-test/suite/rpl/r/rpl_default.result @@ -8,7 +8,7 @@ connection slave; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT ((1 + 1)), + `a` int(11) DEFAULT (1 + 1), `b` bigint(20) DEFAULT uuid_short(), `u` blob DEFAULT user() ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 1f140c3e2a5..35ba59730be 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -791,7 +791,7 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1; CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 @@ -799,7 +799,7 @@ connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 @@ -807,7 +807,7 @@ connection master; ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 @@ -815,7 +815,7 @@ connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 diff --git a/mysql-test/suite/rpl/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result index b6d9691f1d5..68a149720b0 100644 --- a/mysql-test/suite/rpl/r/rpl_view.result +++ b/mysql-test/suite/rpl/r/rpl_view.result @@ -125,11 +125,11 @@ CREATE TABLE t1 (a INT); /*!50002 WITH CASCADED CHECK OPTION */; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci connection slave; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci connection master; DROP VIEW v1; DROP TABLE t1; diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result index 602e588ff19..d980c26dfb1 100644 --- a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result +++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result @@ -9,7 +9,7 @@ alter table t1 auto_increment = 3; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` int(11) GENERATED ALWAYS AS ((1 + 1)) VIRTUAL, + `c2` int(11) GENERATED ALWAYS AS (1 + 1) VIRTUAL, `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index f06711d053b..b3f764da22c 100644 --- a/mysql-test/suite/vcol/r/rpl_vcol.result +++ b/mysql-test/suite/vcol/r/rpl_vcol.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (2,default); diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result index 3c914c7da58..8bfb8f0429c 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result @@ -54,7 +54,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -67,7 +67,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -87,7 +87,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -109,7 +109,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result index fbec411b486..96eb2bdc02f 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result @@ -54,7 +54,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -67,7 +67,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -87,7 +87,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL COMMENT 'my comment' + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL COMMENT 'my comment' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t2; Field Type Null Key Default Extra @@ -109,7 +109,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; Field Type Null Key Default Extra @@ -131,7 +131,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a % 2)); @@ -141,6 +141,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index feab116e1b2..43c911118c2 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -13,7 +13,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -28,7 +28,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -57,7 +57,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; @@ -70,7 +70,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `a` (`a`,`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index ddc4954f272..efca19db5bb 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -129,7 +129,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -144,7 +144,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -173,7 +173,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; @@ -186,7 +186,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` * 2)) STORED, + `b` int(11) GENERATED ALWAYS AS (`a` * 2) STORED, KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 describe t1; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 9c84f21801b..a917159249b 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -155,7 +155,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` char(2) NOT NULL, - `c` enum('Y','N') GENERATED ALWAYS AS ((case when (`b` = 'aa') then 'Y' else 'N' end)) STORED + `c` enum('Y','N') GENERATED ALWAYS AS (case when `b` = 'aa' then 'Y' else 'N' end) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1(a,b) values (1,'bb'), (2,'aa'), (3,'cc'); select * from t1; @@ -173,7 +173,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` set('y','n') GENERATED ALWAYS AS (if((`a` = 0),if((`b` = 0),'n,n','n,y'),if((`b` = 0),'y,n','y,y'))) STORED + `c` set('y','n') GENERATED ALWAYS AS (if(`a` = 0,if(`b` = 0,'n,n','n,y'),if(`b` = 0,'y,n','y,y'))) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t2(a,b) values (7,0), (2,3), (0,1); select * from t2; @@ -227,7 +227,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) GENERATED ALWAYS AS ((`a` > '2')) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (`a` > '2') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -244,7 +244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) DEFAULT NULL, - `b` bigint(20) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL + `b` bigint(20) GENERATED ALWAYS AS (`a` between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -261,7 +261,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL, - `b` char(10) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL + `b` char(10) GENERATED ALWAYS AS (`a` between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 (a) values (1),(3); select * from t1; @@ -284,7 +284,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(32) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL, + `c` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL, `d` varchar(5) GENERATED ALWAYS AS (left(`b`,5)) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result index feeec8c1e27..f4cbb5bd662 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -92,7 +92,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result index ad04084fbfa..87bd1bcf530 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result @@ -81,7 +81,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` % 2) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 8. ALTER. Modify virtual non-stored -> virtual stored @@ -92,7 +92,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; # Case 9. CREATE LIKE diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index b69302aa0f3..4dee9f4fca6 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -282,7 +282,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`b` = `test`.`t2`.`b`) +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`b` = `test`.`t2`.`b` SELECT * FROM t1 JOIN t2 USING (b); b a EXPLAIN EXTENDED @@ -291,7 +291,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`b` = `test`.`t2`.`b`) +Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`b` = `test`.`t2`.`b` SELECT * FROM t1 NATURAL JOIN t2; b a DROP TABLE t1,t2; diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index 0c7a63c560f..a41e3abd975 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` / 2)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` / 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` - 1)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` - 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` % 10)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` % 10) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (format(((pi() * `a`) * `a`),6)) VIRTUAL + `b` double GENERATED ALWAYS AS (format(pi() * `a` * `a`,6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS ((`a` * 3)) VIRTUAL + `b` double GENERATED ALWAYS AS (`a` * 3) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double GENERATED ALWAYS AS (-(`a`)) VIRTUAL + `b` double GENERATED ALWAYS AS (-`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` like 'H%!o' escape '!')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` like 'H%!o' escape '!') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` like 'H%o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((not((`a` regexp 'H.+o')))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (!(`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` regexp 'H.+o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` regexp 'H.+o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((soundex(`a`) = soundex(`b`))) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (soundex(`a`) = soundex(`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1482,7 +1482,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) GENERATED ALWAYS AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL + `b` varchar(16) GENERATED ALWAYS AS (case `a` when NULL then 'asd' when 'b' then 'B' else `a` end) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1502,7 +1502,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) GENERATED ALWAYS AS (if((`a` = 1),`a`,`b`)) VIRTUAL + `c` int(11) GENERATED ALWAYS AS (if(`a` = 1,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1557,7 +1557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (((`a` > 0) and (`a` < 2))) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` > 0 and `a` < 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1574,7 +1574,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1608,7 +1608,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` & 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` & 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1625,7 +1625,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (~(`a`)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (~`a`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1642,7 +1642,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` | 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` | 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1661,7 +1661,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` ^ 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` ^ 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1680,7 +1680,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` DIV 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` DIV 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1698,7 +1698,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <=> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <=> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1718,7 +1718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` = `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` = `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1736,7 +1736,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` >= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` >= `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1754,7 +1754,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` > `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` > `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1771,7 +1771,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` is not null)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is not null) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1788,7 +1788,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (isnull(`a`)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` is null) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1805,7 +1805,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` << 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` << 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1823,7 +1823,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <= `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <= `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1843,7 +1843,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` < `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` < `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1862,7 +1862,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS ((`a` not between 0 and 2)) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not between 0 and 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1880,7 +1880,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1900,7 +1900,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) GENERATED ALWAYS AS ((`a` <> `b`)) VIRTUAL + `c` tinyint(1) GENERATED ALWAYS AS (`a` <> `b`) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1919,7 +1919,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS (((`a` > 5) or (`a` < 3))) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` > 5 or `a` < 3) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1936,7 +1936,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` >> 2)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` >> 2) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1953,7 +1953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` xor 5)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` xor 5) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1975,7 +1975,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` + interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` + interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext GENERATED ALWAYS AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL + `b` mediumtext GENERATED ALWAYS AS (to_days(`a`) - to_days('2000-01-01')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2388,7 +2388,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime GENERATED ALWAYS AS ((`a` - interval 1 month)) VIRTUAL + `b` datetime GENERATED ALWAYS AS (`a` - interval 1 month) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2479,7 +2479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp GENERATED ALWAYS AS ((`a` + interval 1 minute)) VIRTUAL + `b` timestamp GENERATED ALWAYS AS (`a` + interval 1 minute) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 35920b1d7a9..16e30e57230 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -5,7 +5,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int as (a+1) virtual); @@ -13,7 +13,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL + `b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int, b int generated always as (a+1) persistent); @@ -21,7 +21,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) GENERATED ALWAYS AS ((`a` + 1)) STORED + `b` int(11) GENERATED ALWAYS AS (`a` + 1) STORED ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set session sql_mode='ORACLE'; @@ -30,7 +30,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) GENERATED ALWAYS AS (("a" + 1)) VIRTUAL + "b" int(11) GENERATED ALWAYS AS ("a" + 1) VIRTUAL ) drop table t1; create table t1 (a int, b int generated always as (a+1) virtual); @@ -38,7 +38,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) GENERATED ALWAYS AS (("a" + 1)) VIRTUAL + "b" int(11) GENERATED ALWAYS AS ("a" + 1) VIRTUAL ) drop table t1; create table t1 (a int, b int as (a+1) persistent); @@ -46,7 +46,7 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL, - "b" int(11) GENERATED ALWAYS AS (("a" + 1)) STORED + "b" int(11) GENERATED ALWAYS AS ("a" + 1) STORED ) drop table t1; set session sql_mode=@OLD_SQL_MODE; diff --git a/mysql-test/suite/vcol/r/vcol_view_innodb.result b/mysql-test/suite/vcol/r/vcol_view_innodb.result index 447e2fd89b6..091cdc02fb3 100644 --- a/mysql-test/suite/vcol/r/vcol_view_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_view_innodb.result @@ -48,7 +48,7 @@ explain extended select * from v3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select (abs(`test`.`t1`.`b`) * 2) AS `d`,(abs(`test`.`t1`.`c`) * 2) AS `e` from `test`.`t1` +Note 1003 select abs(`test`.`t1`.`b`) * 2 AS `d`,abs(`test`.`t1`.`c`) * 2 AS `e` from `test`.`t1` drop view v1,v2,v3; drop table t1; create table t1 (a int not null, diff --git a/mysql-test/suite/vcol/r/vcol_view_myisam.result b/mysql-test/suite/vcol/r/vcol_view_myisam.result index 1b665e91a0f..8ad1853faa4 100644 --- a/mysql-test/suite/vcol/r/vcol_view_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_view_myisam.result @@ -48,7 +48,7 @@ explain extended select * from v3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select (abs(`test`.`t1`.`b`) * 2) AS `d`,(abs(`test`.`t1`.`c`) * 2) AS `e` from `test`.`t1` +Note 1003 select abs(`test`.`t1`.`b`) * 2 AS `d`,abs(`test`.`t1`.`c`) * 2 AS `e` from `test`.`t1` drop view v1,v2,v3; drop table t1; create table t1 (a int not null, diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test index 5f27978347c..f1805f2ccda 100644 --- a/mysql-test/t/func_date_add.test +++ b/mysql-test/t/func_date_add.test @@ -100,3 +100,32 @@ drop table t1; --echo End of 5.5 tests +# +# how + interval is printed +# + +create or replace view v1 as select 3 & 20010101 + interval 2 day as x; +show create view v1; +select 3 & 20010101 + interval 2 day, x from v1; + +create or replace view v1 as select (3 & 20010101) + interval 2 day as x; +show create view v1; +select (3 & 20010101) + interval 2 day, x from v1; + +create or replace view v1 as select 3 & (20010101 + interval 2 day) as x; +show create view v1; +select 3 & (20010101 + interval 2 day), x from v1; + +create or replace view v1 as select 30 + 20010101 + interval 2 day as x; +show create view v1; +select 30 + 20010101 + interval 2 day, x from v1; + +create or replace view v1 as select (30 + 20010101) + interval 2 day as x; +show create view v1; +select (30 + 20010101) + interval 2 day, x from v1; + +create or replace view v1 as select 30 + (20010101 + interval 2 day) as x; +show create view v1; +select 30 + (20010101 + interval 2 day), x from v1; + +--echo End of 10.2 tests diff --git a/sql/item.cc b/sql/item.cc index 9d244954b85..880275ec997 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -569,6 +569,24 @@ uint Item::temporal_precision(enum_field_types type_arg) } +void Item::print_parenthesised(String *str, enum_query_type query_type, + enum precedence parent_prec) +{ + bool need_parens= precedence() < parent_prec; + if (need_parens) + str->append('('); + print(str, query_type); + if (need_parens) + str->append(')'); +} + + +void Item::print(String *str, enum_query_type query_type) +{ + str->append(full_name()); +} + + void Item::print_item_w_name(String *str, enum_query_type query_type) { print(str, query_type); @@ -10462,9 +10480,11 @@ void Item::register_in(THD *thd) void Virtual_column_info::print(String *str) { - expr->print(str, (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF | + expr->print_parenthesised(str, + (enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF | QT_ITEM_IDENT_SKIP_DB_NAMES | QT_ITEM_IDENT_SKIP_TABLE_NAMES | QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | - QT_TO_SYSTEM_CHARSET)); + QT_TO_SYSTEM_CHARSET), + LOWEST_PRECEDENCE); } diff --git a/sql/item.h b/sql/item.h index 313cec8173d..ac8f79116eb 100644 --- a/sql/item.h +++ b/sql/item.h @@ -69,6 +69,30 @@ struct SARGABLE_PARAM; class RANGE_OPT_PARAM; class SEL_TREE; +enum precedence { + LOWEST_PRECEDENCE, + ASSIGN_PRECEDENCE, // := + OR_PRECEDENCE, // OR, || (unless PIPES_AS_CONCAT) + XOR_PRECEDENCE, // XOR + AND_PRECEDENCE, // AND, && + NOT_PRECEDENCE, // NOT (unless HIGH_NOT_PRECEDENCE) + BETWEEN_PRECEDENCE, // BETWEEN, CASE, WHEN, THEN, ELSE + CMP_PRECEDENCE, // =, <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN + BITOR_PRECEDENCE, // | + BITAND_PRECEDENCE, // & + SHIFT_PRECEDENCE, // <<, >> + ADDINTERVAL_PRECEDENCE, // first argument in +INTERVAL + ADD_PRECEDENCE, // +, - + MUL_PRECEDENCE, // *, /, DIV, %, MOD + BITXOR_PRECEDENCE, // ^ + PIPES_PRECEDENCE, // || (if PIPES_AS_CONCAT) + NEG_PRECEDENCE, // unary -, ~ + BANG_PRECEDENCE, // !, NOT (if HIGH_NOT_PRECEDENCE) + COLLATE_PRECEDENCE, // BINARY, COLLATE + INTERVAL_PRECEDENCE, // INTERVAL + DEFAULT_PRECEDENCE, + HIGHEST_PRECEDENCE +}; typedef Bounds_checked_array Ref_ptr_array; @@ -1263,13 +1287,13 @@ public: query and why they should be generated from the Item-tree, @see mysql_register_view(). */ - virtual inline void print(String *str, enum_query_type query_type) - { - str->append(full_name()); - } + virtual enum precedence precedence() const { return DEFAULT_PRECEDENCE; } + void print_parenthesised(String *str, enum_query_type query_type, + enum precedence parent_prec); + virtual void print(String *str, enum_query_type query_type); + void print_item_w_name(String *str, enum_query_type query_type); + void print_value(String *str); - void print_item_w_name(String *, enum_query_type query_type); - void print_value(String *); virtual void update_used_tables() {} virtual COND *build_equal_items(THD *thd, COND_EQUAL *inheited, bool link_item_fields, diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f860ca4f06a..ebc71fd2518 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -286,20 +286,10 @@ longlong Item_func_not::val_int() return ((!null_value && value == 0) ? 1 : 0); } -/* - We put any NOT expression into parenthesis to avoid - possible problems with internal view representations where - any '!' is converted to NOT. It may cause a problem if - '!' is used in an expression together with other operators - whose precedence is lower than the precedence of '!' yet - higher than the precedence of NOT. -*/ - void Item_func_not::print(String *str, enum_query_type query_type) { - str->append('('); - Item_func::print(str, query_type); - str->append(')'); + str->append('!'); + args[0]->print_parenthesised(str, query_type, precedence()); } /** @@ -1167,8 +1157,7 @@ void Item_func_truth::fix_length_and_dec() void Item_func_truth::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" is ")); if (! affirmative) str->append(STRING_WITH_LEN("not ")); @@ -1176,7 +1165,6 @@ void Item_func_truth::print(String *str, enum_query_type query_type) str->append(STRING_WITH_LEN("true")); else str->append(STRING_WITH_LEN("false")); - str->append(')'); } @@ -2240,15 +2228,13 @@ longlong Item_func_between::val_int() void Item_func_between::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, precedence()); if (negated) str->append(STRING_WITH_LEN(" not")); str->append(STRING_WITH_LEN(" between ")); - args[1]->print(str, query_type); + args[1]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" and ")); - args[2]->print(str, query_type); - str->append(')'); + args[2]->print_parenthesised(str, query_type, precedence()); } @@ -3301,27 +3287,27 @@ uint Item_func_case::decimal_precision() const void Item_func_case::print(String *str, enum_query_type query_type) { - str->append(STRING_WITH_LEN("(case ")); + str->append(STRING_WITH_LEN("case ")); if (first_expr_num != -1) { - args[first_expr_num]->print(str, query_type); + args[first_expr_num]->print_parenthesised(str, query_type, precedence()); str->append(' '); } for (uint i=0 ; i < ncases ; i+=2) { str->append(STRING_WITH_LEN("when ")); - args[i]->print(str, query_type); + args[i]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" then ")); - args[i+1]->print(str, query_type); + args[i+1]->print_parenthesised(str, query_type, precedence()); str->append(' '); } if (else_expr_num != -1) { str->append(STRING_WITH_LEN("else ")); - args[else_expr_num]->print(str, query_type); + args[else_expr_num]->print_parenthesised(str, query_type, precedence()); str->append(' '); } - str->append(STRING_WITH_LEN("end)")); + str->append(STRING_WITH_LEN("end")); } @@ -4299,13 +4285,12 @@ void Item_func_in::fix_length_and_dec() void Item_func_in::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, precedence()); if (negated) str->append(STRING_WITH_LEN(" not")); str->append(STRING_WITH_LEN(" in (")); print_args(str, 1, query_type); - str->append(STRING_WITH_LEN("))")); + str->append(STRING_WITH_LEN(")")); } @@ -4823,19 +4808,17 @@ Item_cond::used_tables() const void Item_cond::print(String *str, enum_query_type query_type) { - str->append('('); List_iterator_fast li(list); Item *item; if ((item=li++)) - item->print(str, query_type); + item->print_parenthesised(str, query_type, precedence()); while ((item=li++)) { str->append(' '); str->append(func_name()); str->append(' '); - item->print(str, query_type); + item->print_parenthesised(str, query_type, precedence()); } - str->append(')'); } @@ -5027,6 +5010,13 @@ longlong Item_func_isnull::val_int() } +void Item_func_isnull::print(String *str, enum_query_type query_type) +{ + args[0]->print_parenthesised(str, query_type, precedence()); + str->append(STRING_WITH_LEN(" is null")); +} + + longlong Item_is_not_null_test::val_int() { DBUG_ASSERT(fixed == 1); @@ -5064,9 +5054,8 @@ longlong Item_func_isnotnull::val_int() void Item_func_isnotnull::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); - str->append(STRING_WITH_LEN(" is not null)")); + args[0]->print_parenthesised(str, query_type, precedence()); + str->append(STRING_WITH_LEN(" is not null")); } @@ -5078,18 +5067,16 @@ bool Item_bool_func2::count_sargable_conds(void *arg) void Item_func_like::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, precedence()); str->append(' '); str->append(func_name()); str->append(' '); - args[1]->print(str, query_type); + args[1]->print_parenthesised(str, query_type, precedence()); if (escape_used_in_parsing) { str->append(STRING_WITH_LEN(" escape ")); escape_item->print(str, query_type); } - str->append(')'); } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 8a0799b0f16..99135c06df3 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -215,6 +215,7 @@ public: virtual longlong val_int(); virtual void fix_length_and_dec(); virtual void print(String *str, enum_query_type query_type); + enum precedence precedence() const { return CMP_PRECEDENCE; } protected: Item_func_truth(THD *thd, Item *a, bool a_value, bool a_affirmative): @@ -480,6 +481,7 @@ public: { Item_func::print_op(str, query_type); } + enum precedence precedence() const { return CMP_PRECEDENCE; } Item *neg_transformer(THD *thd); virtual Item *negated_item(THD *thd); Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) @@ -535,6 +537,7 @@ public: Item_func_xor(THD *thd, Item *i1, Item *i2): Item_bool_func(thd, i1, i2) {} enum Functype functype() const { return XOR_FUNC; } const char *func_name() const { return "xor"; } + enum precedence precedence() const { return XOR_PRECEDENCE; } void print(String *str, enum_query_type query_type) { Item_func::print_op(str, query_type); } longlong val_int(); @@ -559,6 +562,7 @@ public: longlong val_int(); enum Functype functype() const { return NOT_FUNC; } const char *func_name() const { return "not"; } + enum precedence precedence() const { return BANG_PRECEDENCE; } Item *neg_transformer(THD *thd); bool fix_fields(THD *, Item **); virtual void print(String *str, enum_query_type query_type); @@ -866,6 +870,7 @@ public: longlong val_int(); enum Functype functype() const { return BETWEEN; } const char *func_name() const { return "between"; } + enum precedence precedence() const { return BETWEEN_PRECEDENCE; } void fix_length_and_dec(); virtual void print(String *str, enum_query_type query_type); bool eval_not_null_tables(void *opt_arg); @@ -1550,6 +1555,7 @@ public: uint decimal_precision() const; table_map not_null_tables() const { return 0; } const char *func_name() const { return "case"; } + enum precedence precedence() const { return BETWEEN_PRECEDENCE; } virtual void print(String *str, enum_query_type query_type); Item *find_item(String *str); CHARSET_INFO *compare_collation() const { return cmp_collation.collation; } @@ -1661,7 +1667,8 @@ public: } virtual void print(String *str, enum_query_type query_type); enum Functype functype() const { return IN_FUNC; } - const char *func_name() const { return " IN "; } + const char *func_name() const { return "in"; } + enum precedence precedence() const { return CMP_PRECEDENCE; } bool eval_not_null_tables(void *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); bool count_sargable_conds(void *arg); @@ -1752,6 +1759,8 @@ public: update_used_tables(); } const char *func_name() const { return "isnull"; } + void print(String *str, enum_query_type query_type); + enum precedence precedence() const { return CMP_PRECEDENCE; } /* Optimize case of not_null_column IS NULL */ virtual void update_used_tables() { @@ -1813,10 +1822,11 @@ public: longlong val_int(); enum Functype functype() const { return ISNOTNULL_FUNC; } const char *func_name() const { return "isnotnull"; } + enum precedence precedence() const { return CMP_PRECEDENCE; } table_map not_null_tables() const { return abort_on_null ? not_null_tables_cache : 0; } Item *neg_transformer(THD *thd); - virtual void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type); void top_level_item() { abort_on_null=1; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } @@ -1947,6 +1957,7 @@ public: return this; } const char *func_name() const { return "like"; } + enum precedence precedence() const { return CMP_PRECEDENCE; } bool fix_fields(THD *thd, Item **ref); void fix_length_and_dec() { @@ -2064,10 +2075,11 @@ public: longlong val_int(); void fix_length_and_dec(); const char *func_name() const { return "regexp"; } + enum precedence precedence() const { return CMP_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } - virtual inline void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) { print_op(str, query_type); } @@ -2478,6 +2490,7 @@ public: enum Functype functype() const { return COND_AND_FUNC; } longlong val_int(); const char *func_name() const { return "and"; } + enum precedence precedence() const { return AND_PRECEDENCE; } table_map not_null_tables() const { return abort_on_null ? not_null_tables_cache: and_tables_cache; } Item *copy_andor_structure(THD *thd); @@ -2513,6 +2526,7 @@ public: enum Functype functype() const { return COND_OR_FUNC; } longlong val_int(); const char *func_name() const { return "or"; } + enum precedence precedence() const { return OR_PRECEDENCE; } table_map not_null_tables() const { return and_tables_cache; } Item *copy_andor_structure(THD *thd); Item *neg_transformer(THD *thd); diff --git a/sql/item_func.cc b/sql/item_func.cc index 64e4db80aa9..9bafe25e431 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -471,16 +471,14 @@ void Item_func::print_args(String *str, uint from, enum_query_type query_type) void Item_func::print_op(String *str, enum_query_type query_type) { - str->append('('); for (uint i=0 ; i < arg_count-1 ; i++) { - args[i]->print(str, query_type); + args[i]->print_parenthesised(str, query_type, precedence()); str->append(' '); str->append(func_name()); str->append(' '); } - args[arg_count-1]->print(str, query_type); - str->append(')'); + args[arg_count-1]->print_parenthesised(str, query_type, precedence()); } @@ -5245,11 +5243,10 @@ bool Item_func_set_user_var::is_null_result() void Item_func_set_user_var::print(String *str, enum_query_type query_type) { - str->append(STRING_WITH_LEN("(@")); + str->append(STRING_WITH_LEN("@")); str->append(name.str, name.length); str->append(STRING_WITH_LEN(":=")); - args[0]->print(str, query_type); - str->append(')'); + args[0]->print_parenthesised(str, query_type, precedence()); } @@ -5259,8 +5256,7 @@ void Item_func_set_user_var::print_as_stmt(String *str, str->append(STRING_WITH_LEN("set @")); str->append(name.str, name.length); str->append(STRING_WITH_LEN(":=")); - args[0]->print(str, query_type); - str->append(')'); + args[0]->print_parenthesised(str, query_type, precedence()); } bool Item_func_set_user_var::send(Protocol *protocol, String *str_arg) @@ -5629,9 +5625,8 @@ bool Item_func_get_user_var::const_item() const void Item_func_get_user_var::print(String *str, enum_query_type query_type) { - str->append(STRING_WITH_LEN("(@")); + str->append(STRING_WITH_LEN("@")); append_identifier(current_thd, str, name.str, name.length); - str->append(')'); } diff --git a/sql/item_func.h b/sql/item_func.h index 374c16e3932..d4314f7bd6a 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -730,6 +730,7 @@ public: Item_func_plus(THD *thd, Item *a, Item *b): Item_func_additive_op(thd, a, b) {} const char *func_name() const { return "+"; } + enum precedence precedence() const { return ADD_PRECEDENCE; } longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); @@ -743,6 +744,7 @@ public: Item_func_minus(THD *thd, Item *a, Item *b): Item_func_additive_op(thd, a, b) {} const char *func_name() const { return "-"; } + enum precedence precedence() const { return ADD_PRECEDENCE; } longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); @@ -758,6 +760,7 @@ public: Item_func_mul(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {} const char *func_name() const { return "*"; } + enum precedence precedence() const { return MUL_PRECEDENCE; } longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); @@ -778,6 +781,7 @@ public: double real_op(); my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "/"; } + enum precedence precedence() const { return MUL_PRECEDENCE; } void fix_length_and_dec(); void result_precision(); Item *get_copy(THD *thd, MEM_ROOT *mem_root) @@ -792,9 +796,9 @@ public: {} longlong val_int(); const char *func_name() const { return "DIV"; } + enum precedence precedence() const { return MUL_PRECEDENCE; } void fix_length_and_dec(); - - virtual inline void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) { print_op(str, query_type); } @@ -815,6 +819,7 @@ public: double real_op(); my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "%"; } + enum precedence precedence() const { return MUL_PRECEDENCE; } void result_precision(); void fix_length_and_dec(); bool check_partition_func_processor(void *int_arg) {return FALSE;} @@ -833,6 +838,12 @@ public: my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "-"; } enum Functype functype() const { return NEG_FUNC; } + enum precedence precedence() const { return NEG_PRECEDENCE; } + void print(String *str, enum_query_type query_type) + { + str->append(func_name()); + args[0]->print_parenthesised(str, query_type, precedence()); + } void fix_length_and_dec(); uint decimal_precision() const { return args[0]->decimal_precision(); } bool check_partition_func_processor(void *int_arg) {return FALSE;} @@ -1353,6 +1364,7 @@ public: Item_func_bit_or(THD *thd, Item *a, Item *b): Item_func_bit(thd, a, b) {} longlong val_int(); const char *func_name() const { return "|"; } + enum precedence precedence() const { return BITOR_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -1363,6 +1375,7 @@ public: Item_func_bit_and(THD *thd, Item *a, Item *b): Item_func_bit(thd, a, b) {} longlong val_int(); const char *func_name() const { return "&"; } + enum precedence precedence() const { return BITAND_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -1384,6 +1397,7 @@ public: Item_func_shift_left(THD *thd, Item *a, Item *b): Item_func_bit(thd, a, b) {} longlong val_int(); const char *func_name() const { return "<<"; } + enum precedence precedence() const { return SHIFT_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -1394,6 +1408,7 @@ public: Item_func_shift_right(THD *thd, Item *a, Item *b): Item_func_bit(thd, a, b) {} longlong val_int(); const char *func_name() const { return ">>"; } + enum precedence precedence() const { return SHIFT_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -1404,10 +1419,11 @@ public: Item_func_bit_neg(THD *thd, Item *a): Item_func_bit(thd, a) {} longlong val_int(); const char *func_name() const { return "~"; } - - virtual inline void print(String *str, enum_query_type query_type) + enum precedence precedence() const { return NEG_PRECEDENCE; } + void print(String *str, enum_query_type query_type) { - Item_func::print(str, query_type); + str->append(func_name()); + args[0]->print_parenthesised(str, query_type, precedence()); } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } @@ -1917,7 +1933,8 @@ public: } bool const_item() const { return 0; } bool is_expensive() { return 1; } - virtual void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type); + enum precedence precedence() const { return ASSIGN_PRECEDENCE; } void print_as_stmt(String *str, enum_query_type query_type); const char *func_name() const { return "set_user_var"; } int save_in_field(Field *field, bool no_conversions, @@ -2155,6 +2172,7 @@ public: Item_func_bit_xor(THD *thd, Item *a, Item *b): Item_func_bit(thd, a, b) {} longlong val_int(); const char *func_name() const { return "^"; } + enum precedence precedence() const { return BITXOR_PRECEDENCE; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 8fd71a80e62..b7efa60c520 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3487,13 +3487,11 @@ bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const void Item_func_set_collation::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" collate ")); DBUG_ASSERT(args[1]->basic_const_item() && args[1]->type() == Item::STRING_ITEM); ((Item_string *)args[1])->print_value(str); - str->append(')'); } String *Item_func_charset::val_str(String *str) diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index ac7d820f2cf..be23f45c286 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1171,6 +1171,7 @@ public: void fix_length_and_dec(); bool eq(const Item *item, bool binary_cmp) const; const char *func_name() const { return "collate"; } + enum precedence precedence() const { return COLLATE_PRECEDENCE; } enum Functype functype() const { return COLLATE_FUNC; } virtual void print(String *str, enum_query_type query_type); Item_field *field_for_view_update() diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a9aaf5dd241..27ce83f3f2b 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2199,13 +2199,11 @@ static const char *interval_names[]= void Item_date_add_interval::print(String *str, enum_query_type query_type) { - str->append('('); - args[0]->print(str, query_type); + args[0]->print_parenthesised(str, query_type, ADDINTERVAL_PRECEDENCE); str->append(date_sub_interval?" - interval ":" + interval "); - args[1]->print(str, query_type); + args[1]->print_parenthesised(str, query_type, INTERVAL_PRECEDENCE); str->append(' '); str->append(interval_names[int_type]); - str->append(')'); } void Item_extract::print(String *str, enum_query_type query_type) diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 949401e19fd..d8f69e2098d 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -918,6 +918,7 @@ public: bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); + enum precedence precedence() const { return ADDINTERVAL_PRECEDENCE; } bool need_parentheses_in_default() { return true; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result index 1208b0612ff..8dd200cecb6 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result @@ -794,7 +794,7 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1; CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 @@ -802,7 +802,7 @@ connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 @@ -810,7 +810,7 @@ connection master; ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 @@ -818,7 +818,7 @@ connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 diff --git a/storage/tokudb/mysql-test/tokudb/r/ctype_collate.result b/storage/tokudb/mysql-test/tokudb/r/ctype_collate.result index 6254005d2bb..37d0d54f979 100644 --- a/storage/tokudb/mysql-test/tokudb/r/ctype_collate.result +++ b/storage/tokudb/mysql-test/tokudb/r/ctype_collate.result @@ -520,7 +520,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,('a' = 'A') AS `'a'='A'` +Note 1003 select charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,'a' = 'A' AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value diff --git a/storage/tokudb/mysql-test/tokudb/r/type_datetime.result b/storage/tokudb/mysql-test/tokudb/r/type_datetime.result index 678be1655e4..80f886683e7 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_datetime.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_datetime.result @@ -520,7 +520,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 1 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where ((`test`.`x1`.`id` = `test`.`t1`.`id`) and (`test`.`t1`.`cur_date` = 0)) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date @@ -532,7 +532,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 1 100.00 Using where; FirstMatch(t2); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where ((`test`.`x1`.`id` = `test`.`t2`.`id`) and (`test`.`t2`.`cur_date` = 0)) +Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date @@ -546,7 +546,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where ((`test`.`x1`.`id` = `test`.`t1`.`id`) and (`test`.`t1`.`cur_date` = 0)) +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date @@ -558,7 +558,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t2); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where ((`test`.`x1`.`id` = `test`.`t2`.`id`) and (`test`.`t2`.`cur_date` = 0)) +Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date diff --git a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result index 39142b552d1..ec8a947a78c 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result @@ -1388,7 +1388,7 @@ Warning 1264 Out of range value for column 'c1' at row 1 insert into t1 values( 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); -ERROR 22003: DECIMAL value is out of range in '(99999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999)' +ERROR 22003: DECIMAL value is out of range in '99999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999' insert into t1 values(1e100); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 From 8c876adfb6018a9dbc19be0459eb6c948f2b3e60 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 28 Nov 2016 00:12:00 +0100 Subject: [PATCH 093/135] Item_func_like: print a not like b instead of !(a like b) --- mysql-test/r/ctype_cp1250_ch.result | 2 +- mysql-test/r/ctype_latin1.result | 4 ++-- mysql-test/r/ctype_latin2_ch.result | 2 +- mysql-test/r/ctype_tis620.result | 4 ++-- mysql-test/r/ctype_uca.result | 4 ++-- mysql-test/r/ctype_ucs.result | 4 ++-- mysql-test/r/ctype_utf8.result | 4 ++-- mysql-test/r/selectivity.result | 6 +++--- mysql-test/r/selectivity_innodb.result | 6 +++--- .../suite/gcol/r/gcol_supported_sql_funcs_innodb.result | 2 +- .../suite/gcol/r/gcol_supported_sql_funcs_myisam.result | 2 +- mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result | 2 +- sql/item_cmpfunc.cc | 9 +++++++-- sql/item_cmpfunc.h | 9 ++++++++- sql/sql_yacc.yy | 4 +--- 15 files changed, 37 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 5f5bfa523f2..173fcccb873 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -220,7 +220,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 5feb8b7c397..ddd2ecdbd95 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -7814,7 +7814,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 @@ -7935,7 +7935,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_latin2_ch.result b/mysql-test/r/ctype_latin2_ch.result index 2e7be3d8384..e559689fdd0 100644 --- a/mysql-test/r/ctype_latin2_ch.result +++ b/mysql-test/r/ctype_latin2_ch.result @@ -160,7 +160,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index f7297426595..3dbccf9ccb0 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -3230,7 +3230,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 @@ -3446,7 +3446,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 2640a078676..3d93d7f201e 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -8559,7 +8559,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 @@ -8717,7 +8717,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 11a9eccf7ee..0ac76e91c21 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -5477,7 +5477,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 @@ -5598,7 +5598,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 38e6eac7db0..c3c94d4865f 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -6888,7 +6888,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and !(`test`.`t1`.`a` like 'a ') +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 @@ -7009,7 +7009,7 @@ EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where !(`test`.`t1`.`a` like 'a ') and `test`.`t1`.`a` = 'a' +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a' DROP TABLE t1; # # End of MDEV-8694 diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index de2403918c6..823b7601668 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -193,7 +193,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -281,7 +281,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 3ebcb9101bd..378fd2d1c6d 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -196,7 +196,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -240,7 +240,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -284,7 +284,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index 2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where Warnings: -Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and !(`dbt3_s001`.`part`.`p_type` like 'SMALL POLISHED%') and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` +Note 1003 select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result index d4812d8880c..25e07e450d9 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not like 'H%o') VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result index 92eb889c6dc..03be01c3229 100644 --- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not like 'H%o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index a41e3abd975..d6161751fd4 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) GENERATED ALWAYS AS (!(`a` like 'H%o')) VIRTUAL + `b` tinyint(1) GENERATED ALWAYS AS (`a` not like 'H%o') VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ebc71fd2518..9891d117912 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5069,6 +5069,8 @@ void Item_func_like::print(String *str, enum_query_type query_type) { args[0]->print_parenthesised(str, query_type, precedence()); str->append(' '); + if (negated) + str->append(STRING_WITH_LEN(" not ")); str->append(func_name()); str->append(' '); args[1]->print_parenthesised(str, query_type, precedence()); @@ -5097,11 +5099,11 @@ longlong Item_func_like::val_int() } null_value=0; if (canDoTurboBM) - return turboBM_matches(res->ptr(), res->length()) ? 1 : 0; + return turboBM_matches(res->ptr(), res->length()) ? !negated : negated; return my_wildcmp(cmp_collation.collation, res->ptr(),res->ptr()+res->length(), res2->ptr(),res2->ptr()+res2->length(), - escape,wild_one,wild_many) ? 0 : 1; + escape,wild_one,wild_many) ? negated : !negated; } @@ -5111,6 +5113,9 @@ longlong Item_func_like::val_int() bool Item_func_like::with_sargable_pattern() const { + if (negated) + return false; + if (!args[1]->const_item() || args[1]->is_expensive()) return false; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 99135c06df3..69b95c669a3 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1854,6 +1854,7 @@ class Item_func_like :public Item_bool_func2 bool escape_used_in_parsing; bool use_sampling; + bool negated; DTCollation cmp_collation; String cmp_value1, cmp_value2; @@ -1874,7 +1875,7 @@ public: Item_func_like(THD *thd, Item *a, Item *b, Item *escape_arg, bool escape_used): Item_bool_func2(thd, a, b), canDoTurboBM(FALSE), pattern(0), pattern_len(0), bmGs(0), bmBc(0), escape_item(escape_arg), - escape_used_in_parsing(escape_used), use_sampling(0) {} + escape_used_in_parsing(escape_used), use_sampling(0), negated(0) {} longlong val_int(); enum Functype functype() const { return LIKE_FUNC; } void print(String *str, enum_query_type query_type); @@ -1966,6 +1967,12 @@ public: } void cleanup(); + Item *neg_transformer(THD *thd) + { + negated= !negated; + return this; + } + bool find_selective_predicates_list_processor(void *arg); Item *get_copy(THD *thd, MEM_ROOT *mem_root) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f172e086580..2cd84a27d45 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9035,9 +9035,7 @@ predicate: Lex->escape_used); if (item == NULL) MYSQL_YYABORT; - $$= new (thd->mem_root) Item_func_not(thd, item); - if ($$ == NULL) - MYSQL_YYABORT; + $$= item->neg_transformer(thd); } | bit_expr REGEXP bit_expr { From 5d5e83277f6174e7daf8e495ed08551197aca76f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 28 Nov 2016 12:46:49 +0100 Subject: [PATCH 094/135] weird compilation fix strangely enough, ?: variant does not link in some older gcc versions: sql/sql_table.cc:6409: undefined reference to `Alter_inplace_info::ALTER_STORED_GCOL_EXPR' sql/sql_table.cc:6409: undefined reference to `Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR' --- sql/sql_table.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index d2b6adc50ea..f8a61b641c0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6407,9 +6407,11 @@ static bool fill_alter_inplace_info(THD *thd, if (field->vcol_info && new_field->vcol_info) { bool value_changes= is_equal == IS_EQUAL_NO; - Alter_inplace_info::HA_ALTER_FLAGS alter_expr= field->stored_in_db() - ? Alter_inplace_info::ALTER_STORED_GCOL_EXPR - : Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR; + Alter_inplace_info::HA_ALTER_FLAGS alter_expr; + if (field->stored_in_db()) + alter_expr= Alter_inplace_info::ALTER_STORED_GCOL_EXPR; + else + alter_expr= Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR; if (!field->vcol_info->is_equal(new_field->vcol_info)) { ha_alter_info->handler_flags|= alter_expr; From 9d7c3cbe18baaa79462870025fc3e7ebf80861f2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 1 Apr 2016 22:45:32 +0200 Subject: [PATCH 095/135] CONNECT: simple vcol test --- .../connect/mysql-test/connect/r/vcol.result | 29 +++++++++++++++++++ .../connect/mysql-test/connect/t/vcol.test | 26 +++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 storage/connect/mysql-test/connect/r/vcol.result create mode 100644 storage/connect/mysql-test/connect/t/vcol.test diff --git a/storage/connect/mysql-test/connect/r/vcol.result b/storage/connect/mysql-test/connect/r/vcol.result new file mode 100644 index 00000000000..1e3ecf8450a --- /dev/null +++ b/storage/connect/mysql-test/connect/r/vcol.result @@ -0,0 +1,29 @@ +create table t1 ( +#linenum int(6) not null default 0 special=rowid, +name char(12) not null, +city char(11) not null, +birth date not null date_format='DD/MM/YYYY', +hired date not null date_format='DD/MM/YYYY' flag=36, +agehired int(3) as (floor(datediff(hired,birth)/365.25)) +) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47; +select * from t1; +name city birth hired agehired +John Boston 1986-01-25 2010-06-02 24 +Henry Boston 1987-06-07 2008-04-01 20 +George San Jose 1981-08-10 2010-06-02 28 +Sam Chicago 1979-11-22 2007-10-10 27 +James Dallas 1992-05-13 2009-12-14 17 +Bill Boston 1986-09-11 2008-02-10 21 +drop table t1; +create table t1 ( +#linenum int(6) not null default 0 special=rowid, +name char(12) not null, +city char(11) not null, +birth date not null date_format='DD/MM/YYYY', +hired date not null date_format='DD/MM/YYYY' flag=36, +agehired int(3) as (floor(datediff(hired,birth)/365.25)), +index (agehired) +) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47; +ERROR 42000: Table handler doesn't support NULL in given index. Please change column 'agehired' to be NOT NULL or use another handler diff --git a/storage/connect/mysql-test/connect/t/vcol.test b/storage/connect/mysql-test/connect/t/vcol.test new file mode 100644 index 00000000000..0ed13c0e340 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/vcol.test @@ -0,0 +1,26 @@ +let datadir= `select @@datadir`; +--copy_file $MTR_SUITE_DIR/std_data/boys.txt $datadir/test/boys.txt + +create table t1 ( + #linenum int(6) not null default 0 special=rowid, + name char(12) not null, + city char(11) not null, + birth date not null date_format='DD/MM/YYYY', + hired date not null date_format='DD/MM/YYYY' flag=36, + agehired int(3) as (floor(datediff(hired,birth)/365.25)) + ) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47; +select * from t1; +drop table t1; + +--error ER_NULL_COLUMN_IN_INDEX +create table t1 ( + #linenum int(6) not null default 0 special=rowid, + name char(12) not null, + city char(11) not null, + birth date not null date_format='DD/MM/YYYY', + hired date not null date_format='DD/MM/YYYY' flag=36, + agehired int(3) as (floor(datediff(hired,birth)/365.25)), + index (agehired) + ) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47; From a9a362d3fd52010f601eae99af7e168b370da9d2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 29 Nov 2016 22:10:13 +0100 Subject: [PATCH 096/135] Aria: test for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN Aria supports virtual columns, but does not support indexes on virtual columns. Let's issue an appropriate error in this case. --- ...vcol_handler_maria.result => vcol_handler_aria.result} | 0 mysql-test/suite/vcol/r/vcol_keys_aria.result | 2 ++ .../t/{vcol_handler_maria.test => vcol_handler_aria.test} | 0 mysql-test/suite/vcol/t/vcol_keys_aria.test | 3 +++ storage/maria/ha_maria.cc | 8 ++++++++ 5 files changed, 13 insertions(+) rename mysql-test/suite/vcol/r/{vcol_handler_maria.result => vcol_handler_aria.result} (100%) create mode 100644 mysql-test/suite/vcol/r/vcol_keys_aria.result rename mysql-test/suite/vcol/t/{vcol_handler_maria.test => vcol_handler_aria.test} (100%) create mode 100644 mysql-test/suite/vcol/t/vcol_keys_aria.test diff --git a/mysql-test/suite/vcol/r/vcol_handler_maria.result b/mysql-test/suite/vcol/r/vcol_handler_aria.result similarity index 100% rename from mysql-test/suite/vcol/r/vcol_handler_maria.result rename to mysql-test/suite/vcol/r/vcol_handler_aria.result diff --git a/mysql-test/suite/vcol/r/vcol_keys_aria.result b/mysql-test/suite/vcol/r/vcol_keys_aria.result new file mode 100644 index 00000000000..ef8cb3c7b30 --- /dev/null +++ b/mysql-test/suite/vcol/r/vcol_keys_aria.result @@ -0,0 +1,2 @@ +create table t1 (a int, b int as (a+1), c int, index(b)) engine=aria; +ERROR HY000: Key/Index cannot be defined on a virtual generated column diff --git a/mysql-test/suite/vcol/t/vcol_handler_maria.test b/mysql-test/suite/vcol/t/vcol_handler_aria.test similarity index 100% rename from mysql-test/suite/vcol/t/vcol_handler_maria.test rename to mysql-test/suite/vcol/t/vcol_handler_aria.test diff --git a/mysql-test/suite/vcol/t/vcol_keys_aria.test b/mysql-test/suite/vcol/t/vcol_keys_aria.test new file mode 100644 index 00000000000..b7ac0d26550 --- /dev/null +++ b/mysql-test/suite/vcol/t/vcol_keys_aria.test @@ -0,0 +1,3 @@ +--source include/have_maria.inc +--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +create table t1 (a int, b int as (a+1), c int, index(b)) engine=aria; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index fc8a39119e3..59323a27ae2 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -522,6 +522,14 @@ static int table2maria(TABLE *table_arg, data_file_type row_type, for (j= 0; j < pos->user_defined_key_parts; j++) { Field *field= pos->key_part[j].field; + + if (!table_arg->field[field->field_index]->stored_in_db()) + { + my_free(*recinfo_out); + my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0)); + DBUG_RETURN(HA_ERR_UNSUPPORTED); + } + type= field->key_type(); keydef[i].seg[j].flag= pos->key_part[j].key_part_flag; From b3e335655747c7655e72525d6e47e0cc989e84d9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 7 Dec 2016 10:10:08 +0100 Subject: [PATCH 097/135] bugfix: reset MODE_NO_BACKSLASH_ESCAPES during vcol parsing --- mysql-test/r/func_like.result | 27 +++++++++++++++++++++++++++ mysql-test/t/func_like.test | 14 ++++++++++++++ sql/table.cc | 3 +++ 3 files changed, 44 insertions(+) diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 842ba25e556..0a309bcfab6 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -262,3 +262,30 @@ select * from v1; 'foo!' like 'foo!!' 'foo!' like 'foo!!' escape '!' 0 1 drop view v1; +create table t1 (a varchar(100), +b int default (a like '%f\\_'), +c int default (a like '%f\\_' escape ''), +d int default (a like '%f\\_' escape '\\')); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(100) DEFAULT NULL, + `b` int(11) DEFAULT (`a` like '%f\\_'), + `c` int(11) DEFAULT (`a` like '%f\\_' escape ''), + `d` int(11) DEFAULT (`a` like '%f\\_' escape '\\') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 (a) values ('1 f_'), ('1 f\\_'); +set sql_mode=no_backslash_escapes; +insert t1 (a) values ('2 f_'), ('2 f\_'); +flush tables; +insert t1 (a) values ('3 f_'), ('3 f\_'); +set sql_mode=default; +select * from t1; +a b c d +1 f_ 1 0 1 +1 f\_ 0 1 0 +2 f_ 1 0 1 +2 f\_ 0 1 0 +3 f_ 1 0 1 +3 f\_ 0 1 0 +drop table t1; diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index ed648fdc70a..b65bff63298 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -193,3 +193,17 @@ create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; show create view v1; select * from v1; drop view v1; + +create table t1 (a varchar(100), + b int default (a like '%f\\_'), + c int default (a like '%f\\_' escape ''), + d int default (a like '%f\\_' escape '\\')); +show create table t1; +insert t1 (a) values ('1 f_'), ('1 f\\_'); +set sql_mode=no_backslash_escapes; +insert t1 (a) values ('2 f_'), ('2 f\_'); +flush tables; +insert t1 (a) values ('3 f_'), ('3 f\_'); +set sql_mode=default; +select * from t1; +drop table t1; diff --git a/sql/table.cc b/sql/table.cc index 1496d1b8c46..9b312b593b4 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -995,6 +995,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, Field **vfield_ptr= table->vfield; Field **dfield_ptr= table->default_field; Virtual_column_info **check_constraint_ptr= table->check_constraints; + sql_mode_t saved_mode= thd->variables.sql_mode; Query_arena backup_arena; Virtual_column_info *vcol; StringBuffer expr_str; @@ -1020,6 +1021,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, thd->stmt_arena= table->expr_arena; thd->update_charset(&my_charset_utf8mb4_general_ci, table->s->table_charset); expr_str.append(&parse_vcol_keyword); + thd->variables.sql_mode &= ~MODE_NO_BACKSLASH_ESCAPES; while (pos < end) { @@ -1135,6 +1137,7 @@ end: thd->stmt_arena= backup_stmt_arena_ptr; if (save_character_set_client) thd->update_charset(save_character_set_client, save_collation); + thd->variables.sql_mode= saved_mode; DBUG_RETURN(res); } From c697ddc315429c56dec567b2fe85cfe5c03834ea Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Dec 2016 15:47:51 +0100 Subject: [PATCH 098/135] cleanup: remove unused handler table flag --- sql/handler.h | 2 +- sql/sql_insert.cc | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index d7fa5061e87..8b00ec8503b 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -195,7 +195,7 @@ enum enum_alter_inplace_result { #define HA_HAS_NEW_CHECKSUM (1ULL << 38) #define HA_CAN_VIRTUAL_COLUMNS (1ULL << 39) #define HA_MRR_CANT_SORT (1ULL << 40) -#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41) +#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41) /* unused */ /* This storage engine supports condition pushdown diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 901fd485390..9c21cb74802 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -955,12 +955,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, be overwritten by fill_record() anyway (and fill_record() does not use default values in this case). */ -#ifdef HAVE_valgrind - if (table->file->ha_table_flags() && HA_RECORD_MUST_BE_CLEAN_ON_WRITE) - restore_record(table,s->default_values); // Get empty record - else -#endif - table->record[0][0]= share->default_values[0]; + table->record[0][0]= share->default_values[0]; /* Fix undefined null_bits. */ if (share->null_bytes > 1 && share->last_null_bit_pos) From 85416269c3880a4d9b22d2341055f40bd62aaa1a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Dec 2016 18:35:30 +0100 Subject: [PATCH 099/135] MDEV-11518 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_long::val_int() QUICK_RANGE_SELECT::init_ror_merged_scan() should also set and restore TABLE::vcol_set --- mysql-test/suite/vcol/r/range.result | 9 +++++++++ mysql-test/suite/vcol/t/range.test | 10 ++++++++++ sql/opt_range.cc | 7 ++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/vcol/r/range.result create mode 100644 mysql-test/suite/vcol/t/range.test diff --git a/mysql-test/suite/vcol/r/range.result b/mysql-test/suite/vcol/r/range.result new file mode 100644 index 00000000000..ad7a39bc11c --- /dev/null +++ b/mysql-test/suite/vcol/r/range.result @@ -0,0 +1,9 @@ +create table t1 (pk int, i int, v int as (i*2) virtual, primary key (pk), key (v)) engine=myisam; +insert into t1 (pk,i) values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +create table t2 (a int, b int) engine=myisam; +insert into t2 values (1,2),(2,4); +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk ); +pk i v a b +1 1 0 1 2 +2 2 0 2 4 +drop table t1, t2; diff --git a/mysql-test/suite/vcol/t/range.test b/mysql-test/suite/vcol/t/range.test new file mode 100644 index 00000000000..a4593d8b40a --- /dev/null +++ b/mysql-test/suite/vcol/t/range.test @@ -0,0 +1,10 @@ +# +# MDEV-11518 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_long::val_int() +# +create table t1 (pk int, i int, v int as (i*2) virtual, primary key (pk), key (v)) engine=myisam; +insert into t1 (pk,i) values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +create table t2 (a int, b int) engine=myisam; +insert into t2 values (1,2),(2,4); +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk ); +drop table t1, t2; + diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3ea9f4e5db9..4b535769d6c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1477,6 +1477,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler, handler *save_file= file, *org_file; my_bool org_key_read; THD *thd= head->in_use; + MY_BITMAP * const save_vcol_set= head->vcol_set; MY_BITMAP * const save_read_set= head->read_set; MY_BITMAP * const save_write_set= head->write_set; DBUG_ENTER("QUICK_RANGE_SELECT::init_ror_merged_scan"); @@ -1489,7 +1490,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler, { DBUG_RETURN(1); } - head->column_bitmaps_set(&column_bitmap, &column_bitmap); + head->column_bitmaps_set(&column_bitmap, &column_bitmap, &column_bitmap); goto end; } @@ -1514,7 +1515,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler, goto failure; /* purecov: inspected */ } - head->column_bitmaps_set(&column_bitmap, &column_bitmap); + head->column_bitmaps_set(&column_bitmap, &column_bitmap, &column_bitmap); if (file->ha_external_lock(thd, F_RDLCK)) goto failure; @@ -1568,7 +1569,7 @@ end: DBUG_RETURN(0); failure: - head->column_bitmaps_set(save_read_set, save_write_set); + head->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set); delete file; file= save_file; DBUG_RETURN(1); From 1b7a794b738ae889534ac37805ca6e0016af122a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Dec 2016 22:33:27 +0100 Subject: [PATCH 100/135] MDEV-11540 Unexpected system threads in the process list name innodb background threads as such --- sql/sql_class.cc | 2 ++ storage/innobase/handler/ha_innodb.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 343511d665c..1b6692d9d2c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -796,6 +796,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) mysql_audit_init_thd(this); net.vio=0; net.buff= 0; + net.reading_or_writing= 0; client_capabilities= 0; // minimalistic client system_thread= NON_SYSTEM_THREAD; cleanup_done= free_connection_done= abort_on_warning= 0; @@ -4448,6 +4449,7 @@ MYSQL_THD create_thd() thd->store_globals(); thd->set_command(COM_DAEMON); thd->system_thread= SYSTEM_THREAD_GENERIC; + thd->security_ctx->host_or_ip=""; add_to_active_threads(thd); return thd; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d3745122959..cac438c71d8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -329,6 +329,7 @@ thd_destructor_proxy(void *) thd_destructor_myvar = _my_thread_var(); THD *thd= create_thd(); + thd_proc_info(thd, "InnoDB background thread"); mysql_mutex_lock(&thd_destructor_mutex); thd_destructor_myvar->current_mutex = &thd_destructor_mutex; @@ -1779,6 +1780,7 @@ innobase_create_background_thd() /*============================*/ { MYSQL_THD thd= create_thd(); + thd_proc_info(thd, "InnoDB background thread"); THDVAR(thd, background_thread) = true; return thd; } From d26b9f670d30861885c6a8caebbd77fe4e9eda3e Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 13 Dec 2016 12:39:48 +0400 Subject: [PATCH 101/135] MDEV-11470 JSON_KEYS accepts arguments in invalid format. Now JSON functions return warnings if arguments are invalid. --- include/json_lib.h | 1 + mysql-test/r/func_json.result | 15 +- mysql-test/t/func_json.test | 1 + sql/item_jsonfunc.cc | 429 ++++++++++++++++++++++++---------- sql/share/errmsg-utf8.txt | 24 ++ strings/json_lib.c | 12 +- 6 files changed, 351 insertions(+), 131 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index abef3e60db6..b26d865fd36 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -102,6 +102,7 @@ typedef struct st_json_path_t json_path_step_t *last_step; /* Points to the last step. */ int mode_strict; /* TRUE if the path specified as 'strict' */ + enum json_path_step_types types_used; /* The '|' of all step's 'type'-s */ } json_path_t; diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index c972057e37c..99e1e95372f 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -92,7 +92,9 @@ select json_contains('[1]', '[1]', '$', '$[0]'); ERROR 42000: Incorrect parameter count in the call to native function 'json_contains' select json_contains('', '', '$'); json_contains('', '', '$') -0 +NULL +Warnings: +Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_contains' select json_contains('null', 'null', '$'); json_contains('null', 'null', '$') 1 @@ -276,6 +278,8 @@ ERROR 42000: Incorrect parameter count in the call to native function 'json_merg select json_merge('string', 123); json_merge('string', 123) NULL +Warnings: +Warning 4038 Syntax error in JSON text in argument 1 to function 'json_merge' at position 1 select json_merge('"string"', 123); json_merge('"string"', 123) ["string", 123] @@ -294,6 +298,8 @@ NULL select json_merge('a','b'); json_merge('a','b') NULL +Warnings: +Warning 4038 Syntax error in JSON text in argument 1 to function 'json_merge' at position 1 select json_merge('{"a":"b"}','{"c":"d"}'); json_merge('{"a":"b"}','{"c":"d"}') {"a":"b", "c":"d"} @@ -321,6 +327,11 @@ json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a") select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b"); json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b") NULL +select json_keys('foo'); +json_keys('foo') +NULL +Warnings: +Warning 4038 Syntax error in JSON text in argument 1 to function 'json_keys' at position 1 SET @j = '["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]'; select json_search(@j, 'one', 'abc'); json_search(@j, 'one', 'abc') @@ -385,6 +396,8 @@ json_depth('[[[1,2,3],"s"], {}, []]') select json_length(''); json_length('') NULL +Warnings: +Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_length' select json_length('{}'); json_length('{}') 0 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index d3d75fa3913..8685d82b635 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -129,6 +129,7 @@ select json_type('123.12'); select json_keys('{"a":{"c":1, "d":2}, "b":2}'); select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a"); select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b"); +select json_keys('foo'); SET @j = '["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]'; select json_search(@j, 'one', 'abc'); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index e3fa34cd72c..7bf2283dd53 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -113,12 +113,131 @@ static int st_append_escaped(String *s, const String *a) } +#define report_json_error(js, je, n_param) \ + report_json_error_ex(js, je, func_name(), n_param, \ + Sql_condition::WARN_LEVEL_WARN) + +static void report_json_error_ex(String *js, json_engine_t *je, + const char *fname, int n_param, + Sql_condition::enum_warning_level lv) +{ + THD *thd= current_thd; + int position= (const char *) je->s.c_str - js->ptr(); + uint code; + + n_param++; + + switch (je->s.error) + { + case JE_BAD_CHR: + code= ER_JSON_BAD_CHR; + break; + + case JE_NOT_JSON_CHR: + code= ER_JSON_NOT_JSON_CHR; + break; + + case JE_EOS: + code= ER_JSON_EOS; + break; + + case JE_SYN: + case JE_STRING_CONST: + code= ER_JSON_SYNTAX; + break; + + case JE_ESCAPING: + code= ER_JSON_ESCAPING; + break; + + case JE_DEPTH: + code= ER_JSON_DEPTH; + push_warning_printf(thd, lv, code, ER_THD(thd, code), JSON_DEPTH_LIMIT, + n_param, fname, position); + return; + + default: + return; + } + + push_warning_printf(thd, lv, code, ER_THD(thd, code), + n_param, fname, position); +} + + + +#define NO_WILDCARD_ALLOWED 1 +#define SHOULD_END_WITH_ARRAY 2 + +#define report_path_error(js, je, n_param) \ + report_path_error_ex(js, je, func_name(), n_param,\ + Sql_condition::WARN_LEVEL_WARN) + +static void report_path_error_ex(String *ps, json_path_t *p, + const char *fname, int n_param, + Sql_condition::enum_warning_level lv) +{ + THD *thd= current_thd; + int position= (const char *) p->s.c_str - ps->ptr() + 1; + uint code; + + n_param++; + + switch (p->s.error) + { + case JE_BAD_CHR: + case JE_NOT_JSON_CHR: + case JE_SYN: + code= ER_JSON_PATH_SYNTAX; + break; + + case JE_EOS: + code= ER_JSON_PATH_EOS; + break; + + case JE_DEPTH: + code= ER_JSON_PATH_DEPTH; + push_warning_printf(thd, lv, code, ER_THD(thd, code), + JSON_DEPTH_LIMIT, n_param, fname, position); + return; + + case NO_WILDCARD_ALLOWED: + code= ER_JSON_PATH_NO_WILDCARD; + break; + + default: + return; + } + push_warning_printf(thd, lv, code, ER_THD(thd, code), + n_param, fname, position); +} + + + +/* + Checks if the path has '.*' '[*]' or '**' constructions + and sets the NO_WILDCARD_ALLOWED error if the case. +*/ +static int path_setup_nwc(json_path_t *p, CHARSET_INFO *i_cs, + const uchar *str, const uchar *end) +{ + if (!json_path_setup(p, i_cs, str, end)) + { + if ((p->types_used & (JSON_PATH_WILD | JSON_PATH_DOUBLE_WILD)) == 0) + return 0; + p->s.error= NO_WILDCARD_ALLOWED; + } + + return 1; +} + + longlong Item_func_json_valid::val_int() { String *js= args[0]->val_str(&tmp_value); json_engine_t je; - if ((null_value= args[0]->null_value) || js == NULL) + if ((null_value= args[0]->null_value)) return 0; json_scan_start(&je, js->charset(), (const uchar *) js->ptr(), @@ -339,6 +458,8 @@ String *Item_func_json_unquote::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); + je.value_type= (enum json_value_types) -1; /* To report errors right. */ + if (json_read_value(&je)) goto error; @@ -359,6 +480,8 @@ String *Item_func_json_unquote::val_str(String *str) return str; error: + if (je.value_type == JSON_VALUE_STRING) + report_json_error(js, &je, 0); /* We just return the argument's value in the case of error. */ return js; } @@ -449,12 +572,12 @@ String *Item_func_json_extract::val_str(String *str) if (s_p && json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), (const uchar *) s_p->ptr() + s_p->length())) - goto error; + goto return_null; c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) - goto error; + goto return_null; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -513,8 +636,7 @@ String *Item_func_json_extract::val_str(String *str) if (first_value == NULL) { /* Nothing was found. */ - null_value= 1; - return 0; + goto return_null; } if (multiple_values_found ? @@ -525,6 +647,8 @@ String *Item_func_json_extract::val_str(String *str) return str; error: + report_json_error(js, &je, 0); +return_null: /* TODO: launch error messages. */ null_value= 1; return 0; @@ -778,24 +902,35 @@ longlong Item_func_json_contains::val_int() { String *s_p= args[2]->val_str(&tmp_path); if (s_p && - json_path_setup(&path.p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->end())) - goto error; + path_setup_nwc(&path.p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->end())) + { + report_path_error(s_p, &path.p, 2); + goto return_null; + } path.parsed= path.constant; } if (args[2]->null_value) - goto error; + goto return_null; path.cur_step= path.p.steps; if (json_find_path(&je, &path.p, &path.cur_step, array_counters)) - goto error; + { + if (je.s.error) + { + ve.s.error= 0; + goto error; + } + + return FALSE; + } } json_scan_start(&ve, val->charset(),(const uchar *) val->ptr(), (const uchar *) val->end()); if (json_read_value(&je) || json_read_value(&ve)) - return FALSE; + goto error; result= check_contains(&je, &ve); if (je.s.error || ve.s.error) @@ -804,6 +939,11 @@ longlong Item_func_json_contains::val_int() return result; error: + if (je.s.error) + report_json_error(js, &je, 0); + if (ve.s.error) + report_json_error(val, &ve, 1); +return_null: null_value= 1; return 0; } @@ -837,7 +977,7 @@ void Item_func_json_contains_path::cleanup() } -static int parse_one_or_all(Item *ooa_arg, +static int parse_one_or_all(const Item_func *f, Item *ooa_arg, bool *ooa_parsed, bool ooa_constant, bool *mode_one) { if (!*ooa_parsed) @@ -846,12 +986,20 @@ static int parse_one_or_all(Item *ooa_arg, String *res, tmp(buff, sizeof(buff), &my_charset_bin); if ((res= ooa_arg->val_str(&tmp)) == NULL) return TRUE; + *mode_one=eq_ascii_string(res->charset(), "one", res->ptr(), res->length()); if (!*mode_one) { if (!eq_ascii_string(res->charset(), "all", res->ptr(), res->length())) + { + THD *thd= current_thd; + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_JSON_ONE_OR_ALL, ER_THD(thd, ER_JSON_ONE_OR_ALL), + f->func_name()); + *mode_one= TRUE; return TRUE; + } } *ooa_parsed= ooa_constant; } @@ -869,8 +1017,8 @@ longlong Item_func_json_contains_path::val_int() if ((null_value= args[0]->null_value)) return 0; - if (parse_one_or_all(args[1], &ooa_parsed, ooa_constant, &mode_one)) - goto error; + if (parse_one_or_all(this, args[1], &ooa_parsed, ooa_constant, &mode_one)) + goto return_null; result= !mode_one; for (n_arg=2; n_arg < arg_count; n_arg++) @@ -881,14 +1029,17 @@ longlong Item_func_json_contains_path::val_int() { String *s_p= args[n_arg]->val_str(tmp_paths+(n_arg-2)); if (s_p && - json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) - goto error; + path_setup_nwc(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + { + report_path_error(s_p, &c_path->p, n_arg-2); + goto return_null; + } c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) - goto error; + goto return_null; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -898,7 +1049,7 @@ longlong Item_func_json_contains_path::val_int() { /* Path wasn't found. */ if (je.s.error) - goto error; + goto js_error; if (!mode_one) { @@ -916,7 +1067,9 @@ longlong Item_func_json_contains_path::val_int() return result; -error: +js_error: + report_json_error(js, &je, 0); +return_null: null_value= 1; return 0; } @@ -1014,7 +1167,7 @@ String *Item_func_json_array::val_str(String *str) str->length(0); if (str->append("[", 1) || - ((arg_count > 0) && append_json_value(str, args[0],&tmp_val))) + ((arg_count > 0) && append_json_value(str, args[0], &tmp_val))) goto err_return; for (n_arg=1; n_arg < arg_count; n_arg++) @@ -1074,16 +1227,16 @@ String *Item_func_json_array_append::val_str(String *str) { String *s_p= args[n_arg]->val_str(tmp_paths+n_path); if (s_p && - json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) - goto error; + path_setup_nwc(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + { + report_path_error(s_p, &c_path->p, n_arg); + goto return_null; + } c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) - { - null_value= 1; - return 0; - } + goto return_null; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -1093,33 +1246,33 @@ String *Item_func_json_array_append::val_str(String *str) if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) { if (je.s.error) - goto error; - null_value= 1; - return 0; + goto js_error; + + goto return_null; } if (json_read_value(&je)) - goto error; + goto js_error; str->length(0); str->set_charset(js->charset()); if (str->reserve(js->length() + 8, 1024)) - goto error; /* Out of memory. */ + goto return_null; /* Out of memory. */ if (je.value_type == JSON_VALUE_ARRAY) { if (json_skip_level(&je)) - goto error; + goto js_error; ar_end= je.s.c_str - je.sav_c_len; str_rest_len= js->length() - (ar_end - (const uchar *) js->ptr()); str->q_append(js->ptr(), ar_end-(const uchar *) js->ptr()); str->append(", ", 2); if (append_json_value(str, args[n_arg+1], &tmp_val)) - goto error; /* Out of memory. */ + goto return_null; /* Out of memory. */ if (str->reserve(str_rest_len, 1024)) - goto error; /* Out of memory. */ + goto return_null; /* Out of memory. */ str->q_append((const char *) ar_end, str_rest_len); } else @@ -1133,7 +1286,7 @@ String *Item_func_json_array_append::val_str(String *str) if (je.value_type == JSON_VALUE_OBJECT) { if (json_skip_level(&je)) - goto error; + goto js_error; c_to= je.s.c_str; } else @@ -1146,7 +1299,7 @@ String *Item_func_json_array_append::val_str(String *str) str->append("]", 1) || str->append((const char *) je.s.c_str, js->end() - (const char *) je.s.c_str)) - goto error; + goto return_null; /* Out of memory. */ } { /* Swap str and js. */ @@ -1165,7 +1318,10 @@ String *Item_func_json_array_append::val_str(String *str) return js; -error: +js_error: + report_json_error(js, &je, 0); + +return_null: null_value= 1; return 0; } @@ -1193,16 +1349,23 @@ String *Item_func_json_array_insert::val_str(String *str) { String *s_p= args[n_arg]->val_str(tmp_paths+n_path); if (s_p && - (json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length()) || + (path_setup_nwc(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length()) || c_path->p.last_step - 1 < c_path->p.steps || c_path->p.last_step->type != JSON_PATH_ARRAY)) - goto error; + { + if (c_path->p.s.error == 0) + c_path->p.s.error= SHOULD_END_WITH_ARRAY; + + report_path_error(s_p, &c_path->p, n_arg); + + goto return_null; + } c_path->parsed= c_path->constant; c_path->p.last_step--; } if (args[n_arg]->null_value) - goto null_return; + goto return_null; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -1212,19 +1375,19 @@ String *Item_func_json_array_insert::val_str(String *str) if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) { if (je.s.error) - goto error; + goto js_error; /* Can't find the array to insert. */ - goto null_return; + continue; } if (json_read_value(&je)) - goto error; + goto js_error; if (je.value_type != JSON_VALUE_ARRAY) { /* Must be an array. */ - goto null_return; + continue; } item_pos= 0; @@ -1253,6 +1416,9 @@ String *Item_func_json_array_insert::val_str(String *str) } } + if (je.s.error) + goto js_error; + str->length(0); str->set_charset(js->charset()); if (!item_pos) @@ -1264,7 +1430,7 @@ String *Item_func_json_array_insert::val_str(String *str) append_json_value(str, args[n_arg+1], &tmp_val) || (je.state != JST_ARRAY_END && str->append(",", 1)) || append_simple(str, item_pos, js->end() - item_pos)) - goto error; /* Out of memory. */ + goto return_null; /* Out of memory. */ { /* Swap str and js. */ @@ -1283,8 +1449,9 @@ String *Item_func_json_array_insert::val_str(String *str) return js; -null_return: -error: +js_error: + report_json_error(js, &je, 0); +return_null: null_value= 1; return 0; } @@ -1327,17 +1494,17 @@ String *Item_func_json_merge::val_str(String *str) { DBUG_ASSERT(fixed == 1); json_engine_t je1, je2; - String *js1= args[0]->val_str(&tmp_js1); + String *js1= args[0]->val_str(&tmp_js1), *js2; uint n_arg; if (args[0]->null_value) - goto error_return; + goto null_return; for (n_arg=1; n_arg < arg_count; n_arg++) { - String *js2= args[n_arg]->val_str(&tmp_js2); + js2= args[n_arg]->val_str(&tmp_js2); if (args[n_arg]->null_value) - goto error_return; + goto null_return; json_scan_start(&je1, js1->charset(),(const uchar *) js1->ptr(), (const uchar *) js1->ptr() + js1->length()); @@ -1394,6 +1561,11 @@ String *Item_func_json_merge::val_str(String *str) return js1; error_return: + if (je1.s.error) + report_json_error(js1, &je1, 0); + if (je2.s.error) + report_json_error(js2, &je2, n_arg); +null_return: null_value= 1; return NULL; } @@ -1418,13 +1590,12 @@ longlong Item_func_json_length::val_int() length++; } while (json_scan_next(&je) == 0); - if (je.s.error) - { - null_value= 1; - return 0; - } - - return length - 1; + if (!je.s.error) + return length - 1; + + report_json_error(js, &je, 0); + null_value= 1; + return 0; } @@ -1470,13 +1641,12 @@ longlong Item_func_json_depth::val_int() } } while (json_scan_next(&je) == 0); - if (je.s.error) - { - null_value= 1; - return 0; - } - - return depth; + if (!je.s.error) + return depth; + + report_json_error(js, &je, 0); + null_value= 1; + return 0; } @@ -1530,6 +1700,7 @@ String *Item_func_json_type::val_str(String *str) return str; error: + report_json_error(js, &je, 0); null_value= 1; return 0; } @@ -1580,10 +1751,13 @@ String *Item_func_json_insert::val_str(String *str) String *s_p= args[n_arg]->val_str(tmp_paths+n_path); if (s_p) { - if (json_path_setup(&c_path->p,s_p->charset(), - (const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) - goto error; + if (path_setup_nwc(&c_path->p,s_p->charset(), + (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + { + report_path_error(s_p, &c_path->p, n_arg); + goto return_null; + } /* We search to the last step. */ c_path->p.last_step--; @@ -1591,10 +1765,7 @@ String *Item_func_json_insert::val_str(String *str) c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) - { - null_value= 1; - return 0; - } + goto return_null; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -1605,11 +1776,11 @@ String *Item_func_json_insert::val_str(String *str) json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) { if (je.s.error) - goto error; + goto js_error; } if (json_read_value(&je)) - goto error; + goto js_error; lp= c_path->p.last_step+1; if (lp->type & JSON_PATH_ARRAY) @@ -1626,12 +1797,12 @@ String *Item_func_json_insert::val_str(String *str) /* Wrap the value as an array. */ if (append_simple(str, js->ptr(), (const char *) v_from - js->ptr()) || str->append("[", 1)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ if (je.value_type == JSON_VALUE_OBJECT) { if (json_skip_level(&je)) - goto error; + goto js_error; } if (append_simple(str, v_from, je.s.c_str - v_from) || @@ -1639,7 +1810,7 @@ String *Item_func_json_insert::val_str(String *str) append_json_value(str, args[n_arg+1], &tmp_val) || str->append("]", 1) || append_simple(str, je.s.c_str, js->end()-(const char *) je.s.c_str)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ goto continue_point; } @@ -1653,7 +1824,7 @@ String *Item_func_json_insert::val_str(String *str) goto v_found; n_item++; if (json_skip_array_item(&je)) - goto error; + goto js_error; break; default: break; @@ -1661,7 +1832,7 @@ String *Item_func_json_insert::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; if (!mode_insert) continue; @@ -1672,7 +1843,7 @@ String *Item_func_json_insert::val_str(String *str) str->append(", ", 2) || append_json_value(str, args[n_arg+1], &tmp_val) || append_simple(str, v_to, js->end() - v_to)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ } else /*JSON_PATH_KEY*/ { @@ -1688,7 +1859,7 @@ String *Item_func_json_insert::val_str(String *str) if (json_key_matches(&je, &key_name)) goto v_found; if (json_skip_key(&je)) - goto error; + goto js_error; break; default: break; @@ -1696,7 +1867,7 @@ String *Item_func_json_insert::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; if (!mode_insert) continue; @@ -1709,7 +1880,7 @@ String *Item_func_json_insert::val_str(String *str) str->append("\":", 2) || append_json_value(str, args[n_arg+1], &tmp_val) || append_simple(str, v_to, js->end() - v_to)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ } goto continue_point; @@ -1720,20 +1891,20 @@ v_found: continue; if (json_read_value(&je)) - goto error; + goto js_error; v_to= (const char *) je.value_begin; str->length(0); if (!json_value_scalar(&je)) { if (json_skip_level(&je)) - goto error; + goto js_error; } if (append_simple(str, js->ptr(), v_to - js->ptr()) || append_json_value(str, args[n_arg+1], &tmp_val) || append_simple(str, je.s.c_str, js->end()-(const char *) je.s.c_str)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ continue_point: { /* Swap str and js. */ @@ -1752,7 +1923,9 @@ continue_point: return js; -error: +js_error: + report_json_error(js, &je, 0); +return_null: null_value= 1; return 0; } @@ -1795,10 +1968,13 @@ String *Item_func_json_remove::val_str(String *str) String *s_p= args[n_arg]->val_str(tmp_paths+n_path); if (s_p) { - if (json_path_setup(&c_path->p,s_p->charset(), - (const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) - goto error; + if (path_setup_nwc(&c_path->p,s_p->charset(), + (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + { + report_path_error(s_p, &c_path->p, n_arg); + goto null_return; + } /* We search to the last step. */ c_path->p.last_step--; @@ -1808,10 +1984,7 @@ String *Item_func_json_remove::val_str(String *str) c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) - { - null_value= 1; - return 0; - } + goto null_return; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -1821,11 +1994,11 @@ String *Item_func_json_remove::val_str(String *str) if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) { if (je.s.error) - goto error; + goto js_error; } if (json_read_value(&je)) - goto error; + goto js_error; lp= c_path->p.last_step+1; if (lp->type & JSON_PATH_ARRAY) @@ -1846,7 +2019,7 @@ String *Item_func_json_remove::val_str(String *str) } n_item++; if (json_skip_array_item(&je)) - goto error; + goto js_error; break; default: break; @@ -1854,7 +2027,7 @@ String *Item_func_json_remove::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; continue; } @@ -1875,7 +2048,7 @@ String *Item_func_json_remove::val_str(String *str) goto v_found; if (json_skip_key(&je)) - goto error; + goto js_error; rem_start= (const char *) je.s.c_str; n_item++; @@ -1886,7 +2059,7 @@ String *Item_func_json_remove::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; continue; } @@ -1894,7 +2067,7 @@ String *Item_func_json_remove::val_str(String *str) v_found: if (json_skip_key(&je) || json_scan_next(&je)) - goto error; + goto js_error; rem_end= (je.state == JST_VALUE && n_item == 0) ? (const char *) je.s.c_str : (const char *) (je.s.c_str - je.sav_c_len); @@ -1903,7 +2076,7 @@ v_found: if (append_simple(str, js->ptr(), rem_start - js->ptr()) || append_simple(str, rem_end, js->end() - rem_end)) - goto error; /* Out of memory. */ + goto js_error; /* Out of memory. */ { /* Swap str and js. */ @@ -1922,8 +2095,9 @@ v_found: return js; +js_error: + report_json_error(js, &je, 0); null_return: -error: null_value= 1; return 0; } @@ -1958,9 +2132,12 @@ String *Item_func_json_keys::val_str(String *str) { String *s_p= args[1]->val_str(&tmp_path); if (s_p && - json_path_setup(&path.p, s_p->charset(), (const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) - goto err_return; + path_setup_nwc(&path.p, s_p->charset(), (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + { + report_path_error(s_p, &path.p, 1); + goto null_return; + } path.parsed= path.constant; } @@ -2024,8 +2201,9 @@ skip_search: null_value= 0; return str; -null_return: err_return: + report_json_error(js, &je, 0); +null_return: null_value= 1; return 0; } @@ -2173,10 +2351,7 @@ String *Item_func_json_search::val_str(String *str) if (args[0]->null_value || args[2]->null_value) goto null_return; - if (parse_one_or_all(args[1], &ooa_parsed, ooa_constant, &mode_one)) - goto error; - - if (args[1]->null_value) + if (parse_one_or_all(this, args[1], &ooa_parsed, ooa_constant, &mode_one)) goto null_return; n_path_found= 0; @@ -2192,7 +2367,10 @@ String *Item_func_json_search::val_str(String *str) if (s_p && json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), (const uchar *) s_p->ptr() + s_p->length())) - goto error; + { + report_path_error(s_p, &c_path->p, n_arg); + goto null_return; + } c_path->parsed= c_path->constant; } if (args[n_arg]->null_value) @@ -2215,12 +2393,12 @@ String *Item_func_json_search::val_str(String *str) while (json_read_keyname_chr(&je) == 0) p.last_step->key_end= je.s.c_str; if (je.s.error) - goto error; + goto js_error; /* Now we have je.state == JST_VALUE, so let's handle it. */ case JST_VALUE: if (json_read_value(&je)) - goto error; + goto js_error; if (json_value_scalar(&je)) { if ((arg_count < 5 || path_ok(paths, n_arg - 4, &p)) && @@ -2238,10 +2416,10 @@ String *Item_func_json_search::val_str(String *str) { if (str->append("[", 1) || append_json_path(str, &sav_path)) - goto error; + goto js_error; } if (str->append(", ", 2) || append_json_path(str, &p)) - goto error; + goto js_error; } if (mode_one) @@ -2270,7 +2448,7 @@ String *Item_func_json_search::val_str(String *str) } while (json_scan_next(&je) == 0); if (je.s.error) - goto error; + goto js_error; end: if (n_path_found == 0) @@ -2278,20 +2456,21 @@ end: if (n_path_found == 1) { if (append_json_path(str, &sav_path)) - goto error; + goto js_error; } else { if (str->append("]", 1)) - goto error; + goto js_error; } null_value= 0; return str; +js_error: + report_json_error(js, &je, 0); null_return: -error: /* TODO: launch error messages. */ null_value= 1; return 0; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 584cda9cb95..aa11b55da0d 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7414,3 +7414,27 @@ ER_BINLOG_NON_SUPPORTED_BULK eng "Only row based replication supported for bulk operations" ER_BINLOG_UNCOMPRESS_ERROR eng "Uncompress the compressed binlog failed" +ER_JSON_BAD_CHR + eng "Broken JSON string in argument %d to function '%s' at position %d" +ER_JSON_NOT_JSON_CHR + eng "Character disallowd in JSON in argument %d to function '%s' at position %d" +ER_JSON_EOS + eng "Unexpected end of JSON text in argument %d to function '%s'" +ER_JSON_SYNTAX + eng "Syntax error in JSON text in argument %d to function '%s' at position %d" +ER_JSON_ESCAPING + eng "Incorrect escaping in JSON text in argument %d to function '%s' at position %d" +ER_JSON_DEPTH + eng "Limit of %d on JSON nested strucures depth is reached in argument %d to function '%s' at position %d" +ER_JSON_PATH_EOS + eng "Unexpected end of JSON path in argument %d to function '%s'" +ER_JSON_PATH_SYNTAX + eng "Syntax error in JSON path in argument %d to function '%s' at position %d" +ER_JSON_PATH_DEPTH + eng "Limit of %d on JSON path depth is reached in argument %d to function '%s' at position %d" +ER_JSON_PATH_NO_WILDCARD + eng "Wildcards in JSON path not allowed in argument %d to function '%s'" +ER_JSON_PATH_ARRAY + eng "JSON path should end with an array identifier in argument %d to function '%s'" +ER_JSON_ONE_OR_ALL + eng "Argument 2 to function '%s' must be "one" or "all"." diff --git a/strings/json_lib.c b/strings/json_lib.c index 015ce1f39f8..acca7eb0739 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -392,12 +392,12 @@ static int v_string(json_engine_t *j) static int read_strn(json_engine_t *j) { j->value= j->s.c_str; + j->value_type= JSON_VALUE_STRING; if (skip_str_constant(j)) return 1; j->state= *j->stack_p; - j->value_type= JSON_VALUE_STRING; j->value_len= (j->s.c_str - j->value) - 1; return 0; } @@ -556,9 +556,9 @@ static int skip_string_verbatim(json_string_t *s, const char *str) s->c_str+= c_len; continue; } - return JE_SYN; + return s->error= JE_SYN; } - return json_eos(s) ? JE_EOS : JE_BAD_CHR; + return s->error= json_eos(s) ? JE_EOS : JE_BAD_CHR; } return 0; @@ -1078,6 +1078,7 @@ int json_path_setup(json_path_t *p, p->steps[0].type= JSON_PATH_ARRAY_WILD; p->last_step= p->steps; p->mode_strict= FALSE; + p->types_used= JSON_PATH_KEY_NULL; do { @@ -1109,6 +1110,7 @@ int json_path_setup(json_path_t *p, if (p->last_step->type & JSON_PATH_DOUBLE_WILD) return p->s.error= JE_SYN; p->last_step->type|= JSON_PATH_WILD; + p->types_used|= JSON_PATH_WILD; continue; case PS_INT: p->last_step->n_item*= 10; @@ -1122,7 +1124,7 @@ int json_path_setup(json_path_t *p, p->last_step++; if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) return p->s.error= JE_DEPTH; - p->last_step->type= JSON_PATH_KEY | double_wildcard; + p->types_used|= p->last_step->type= JSON_PATH_KEY | double_wildcard; double_wildcard= JSON_PATH_KEY_NULL; p->last_step->key= p->s.c_str; continue; @@ -1134,7 +1136,7 @@ int json_path_setup(json_path_t *p, p->last_step++; if (p->last_step - p->steps >= JSON_DEPTH_LIMIT) return p->s.error= JE_DEPTH; - p->last_step->type= JSON_PATH_ARRAY | double_wildcard; + p->types_used|= p->last_step->type= JSON_PATH_ARRAY | double_wildcard; double_wildcard= JSON_PATH_KEY_NULL; p->last_step->n_item= 0; continue; From 65b4d7457e40ee25302d2df28b0d200ff59d9e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 13 Dec 2016 11:52:23 +0200 Subject: [PATCH 102/135] Merge the test innodb.innodb_misc1 into innodb.innodb. --- mysql-test/suite/innodb/r/innodb.result | 21 +- mysql-test/suite/innodb/r/innodb_misc1.result | 922 ------------- mysql-test/suite/innodb/t/innodb.test | 81 +- .../suite/innodb/t/innodb_misc1-master.opt | 1 - mysql-test/suite/innodb/t/innodb_misc1.test | 1196 ----------------- 5 files changed, 55 insertions(+), 2166 deletions(-) delete mode 100644 mysql-test/suite/innodb/r/innodb_misc1.result delete mode 100644 mysql-test/suite/innodb/t/innodb_misc1-master.opt delete mode 100644 mysql-test/suite/innodb/t/innodb_misc1.test diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 235c8e880d6..213fb8a7831 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -2455,17 +2455,30 @@ drop table t1,t2; CREATE TABLE t1 ( id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; id 1 TRUNCATE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; id 1 +2 DELETE FROM t1; TRUNCATE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +3 +DROP TABLE t2; +TRUNCATE t1; INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; id @@ -2481,7 +2494,7 @@ id INT NOT NULL PRIMARY KEY, b INT, FOREIGN KEY (b) REFERENCES test.t1(id) ) ENGINE=InnoDB; -Got one of the listed errors +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") DROP TABLE t1; create table t1 (col1 varchar(2000), index (col1(767))) character set = latin1 engine = innodb; @@ -2574,7 +2587,7 @@ INSERT INTO t2 VALUES(1); DELETE FROM t1 WHERE id = 1; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) DROP TABLE t1; -Got one of the listed errors +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) SET FOREIGN_KEY_CHECKS=0; DROP TABLE t1; SET FOREIGN_KEY_CHECKS=1; @@ -3089,8 +3102,8 @@ a BIGINT(20) NOT NULL, b VARCHAR(128) NOT NULL, c TEXT NOT NULL, PRIMARY KEY (a,b), -KEY idx_t2_b_c (b,c(200)), -CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) +KEY idx_t2_b_c (b,c(100)), +CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=UTF8; INSERT INTO t1 VALUES (1); diff --git a/mysql-test/suite/innodb/r/innodb_misc1.result b/mysql-test/suite/innodb/r/innodb_misc1.result deleted file mode 100644 index 9529578b6d6..00000000000 --- a/mysql-test/suite/innodb/r/innodb_misc1.result +++ /dev/null @@ -1,922 +0,0 @@ -drop table if exists t1,t2,t3,t4; -drop database if exists mysqltest; -create table t1 (v varchar(16384)) engine=innodb; -drop table t1; -create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; -insert into t1 values ('8', '6'), ('4', '7'); -select min(a) from t1; -min(a) -4 -select min(b) from t1 where a='8'; -min(b) -6 -drop table t1; -CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; -insert into t1 (b) values (1); -replace into t1 (b) values (2), (1), (3); -select * from t1; -a b -3 1 -2 2 -4 3 -truncate table t1; -insert into t1 (b) values (1); -replace into t1 (b) values (2); -replace into t1 (b) values (1); -replace into t1 (b) values (3); -select * from t1; -a b -3 1 -2 2 -4 3 -drop table t1; -create table t1 (rowid int not null auto_increment, val int not null,primary -key (rowid), unique(val)) engine=innodb; -replace into t1 (val) values ('1'),('2'); -replace into t1 (val) values ('1'),('2'); -insert into t1 (val) values ('1'),('2'); -ERROR 23000: Duplicate entry '1' for key 'val' -select * from t1; -rowid val -3 1 -4 2 -drop table t1; -create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; -insert into t1 (val) values (1); -update t1 set a=2 where a=1; -insert into t1 (val) values (1); -ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -select * from t1; -a val -2 1 -drop table t1; -CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; -INSERT INTO t1 (GRADE) VALUES (151),(252),(343); -SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; -GRADE -252 -SELECT GRADE FROM t1 WHERE GRADE= 151; -GRADE -151 -DROP TABLE t1; -create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; -create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; -insert into t2 values ('aa','cc'); -insert into t1 values ('aa','bb'),('aa','cc'); -delete t1 from t1,t2 where f1=f3 and f4='cc'; -select * from t1; -f1 f2 -drop table t1,t2; -CREATE TABLE t1 ( -id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) ENGINE=InnoDB; -CREATE TABLE t2 ( -id INTEGER NOT NULL, -FOREIGN KEY (id) REFERENCES t1 (id) -) ENGINE=InnoDB; -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; -id -1 -TRUNCATE t1; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; -id -1 -2 -DELETE FROM t1; -TRUNCATE t1; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`id`) REFERENCES `test`.`t1` (`id`)) -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; -id -3 -DROP TABLE t2, t1; -CREATE TABLE t1 -( -id INT PRIMARY KEY -) ENGINE=InnoDB; -CREATE TEMPORARY TABLE t2 -( -id INT NOT NULL PRIMARY KEY, -b INT, -FOREIGN KEY (b) REFERENCES test.t1(id) -) ENGINE=InnoDB; -ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") -DROP TABLE t1; -create table t1 (col1 varchar(2000), index (col1(767))) -character set = latin1 engine = innodb; -create table t2 (col1 char(255), index (col1)) -character set = latin1 engine = innodb; -create table t3 (col1 binary(255), index (col1)) -character set = latin1 engine = innodb; -create table t4 (col1 varchar(767), index (col1)) -character set = latin1 engine = innodb; -create table t5 (col1 varchar(767) primary key) -character set = latin1 engine = innodb; -create table t6 (col1 varbinary(767) primary key) -character set = latin1 engine = innodb; -create table t7 (col1 text, index(col1(767))) -character set = latin1 engine = innodb; -create table t8 (col1 blob, index(col1(767))) -character set = latin1 engine = innodb; -drop table t1, t2, t3, t4, t5, t6, t7, t8; -SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; -SET GLOBAL innodb_default_row_format=compact; -create table t1 (col1 varchar(768) primary key) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t2 (col1 varbinary(768) primary key) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t3 (col1 text, primary key(col1(768))) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t4 (col1 blob, primary key(col1(768))) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -SET GLOBAL innodb_default_row_format=dynamic; -create table t1 (col1 varchar(768) primary key) -character set = latin1 engine = innodb; -drop table t1; -create table t2 (col1 varbinary(768) primary key) -character set = latin1 engine = innodb; -drop table t2; -create table t3 (col1 text, primary key(col1(768))) -character set = latin1 engine = innodb; -drop table t3; -create table t4 (col1 blob, primary key(col1(768))) -character set = latin1 engine = innodb; -drop table t4; -SET GLOBAL innodb_default_row_format=default; -SET sql_mode = default; -SET GLOBAL innodb_default_row_format=compact; -create table t1 (col1 varchar(768) primary key) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t2 (col1 varbinary(768) primary key) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t3 (col1 text, primary key(col1(768))) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table t4 (col1 blob, primary key(col1(768))) -character set = latin1 engine = innodb; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -SET GLOBAL innodb_default_row_format=default; -CREATE TABLE t1 -( -id INT PRIMARY KEY -) ENGINE=InnoDB; -CREATE TABLE t2 -( -v INT, -CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) -) ENGINE=InnoDB; -INSERT INTO t2 VALUES(2); -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) -INSERT INTO t1 VALUES(1); -INSERT INTO t2 VALUES(1); -DELETE FROM t1 WHERE id = 1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) -DROP TABLE t1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) -SET FOREIGN_KEY_CHECKS=0; -DROP TABLE t1; -SET FOREIGN_KEY_CHECKS=1; -INSERT INTO t2 VALUES(3); -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) -DROP TABLE t2; -connect a,localhost,root,,; -connect b,localhost,root,,; -connection a; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2); -set autocommit=0; -checksum table t1; -Table Checksum -test.t1 1531596814 -connection b; -insert into t1 values(3); -connection a; -checksum table t1; -Table Checksum -test.t1 1531596814 -connection a; -commit; -checksum table t1; -Table Checksum -test.t1 2050879373 -commit; -drop table t1; -connection a; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2); -set autocommit=1; -checksum table t1; -Table Checksum -test.t1 1531596814 -connection b; -set autocommit=1; -insert into t1 values(3); -connection a; -checksum table t1; -Table Checksum -test.t1 2050879373 -drop table t1; -connection default; -disconnect a; -disconnect b; -set foreign_key_checks=0; -create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; -create table t1(a char(10) primary key, b varchar(20)) engine = innodb; -ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") -set foreign_key_checks=1; -drop table t2; -set foreign_key_checks=0; -create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; -ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") -set foreign_key_checks=1; -drop table t1; -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; -create table t1(a varchar(10) primary key) engine = innodb; -alter table t1 modify column a int; -Got one of the listed errors -set foreign_key_checks=1; -drop table t2,t1; -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; -create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; -alter table t1 convert to character set utf8; -set foreign_key_checks=1; -drop table t2,t1; -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; -create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; -rename table t3 to t1; -ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed") -set foreign_key_checks=1; -drop table t2,t3; -create table t1(a int primary key) row_format=redundant engine=innodb; -create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; -create table t3(a int primary key) row_format=compact engine=innodb; -create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; -insert into t1 values(1); -insert into t3 values(1); -insert into t2 values(2); -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) -insert into t4 values(2); -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) -insert into t2 values(1); -insert into t4 values(1); -update t1 set a=2; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) -update t2 set a=2; -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) -update t3 set a=2; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) -update t4 set a=2; -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) -truncate t1; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) -truncate t3; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`)) -truncate t2; -truncate t4; -truncate t1; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) -truncate t3; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`)) -drop table t4,t3,t2,t1; -create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; -create table t2 (s1 binary(2),primary key (s1)) engine=innodb; -create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; -create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; -insert into t1 values (0x41),(0x4120),(0x4100); -insert into t2 values (0x41),(0x4120),(0x4100); -ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' -insert into t2 values (0x41),(0x4120); -insert into t3 values (0x41),(0x4120),(0x4100); -ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY' -insert into t3 values (0x41),(0x4100); -insert into t4 values (0x41),(0x4120),(0x4100); -ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' -insert into t4 values (0x41),(0x4100); -select hex(s1) from t1; -hex(s1) -41 -4100 -4120 -select hex(s1) from t2; -hex(s1) -4100 -4120 -select hex(s1) from t3; -hex(s1) -4100 -41 -select hex(s1) from t4; -hex(s1) -4100 -41 -drop table t1,t2,t3,t4; -create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; -create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; -insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); -insert into t2 values(0x42); -ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -insert into t2 values(0x41); -select hex(s1) from t2; -hex(s1) -4100 -update t1 set s1=0x123456 where a=2; -select hex(s1) from t2; -hex(s1) -4100 -update t1 set s1=0x12 where a=1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; -update t1 set s1=0x12345678 where a=1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -SET sql_mode = default; -update t1 set s1=0x123457 where a=1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -update t1 set s1=0x1220 where a=1; -select hex(s1) from t2; -hex(s1) -1220 -update t1 set s1=0x1200 where a=1; -select hex(s1) from t2; -hex(s1) -1200 -update t1 set s1=0x4200 where a=1; -select hex(s1) from t2; -hex(s1) -4200 -delete from t1 where a=1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -delete from t1 where a=2; -update t2 set s1=0x4120; -delete from t1; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -delete from t1 where a!=3; -select a,hex(s1) from t1; -a hex(s1) -3 4120 -select hex(s1) from t2; -hex(s1) -4120 -drop table t2,t1; -create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; -create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; -insert into t1 values(1,0x4100),(2,0x41); -insert into t2 values(0x41); -select hex(s1) from t2; -hex(s1) -41 -update t1 set s1=0x1234 where a=1; -select hex(s1) from t2; -hex(s1) -41 -update t1 set s1=0x12 where a=2; -select hex(s1) from t2; -hex(s1) -12 -delete from t1 where a=1; -delete from t1 where a=2; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) -select a,hex(s1) from t1; -a hex(s1) -2 12 -select hex(s1) from t2; -hex(s1) -12 -drop table t2,t1; -CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; -CREATE TABLE t2(a INT) ENGINE=InnoDB; -ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); -ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; -ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); -ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; -SHOW CREATE TABLE t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT NULL, - KEY `t2_ibfk_0` (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -DROP TABLE t2,t1; -CREATE TABLE t1 ( -field1 varchar(8) NOT NULL DEFAULT '', -field2 varchar(8) NOT NULL DEFAULT '', -PRIMARY KEY (field1, field2) -) ENGINE=InnoDB; -CREATE TABLE t2 ( -field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, -FOREIGN KEY (field1) REFERENCES t1 (field1) -ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB; -INSERT INTO t1 VALUES ('old', 'somevalu'); -INSERT INTO t1 VALUES ('other', 'anyvalue'); -INSERT INTO t2 VALUES ('old'); -INSERT INTO t2 VALUES ('other'); -UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; -ERROR 23000: Foreign key constraint for table 't1', record 'other-somevalu' would lead to a duplicate entry in table 't2', key 'PRIMARY' -DROP TABLE t2; -DROP TABLE t1; -create table t1 ( -c1 bigint not null, -c2 bigint not null, -primary key (c1), -unique key (c2) -) engine=innodb; -create table t2 ( -c1 bigint not null, -primary key (c1) -) engine=innodb; -alter table t1 add constraint c2_fk foreign key (c2) -references t2(c1) on delete cascade; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` bigint(20) NOT NULL, - `c2` bigint(20) NOT NULL, - PRIMARY KEY (`c1`), - UNIQUE KEY `c2` (`c2`), - CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -alter table t1 drop foreign key c2_fk; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` bigint(20) NOT NULL, - `c2` bigint(20) NOT NULL, - PRIMARY KEY (`c1`), - UNIQUE KEY `c2` (`c2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -drop table t1, t2; -create table t1(a date) engine=innodb; -create table t2(a date, key(a)) engine=innodb; -insert into t1 values('2005-10-01'); -insert into t2 values('2005-10-01'); -select * from t1, t2 -where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; -a a -2005-10-01 2005-10-01 -drop table t1, t2; -create table t1 (id int not null, f_id int not null, f int not null, -primary key(f_id, id)) engine=innodb; -create table t2 (id int not null,s_id int not null,s varchar(200), -primary key(id)) engine=innodb; -INSERT INTO t1 VALUES (8, 1, 3); -INSERT INTO t1 VALUES (1, 2, 1); -INSERT INTO t2 VALUES (1, 0, ''); -INSERT INTO t2 VALUES (8, 1, ''); -commit; -DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) -WHERE mm.id IS NULL; -select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) -where mm.id is null lock in share mode; -id f_id f -drop table t1,t2; -connect a,localhost,root,,; -connect b,localhost,root,,; -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); -commit; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -update t1 set b = 5 where b = 1; -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -select * from t1 where a = 7 and b = 3 for update; -a b -7 3 -connection a; -commit; -connection b; -commit; -drop table t1; -connection default; -disconnect a; -disconnect b; -connect a,localhost,root,,; -connect b,localhost,root,,; -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); -commit; -set autocommit = 0; -select * from t1 lock in share mode; -a b -1 1 -2 2 -3 1 -4 2 -5 1 -6 2 -update t1 set b = 5 where b = 1; -connection b; -set autocommit = 0; -select * from t1 where a = 2 and b = 2 for update; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection a; -commit; -connection b; -commit; -connection default; -disconnect a; -disconnect b; -drop table t1; -connect a,localhost,root,,; -connect b,localhost,root,,; -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values (1,2),(5,3),(4,2); -create table t2(d int not null, e int, primary key(d)) engine=innodb; -insert into t2 values (8,6),(12,1),(3,1); -commit; -set autocommit = 0; -select * from t2 for update; -d e -3 1 -8 6 -12 1 -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -insert into t1 select * from t2; -update t1 set b = (select e from t2 where a = d); -create table t3(d int not null, e int, primary key(d)) engine=innodb -select * from t2; -commit; -connection a; -commit; -connection default; -disconnect a; -disconnect b; -drop table t1, t2, t3; -connect a,localhost,root,,; -connect b,localhost,root,,; -connect c,localhost,root,,; -connect d,localhost,root,,; -connect e,localhost,root,,; -connect f,localhost,root,,; -connect g,localhost,root,,; -connect h,localhost,root,,; -connect i,localhost,root,,; -connect j,localhost,root,,; -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values (1,2),(5,3),(4,2); -create table t2(a int not null, b int, primary key(a)) engine=innodb; -insert into t2 values (8,6),(12,1),(3,1); -create table t3(d int not null, b int, primary key(d)) engine=innodb; -insert into t3 values (8,6),(12,1),(3,1); -create table t5(a int not null, b int, primary key(a)) engine=innodb; -insert into t5 values (1,2),(5,3),(4,2); -create table t6(d int not null, e int, primary key(d)) engine=innodb; -insert into t6 values (8,6),(12,1),(3,1); -create table t8(a int not null, b int, primary key(a)) engine=innodb; -insert into t8 values (1,2),(5,3),(4,2); -create table t9(d int not null, e int, primary key(d)) engine=innodb; -insert into t9 values (8,6),(12,1),(3,1); -commit; -set autocommit = 0; -select * from t2 for update; -a b -3 1 -8 6 -12 1 -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; -insert into t1 select * from t2; -connection c; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; -update t3 set b = (select b from t2 where a = d); -connection d; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; -create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; -connection e; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -insert into t5 (select * from t2 lock in share mode); -connection f; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -update t6 set e = (select b from t2 where a = d lock in share mode); -connection g; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; -connection h; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -insert into t8 (select * from t2 for update); -connection i; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -update t9 set e = (select b from t2 where a = d for update); -connection j; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; -connection b; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection c; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection d; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection e; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection f; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection g; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection h; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection i; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection j; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -connection a; -commit; -connection default; -disconnect a; -disconnect b; -disconnect c; -disconnect d; -disconnect e; -disconnect f; -disconnect g; -disconnect h; -disconnect i; -disconnect j; -drop table t1, t2, t3, t5, t6, t8, t9; -CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; -ERROR 42000: Incorrect column name 'DB_ROW_ID' -CREATE TABLE t1 ( -a BIGINT(20) NOT NULL, -PRIMARY KEY (a) -) ENGINE=INNODB DEFAULT CHARSET=UTF8; -CREATE TABLE t2 ( -a BIGINT(20) NOT NULL, -b VARCHAR(128) NOT NULL, -c TEXT NOT NULL, -PRIMARY KEY (a,b), -KEY idx_t2_b_c (b,c(100)), -CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) -ON DELETE CASCADE -) ENGINE=INNODB DEFAULT CHARSET=UTF8; -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (1, 'bar', 'vbar'); -INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); -INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); -INSERT INTO t2 VALUES (1, 'customer_over', '1'); -SELECT * FROM t2 WHERE b = 'customer_over'; -a b c -1 customer_over 1 -SELECT * FROM t2 WHERE BINARY b = 'customer_over'; -a b c -1 customer_over 1 -SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; -a -1 -/* Bang: Empty result set, above was expected: */ -SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; -a -1 -SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; -a -1 -drop table t2, t1; -CREATE TABLE t1 ( a int ) ENGINE=innodb; -BEGIN; -INSERT INTO t1 VALUES (1); -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead -test.t1 optimize status OK -DROP TABLE t1; -CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; -CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, -CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) -ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; -ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON -DELETE CASCADE ON UPDATE CASCADE; -SHOW CREATE TABLE t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `id` int(11) NOT NULL, - `f` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `f` (`f`), - CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -DROP TABLE t2, t1; -CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; -CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (1); -ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; -ALTER TABLE t2 MODIFY a INT NOT NULL; -ERROR HY000: Cannot change column 'a': used in a foreign key constraint 't2_ibfk_1' -DELETE FROM t1; -DROP TABLE t2,t1; -CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) -ENGINE=InnoDB; -INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); -DELETE FROM t1; -INSERT INTO t1 VALUES ('DDD'); -SELECT * FROM t1; -a -DDD -DROP TABLE t1; -CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB -AUTO_INCREMENT=42; -INSERT INTO t1 VALUES (0),(347),(0); -SELECT * FROM t1; -id -42 -347 -348 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 -CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; -INSERT INTO t2 VALUES(42),(347),(348); -ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`id`), - CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 -DROP TABLE t1,t2; -SET innodb_strict_mode=ON; -CREATE TABLE t1 ( -c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), -c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), -c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), -c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), -c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), -c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), -c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), -c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) -) ENGINE = InnoDB; -ERROR 42000: Row size too large (> {checked_valid}). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -SET innodb_strict_mode=OFF; -DROP TABLE IF EXISTS t1; -Warnings: -Note 1051 Unknown table 'test.t1' -CREATE TABLE t1( -id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY -) ENGINE=InnoDB; -INSERT INTO t1 VALUES(-10); -SELECT * FROM t1; -id --10 -INSERT INTO t1 VALUES(NULL); -SELECT * FROM t1; -id --10 -1 -DROP TABLE t1; -CONNECT c1,localhost,root,,; -CONNECT c2,localhost,root,,; -connection c1; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -DROP TABLE IF EXISTS t1, t2; -Warnings: -Note 1051 Unknown table 'test.t1' -Note 1051 Unknown table 'test.t2' -CREATE TABLE t1 ( a int ) ENGINE=InnoDB; -CREATE TABLE t2 LIKE t1; -SELECT * FROM t2; -a -connection c2; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -INSERT INTO t1 VALUES (1); -COMMIT; -connection c1; -SELECT * FROM t1 WHERE a=1; -a -1 -disconnect c1; -disconnect c2; -CONNECT c1,localhost,root,,; -CONNECT c2,localhost,root,,; -connection c1; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -SELECT * FROM t2; -a -connection c2; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -INSERT INTO t1 VALUES (2); -COMMIT; -connection c1; -SELECT * FROM t1 WHERE a=2; -a -2 -SELECT * FROM t1 WHERE a=2; -a -2 -DROP TABLE t1; -DROP TABLE t2; -disconnect c1; -disconnect c2; -connection default; -create table t1 (i int, j int) engine=innodb; -insert into t1 (i, j) values (1, 1), (2, 2); -update t1 set j = 2; -affected rows: 1 -info: Rows matched: 2 Changed: 1 Warnings: 0 -drop table t1; -set @save_innodb_file_per_table= @@global.innodb_file_per_table; -set @@global.innodb_file_per_table=0; -create table t1 (id int) comment='this is a comment' engine=innodb; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -select table_comment, data_free > 0 as data_free_is_set -from information_schema.tables -where table_schema='test' and table_name = 't1'; -table_comment data_free_is_set -this is a comment 1 -drop table t1; -set @@global.innodb_file_per_table= @save_innodb_file_per_table; -connection default; -CREATE TABLE t1 ( -c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -c2 VARCHAR(128) NOT NULL, -PRIMARY KEY(c1) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; -CREATE TABLE t2 ( -c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -c2 INT(10) UNSIGNED DEFAULT NULL, -PRIMARY KEY(c1) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; -ANALYZE TABLE t2; -Table Op Msg_type Msg_text -test.t2 analyze status OK -SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; -AUTO_INCREMENT -200 -ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); -SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; -AUTO_INCREMENT -200 -DROP TABLE t2; -DROP TABLE t1; -connection default; -CREATE TABLE t1 (c1 int default NULL, -c2 int default NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -TRUNCATE TABLE t1; -affected rows: 0 -INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -TRUNCATE TABLE t1; -affected rows: 0 -DROP TABLE t1; -Variable_name Value -Handler_update 0 -Variable_name Value -Handler_delete 0 -Variable_name Value -Handler_update 1 -Variable_name Value -Handler_delete 1 diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index e456d48b5c2..dfe1a0b4995 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1,18 +1,3 @@ -####################################################################### -# # -# Please, DO NOT TOUCH this file as well as the innodb.result file. # -# These files are to be modified ONLY BY INNOBASE guys. # -# # -# Use innodb_mysql.[test|result] files instead. # -# # -# If nevertheless you need to make some changes here, please, forward # -# your commit message # -# To: innodb_dev_ww@oracle.com # -# Cc: dev-innodb@mysql.com # -# (otherwise your changes may be erased). # -# # -####################################################################### - -- source include/have_innodb.inc -- source include/have_innodb_16k.inc @@ -1521,15 +1506,25 @@ CREATE TABLE t1 ( id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; + INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; +--error ER_TRUNCATE_ILLEGAL_FK TRUNCATE t1; INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; -# continued from above; test that doing a slow TRUNCATE on a table with 0 -# rows resets autoincrement columns +# continued from above; test that doing a TRUNCATE resets AUTO_INCREMENT DELETE FROM t1; +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t2; TRUNCATE t1; INSERT INTO t1 (id) VALUES (NULL); SELECT * FROM t1; @@ -1541,7 +1536,7 @@ CREATE TABLE t1 id INT PRIMARY KEY ) ENGINE=InnoDB; ---error ER_CANNOT_ADD_FOREIGN,1005 +--error ER_CANT_CREATE_TABLE CREATE TEMPORARY TABLE t2 ( id INT NOT NULL PRIMARY KEY, @@ -1630,7 +1625,7 @@ CREATE TABLE t2 CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) ) ENGINE=InnoDB; ---error 1452 +--error ER_NO_REFERENCED_ROW_2 INSERT INTO t2 VALUES(2); INSERT INTO t1 VALUES(1); @@ -1639,14 +1634,14 @@ INSERT INTO t2 VALUES(1); --error ER_ROW_IS_REFERENCED_2 DELETE FROM t1 WHERE id = 1; ---error ER_ROW_IS_REFERENCED_2, 1217 +--error ER_ROW_IS_REFERENCED_2 DROP TABLE t1; SET FOREIGN_KEY_CHECKS=0; DROP TABLE t1; SET FOREIGN_KEY_CHECKS=1; ---error 1452 +--error ER_NO_REFERENCED_ROW_2 INSERT INTO t2 VALUES(3); DROP TABLE t2; @@ -1702,7 +1697,7 @@ set foreign_key_checks=0; create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; # Embedded server doesn't chdir to data directory --replace_result $MYSQLTEST_VARDIR . master-data/ '' --- error 1005 +--error ER_CANT_CREATE_TABLE create table t1(a char(10) primary key, b varchar(20)) engine = innodb; set foreign_key_checks=1; drop table t2; @@ -1714,7 +1709,7 @@ set foreign_key_checks=0; create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; # Embedded server doesn't chdir to data directory --replace_result $MYSQLTEST_VARDIR . master-data/ '' --- error 1005 +--error ER_CANT_CREATE_TABLE create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; set foreign_key_checks=1; drop table t1; @@ -1946,7 +1941,7 @@ SET sql_mode = default; #insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); # #delimiter |; -#create trigger t1t before insert on t1 for each row begin +#create trigger t1t before insert on t1 for each row begin # INSERT INTO t2 SET a = NEW.a; #end | # @@ -1954,7 +1949,7 @@ SET sql_mode = default; # DELETE FROM t3 WHERE a = NEW.a; #end | # -#create trigger t3t before delete on t3 for each row begin +#create trigger t3t before delete on t3 for each row begin # UPDATE t4 SET b = b + 1 WHERE a = OLD.a; #end | # @@ -2078,7 +2073,7 @@ create table t1(a int not null, b int, primary key(a)) engine=innodb; insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); commit; SET binlog_format='MIXED'; -set autocommit = 0; +set autocommit = 0; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; update t1 set b = 5 where b = 1; connection b; @@ -2086,7 +2081,7 @@ SET binlog_format='MIXED'; set autocommit = 0; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; # -# X-lock to record (7,3) should be released in a update +# X-lock to record (7,3) should be released in a update # select * from t1 where a = 7 and b = 3 for update; connection a; @@ -2109,7 +2104,7 @@ connection a; create table t1(a int not null, b int, primary key(a)) engine=innodb; insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); commit; -set autocommit = 0; +set autocommit = 0; select * from t1 lock in share mode; update t1 set b = 5 where b = 1; connection b; @@ -2117,12 +2112,12 @@ set autocommit = 0; # # S-lock to records (2,2),(4,2), and (6,2) should not be released in a update # ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT select * from t1 where a = 2 and b = 2 for update; # # X-lock to record (1,1),(3,1),(5,1) should not be released in a update # ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT connection a; commit; connection b; @@ -2166,7 +2161,7 @@ disconnect b; drop table t1, t2, t3; # -# Consistent read should not be used if +# Consistent read should not be used if # # (a) isolation level is serializable OR # (b) select ... lock in share mode OR @@ -2262,39 +2257,39 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; connection b; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection c; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection d; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection e; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection f; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection g; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection h; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection i; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection j; ---error 1205 +--error ER_LOCK_WAIT_TIMEOUT reap; connection a; @@ -2331,8 +2326,8 @@ CREATE TABLE t2 ( b VARCHAR(128) NOT NULL, c TEXT NOT NULL, PRIMARY KEY (a,b), - KEY idx_t2_b_c (b,c(200)), - CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) + KEY idx_t2_b_c (b,c(100)), + CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=UTF8; @@ -2457,7 +2452,7 @@ INSERT INTO t1 VALUES(-10); SELECT * FROM t1; # # NOTE: The server really needs to be restarted at this point -# for the test to be useful. +# for the test to be useful. # # Without the fix InnoDB would trip over an assertion here. INSERT INTO t1 VALUES(NULL); diff --git a/mysql-test/suite/innodb/t/innodb_misc1-master.opt b/mysql-test/suite/innodb/t/innodb_misc1-master.opt deleted file mode 100644 index 4901efb416c..00000000000 --- a/mysql-test/suite/innodb/t/innodb_misc1-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog_cache_size=32768 --innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_misc1.test b/mysql-test/suite/innodb/t/innodb_misc1.test deleted file mode 100644 index 9efec68afd5..00000000000 --- a/mysql-test/suite/innodb/t/innodb_misc1.test +++ /dev/null @@ -1,1196 +0,0 @@ --- source include/have_innodb.inc - -let $MYSQLD_DATADIR= `select @@datadir`; -# Save the original values of some variables in order to be able to -# estimate how much they have changed during the tests. Previously this -# test assumed that e.g. rows_deleted is 0 here and after deleting 23 -# rows it expected that rows_deleted will be 23. Now we do not make -# assumptions about the values of the variables at the beginning, e.g. -# rows_deleted should be 23 + "rows_deleted before the test". This allows -# the test to be run multiple times without restarting the mysqld server. -# See Bug#43309 Test main.innodb can't be run twice --- disable_query_log - -call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is"); -call mtr.add_suppression("\\[ERROR\\] InnoDB: in ALTER TABLE `test`.`t1`"); -call mtr.add_suppression("\\[ERROR\\] InnoDB: in RENAME TABLE table `test`.`t1`"); -SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency; --- enable_query_log - ---disable_warnings -drop table if exists t1,t2,t3,t4; -drop database if exists mysqltest; ---enable_warnings - -# InnoDB specific varchar tests -create table t1 (v varchar(16384)) engine=innodb; -drop table t1; - -# -# BUG#11039 Wrong key length in min() -# - -create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; -insert into t1 values ('8', '6'), ('4', '7'); -select min(a) from t1; -select min(b) from t1 where a='8'; -drop table t1; - -# -# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error -# - -CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; -insert into t1 (b) values (1); -replace into t1 (b) values (2), (1), (3); -select * from t1; -truncate table t1; -insert into t1 (b) values (1); -replace into t1 (b) values (2); -replace into t1 (b) values (1); -replace into t1 (b) values (3); -select * from t1; -drop table t1; - -create table t1 (rowid int not null auto_increment, val int not null,primary -key (rowid), unique(val)) engine=innodb; -replace into t1 (val) values ('1'),('2'); -replace into t1 (val) values ('1'),('2'); ---error ER_DUP_ENTRY -insert into t1 (val) values ('1'),('2'); -select * from t1; -drop table t1; - -# -# Test that update does not change internal auto-increment value -# - -create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; -insert into t1 (val) values (1); -update t1 set a=2 where a=1; -# We should get the following error because InnoDB does not update the counter ---error ER_DUP_ENTRY -insert into t1 (val) values (1); -select * from t1; -drop table t1; -# -# Bug #10465 -# - ---disable_warnings -CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; ---enable_warnings -INSERT INTO t1 (GRADE) VALUES (151),(252),(343); -SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; -SELECT GRADE FROM t1 WHERE GRADE= 151; -DROP TABLE t1; - -# -# Bug #12340 multitable delete deletes only one record -# -create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; -create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; -insert into t2 values ('aa','cc'); -insert into t1 values ('aa','bb'),('aa','cc'); -delete t1 from t1,t2 where f1=f3 and f4='cc'; -select * from t1; -drop table t1,t2; - -# -# Test that the slow TRUNCATE implementation resets autoincrement columns -# (bug #11946) -# - -CREATE TABLE t1 ( -id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) ENGINE=InnoDB; - -CREATE TABLE t2 ( -id INTEGER NOT NULL, -FOREIGN KEY (id) REFERENCES t1 (id) -) ENGINE=InnoDB; - -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; ---error ER_TRUNCATE_ILLEGAL_FK -TRUNCATE t1; -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; - -# continued from above; test that doing a slow TRUNCATE on a table with 0 -# rows resets autoincrement columns -DELETE FROM t1; ---error ER_TRUNCATE_ILLEGAL_FK -TRUNCATE t1; -INSERT INTO t1 (id) VALUES (NULL); -SELECT * FROM t1; -DROP TABLE t2, t1; - -# Test that foreign keys in temporary tables are not accepted (bug #12084) -CREATE TABLE t1 -( - id INT PRIMARY KEY -) ENGINE=InnoDB; - ---error ER_CANT_CREATE_TABLE -CREATE TEMPORARY TABLE t2 -( - id INT NOT NULL PRIMARY KEY, - b INT, - FOREIGN KEY (b) REFERENCES test.t1(id) -) ENGINE=InnoDB; -DROP TABLE t1; - -# -# Test that index column max sizes are honored (bug #13315) -# - -# prefix index -create table t1 (col1 varchar(2000), index (col1(767))) - character set = latin1 engine = innodb; - -# normal indexes -create table t2 (col1 char(255), index (col1)) - character set = latin1 engine = innodb; -create table t3 (col1 binary(255), index (col1)) - character set = latin1 engine = innodb; -create table t4 (col1 varchar(767), index (col1)) - character set = latin1 engine = innodb; -create table t5 (col1 varchar(767) primary key) - character set = latin1 engine = innodb; -create table t6 (col1 varbinary(767) primary key) - character set = latin1 engine = innodb; -create table t7 (col1 text, index(col1(767))) - character set = latin1 engine = innodb; -create table t8 (col1 blob, index(col1(767))) - character set = latin1 engine = innodb; - -# multi-column tests can be found in innodb_16k, innodb_8k & innodb_4k - -drop table t1, t2, t3, t4, t5, t6, t7, t8; - -SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; - -SET GLOBAL innodb_default_row_format=compact; ---error ER_INDEX_COLUMN_TOO_LONG -create table t1 (col1 varchar(768) primary key) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t2 (col1 varbinary(768) primary key) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t3 (col1 text, primary key(col1(768))) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t4 (col1 blob, primary key(col1(768))) - character set = latin1 engine = innodb; - -SET GLOBAL innodb_default_row_format=dynamic; -create table t1 (col1 varchar(768) primary key) - character set = latin1 engine = innodb; -drop table t1; -create table t2 (col1 varbinary(768) primary key) - character set = latin1 engine = innodb; -drop table t2; -create table t3 (col1 text, primary key(col1(768))) - character set = latin1 engine = innodb; -drop table t3; -create table t4 (col1 blob, primary key(col1(768))) - character set = latin1 engine = innodb; -drop table t4; -SET GLOBAL innodb_default_row_format=default; - -SET sql_mode = default; - -# these should be refused -SET GLOBAL innodb_default_row_format=compact; ---error ER_INDEX_COLUMN_TOO_LONG -create table t1 (col1 varchar(768) primary key) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t2 (col1 varbinary(768) primary key) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t3 (col1 text, primary key(col1(768))) - character set = latin1 engine = innodb; ---error ER_INDEX_COLUMN_TOO_LONG -create table t4 (col1 blob, primary key(col1(768))) - character set = latin1 engine = innodb; -SET GLOBAL innodb_default_row_format=default; - -# -# Test improved foreign key error messages (bug #3443) -# - -CREATE TABLE t1 -( - id INT PRIMARY KEY -) ENGINE=InnoDB; - -CREATE TABLE t2 -( - v INT, - CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) -) ENGINE=InnoDB; - ---error ER_NO_REFERENCED_ROW_2 -INSERT INTO t2 VALUES(2); - -INSERT INTO t1 VALUES(1); -INSERT INTO t2 VALUES(1); - ---error ER_ROW_IS_REFERENCED_2 -DELETE FROM t1 WHERE id = 1; - ---error ER_ROW_IS_REFERENCED_2 -DROP TABLE t1; - -SET FOREIGN_KEY_CHECKS=0; -DROP TABLE t1; -SET FOREIGN_KEY_CHECKS=1; - ---error ER_NO_REFERENCED_ROW_2 -INSERT INTO t2 VALUES(3); - -DROP TABLE t2; -# -# Test that checksum table uses a consistent read Bug #12669 -# -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2); -set autocommit=0; -checksum table t1; -connection b; -insert into t1 values(3); -connection a; -# -# Here checksum should not see insert -# -checksum table t1; -connection a; -commit; -checksum table t1; -commit; -drop table t1; -# -# autocommit = 1 -# -connection a; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2); -set autocommit=1; -checksum table t1; -connection b; -set autocommit=1; -insert into t1 values(3); -connection a; -# -# Here checksum sees insert -# -checksum table t1; -drop table t1; - -connection default; -disconnect a; -disconnect b; - -# tests for bugs #9802 and #13778 - -# test that FKs between invalid types are not accepted - -set foreign_key_checks=0; -create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; ---error ER_CANT_CREATE_TABLE -create table t1(a char(10) primary key, b varchar(20)) engine = innodb; -set foreign_key_checks=1; -drop table t2; - -# test that FKs between different charsets are not accepted in CREATE even -# when f_k_c is 0 - -set foreign_key_checks=0; -create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; ---error ER_CANT_CREATE_TABLE -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; -set foreign_key_checks=1; -drop table t1; - -# test that invalid datatype conversions with ALTER are not allowed - -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; -create table t1(a varchar(10) primary key) engine = innodb; --- error 1025,1025 -alter table t1 modify column a int; -set foreign_key_checks=1; -drop table t2,t1; - -# test that charset conversions with ALTER are allowed when f_k_c is 0 - -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; -create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; -alter table t1 convert to character set utf8; -set foreign_key_checks=1; -drop table t2,t1; - -# test that RENAME does not allow invalid charsets when f_k_c is 0 - -set foreign_key_checks=0; -create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; -create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; -# Embedded server doesn't chdir to data directory ---replace_result $MYSQLD_DATADIR ./ master-data/ '' --- error 1025 -rename table t3 to t1; -set foreign_key_checks=1; -drop table t2,t3; - -# test that foreign key errors are reported correctly (Bug #15550) - -create table t1(a int primary key) row_format=redundant engine=innodb; -create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; -create table t3(a int primary key) row_format=compact engine=innodb; -create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; - -insert into t1 values(1); -insert into t3 values(1); --- error 1452 -insert into t2 values(2); --- error 1452 -insert into t4 values(2); -insert into t2 values(1); -insert into t4 values(1); --- error 1451 -update t1 set a=2; --- error 1452 -update t2 set a=2; --- error 1451 -update t3 set a=2; --- error 1452 -update t4 set a=2; --- error ER_TRUNCATE_ILLEGAL_FK -truncate t1; --- error ER_TRUNCATE_ILLEGAL_FK -truncate t3; -truncate t2; -truncate t4; --- error ER_TRUNCATE_ILLEGAL_FK -truncate t1; --- error ER_TRUNCATE_ILLEGAL_FK -truncate t3; - -drop table t4,t3,t2,t1; - -# -# Test that we can create a large (>1K) key -# Moved to innodb_16k, innodb_8k, and innodb_4k -# since each page size has its own maximum key length. -# - -# test the padding of BINARY types and collations (Bug #14189) - -create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; -create table t2 (s1 binary(2),primary key (s1)) engine=innodb; -create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; -create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; - -insert into t1 values (0x41),(0x4120),(0x4100); --- error ER_DUP_ENTRY -insert into t2 values (0x41),(0x4120),(0x4100); -insert into t2 values (0x41),(0x4120); --- error ER_DUP_ENTRY -insert into t3 values (0x41),(0x4120),(0x4100); -insert into t3 values (0x41),(0x4100); --- error ER_DUP_ENTRY -insert into t4 values (0x41),(0x4120),(0x4100); -insert into t4 values (0x41),(0x4100); -select hex(s1) from t1; -select hex(s1) from t2; -select hex(s1) from t3; -select hex(s1) from t4; -drop table t1,t2,t3,t4; - -create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; -create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; - -insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); --- error 1452 -insert into t2 values(0x42); -insert into t2 values(0x41); -select hex(s1) from t2; -update t1 set s1=0x123456 where a=2; -select hex(s1) from t2; --- error 1451 -update t1 set s1=0x12 where a=1; -SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; --- error 1451 -update t1 set s1=0x12345678 where a=1; -SET sql_mode = default; --- error 1451 -update t1 set s1=0x123457 where a=1; -update t1 set s1=0x1220 where a=1; -select hex(s1) from t2; -update t1 set s1=0x1200 where a=1; -select hex(s1) from t2; -update t1 set s1=0x4200 where a=1; -select hex(s1) from t2; --- error 1451 -delete from t1 where a=1; -delete from t1 where a=2; -update t2 set s1=0x4120; --- error 1451 -delete from t1; -delete from t1 where a!=3; -select a,hex(s1) from t1; -select hex(s1) from t2; - -drop table t2,t1; - -create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; -create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; - -insert into t1 values(1,0x4100),(2,0x41); -insert into t2 values(0x41); -select hex(s1) from t2; -update t1 set s1=0x1234 where a=1; -select hex(s1) from t2; -update t1 set s1=0x12 where a=2; -select hex(s1) from t2; -delete from t1 where a=1; --- error 1451 -delete from t1 where a=2; -select a,hex(s1) from t1; -select hex(s1) from t2; - -drop table t2,t1; -# Ensure that _ibfk_0 is not mistreated as a -# generated foreign key identifier. (Bug #16387) - -CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; -CREATE TABLE t2(a INT) ENGINE=InnoDB; -ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); -ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; -ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); -ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; -SHOW CREATE TABLE t2; -DROP TABLE t2,t1; - -# -# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing -# -## the following cannot be tested after the introduction of metadata locks -## because the create trigger command blocks and waits for connection b to -## commit -## begin disabled_mdl -#connect (a,localhost,root,,); -#connect (b,localhost,root,,); -#connection a; -#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#insert into t1(a) values (1),(2),(3); -#commit; -#delimiter |; -## in 5.5+, this needs to be created before the UPDATE due to meta-data locking -#create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end | -#delimiter ;| -#connection b; -#set autocommit = 0; -#update t1 set b = 5 where a = 2; -#connection a; -#set autocommit = 0; -#connection a; -#insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100), -#(11),(21),(31),(41),(51),(61),(71),(81),(91),(101), -#(12),(22),(32),(42),(52),(62),(72),(82),(92),(102), -#(13),(23),(33),(43),(53),(63),(73),(83),(93),(103), -#(14),(24),(34),(44),(54),(64),(74),(84),(94),(104); -#connection b; -#commit; -#connection a; -#commit; -#drop trigger t1t; -#drop table t1; -#disconnect a; -#disconnect b; -## -## Another trigger test -## -#connect (a,localhost,root,,); -#connect (b,localhost,root,,); -#connection a; -#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb; -#insert into t1(a) values (1),(2),(3); -#insert into t2(a) values (1),(2),(3); -#insert into t3(a) values (1),(2),(3); -#insert into t4(a) values (1),(2),(3); -#insert into t3(a) values (5),(7),(8); -#insert into t4(a) values (5),(7),(8); -#insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); -# -#delimiter |; -#create trigger t1t before insert on t1 for each row begin -# INSERT INTO t2 SET a = NEW.a; -#end | -# -#create trigger t2t before insert on t2 for each row begin -# DELETE FROM t3 WHERE a = NEW.a; -#end | -# -#create trigger t3t before delete on t3 for each row begin -# UPDATE t4 SET b = b + 1 WHERE a = OLD.a; -#end | -# -#create trigger t4t before update on t4 for each row begin -# UPDATE t5 SET b = b + 1 where a = NEW.a; -#end | -#delimiter ;| -#commit; -#set autocommit = 0; -#update t1 set b = b + 5 where a = 1; -#update t2 set b = b + 5 where a = 1; -#update t3 set b = b + 5 where a = 1; -#update t4 set b = b + 5 where a = 1; -#insert into t5(a) values(20); -#connection b; -#set autocommit = 0; -#insert into t1(a) values(7); -#insert into t2(a) values(8); -#delete from t2 where a = 3; -#update t4 set b = b + 1 where a = 3; -#commit; -#connection a; -#drop trigger t1t; -#drop trigger t2t; -#drop trigger t3t; -#drop trigger t4t; -#drop table t1, t2, t3, t4, t5; -#connection default; -#disconnect a; -#disconnect b; -## end disabled_mdl - -# -# Test that cascading updates leading to duplicate keys give the correct -# error message (bug #9680) -# - -CREATE TABLE t1 ( - field1 varchar(8) NOT NULL DEFAULT '', - field2 varchar(8) NOT NULL DEFAULT '', - PRIMARY KEY (field1, field2) -) ENGINE=InnoDB; - -CREATE TABLE t2 ( - field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, - FOREIGN KEY (field1) REFERENCES t1 (field1) - ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB; - -INSERT INTO t1 VALUES ('old', 'somevalu'); -INSERT INTO t1 VALUES ('other', 'anyvalue'); - -INSERT INTO t2 VALUES ('old'); -INSERT INTO t2 VALUES ('other'); - ---error ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO -UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; - -DROP TABLE t2; -DROP TABLE t1; - -# -# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE -# -create table t1 ( - c1 bigint not null, - c2 bigint not null, - primary key (c1), - unique key (c2) -) engine=innodb; -# -create table t2 ( - c1 bigint not null, - primary key (c1) -) engine=innodb; -# -alter table t1 add constraint c2_fk foreign key (c2) - references t2(c1) on delete cascade; -show create table t1; -# -alter table t1 drop foreign key c2_fk; -show create table t1; -# -drop table t1, t2; - -# -# Bug #14360: problem with intervals -# - -create table t1(a date) engine=innodb; -create table t2(a date, key(a)) engine=innodb; -insert into t1 values('2005-10-01'); -insert into t2 values('2005-10-01'); -select * from t1, t2 - where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; -drop table t1, t2; - -create table t1 (id int not null, f_id int not null, f int not null, -primary key(f_id, id)) engine=innodb; -create table t2 (id int not null,s_id int not null,s varchar(200), -primary key(id)) engine=innodb; -INSERT INTO t1 VALUES (8, 1, 3); -INSERT INTO t1 VALUES (1, 2, 1); -INSERT INTO t2 VALUES (1, 0, ''); -INSERT INTO t2 VALUES (8, 1, ''); -commit; -DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) -WHERE mm.id IS NULL; -select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) -where mm.id is null lock in share mode; -drop table t1,t2; - -# -# Test case where X-locks on unused rows should be released in a -# update (because READ COMMITTED isolation level) -# - -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); -commit; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -update t1 set b = 5 where b = 1; -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -# -# X-lock to record (7,3) should be released in a update -# -select * from t1 where a = 7 and b = 3 for update; -connection a; -commit; -connection b; -commit; -drop table t1; -connection default; -disconnect a; -disconnect b; - -# -# Test case where no locks should be released (because we are not -# using READ COMMITTED isolation level) -# - -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); -commit; -set autocommit = 0; -select * from t1 lock in share mode; -update t1 set b = 5 where b = 1; -connection b; -set autocommit = 0; -# -# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update -# ---error ER_LOCK_WAIT_TIMEOUT -select * from t1 where a = 2 and b = 2 for update; -# -# X-lock to record (1,1),(3,1),(5,1) should not be released in a update -# ---error ER_LOCK_WAIT_TIMEOUT -connection a; -commit; -connection b; -commit; -connection default; -disconnect a; -disconnect b; -drop table t1; - -# -# Consistent read should be used in following selects -# -# 1) INSERT INTO ... SELECT -# 2) UPDATE ... = ( SELECT ...) -# 3) CREATE ... SELECT - -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values (1,2),(5,3),(4,2); -create table t2(d int not null, e int, primary key(d)) engine=innodb; -insert into t2 values (8,6),(12,1),(3,1); -commit; -set autocommit = 0; -select * from t2 for update; -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -insert into t1 select * from t2; -update t1 set b = (select e from t2 where a = d); -create table t3(d int not null, e int, primary key(d)) engine=innodb -select * from t2; -commit; -connection a; -commit; -connection default; -disconnect a; -disconnect b; -drop table t1, t2, t3; - -# -# Consistent read should not be used if -# -# (a) isolation level is serializable OR -# (b) select ... lock in share mode OR -# (c) select ... for update -# -# in following queries: -# -# 1) INSERT INTO ... SELECT -# 2) UPDATE ... = ( SELECT ...) -# 3) CREATE ... SELECT - -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connect (c,localhost,root,,); -connect (d,localhost,root,,); -connect (e,localhost,root,,); -connect (f,localhost,root,,); -connect (g,localhost,root,,); -connect (h,localhost,root,,); -connect (i,localhost,root,,); -connect (j,localhost,root,,); -connection a; -create table t1(a int not null, b int, primary key(a)) engine=innodb; -insert into t1 values (1,2),(5,3),(4,2); -create table t2(a int not null, b int, primary key(a)) engine=innodb; -insert into t2 values (8,6),(12,1),(3,1); -create table t3(d int not null, b int, primary key(d)) engine=innodb; -insert into t3 values (8,6),(12,1),(3,1); -create table t5(a int not null, b int, primary key(a)) engine=innodb; -insert into t5 values (1,2),(5,3),(4,2); -create table t6(d int not null, e int, primary key(d)) engine=innodb; -insert into t6 values (8,6),(12,1),(3,1); -create table t8(a int not null, b int, primary key(a)) engine=innodb; -insert into t8 values (1,2),(5,3),(4,2); -create table t9(d int not null, e int, primary key(d)) engine=innodb; -insert into t9 values (8,6),(12,1),(3,1); -commit; -set autocommit = 0; -select * from t2 for update; -connection b; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; ---send -insert into t1 select * from t2; -connection c; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; ---send -update t3 set b = (select b from t2 where a = d); -connection d; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; ---send -create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; -connection e; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -insert into t5 (select * from t2 lock in share mode); -connection f; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -update t6 set e = (select b from t2 where a = d lock in share mode); -connection g; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; -connection h; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -insert into t8 (select * from t2 for update); -connection i; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -update t9 set e = (select b from t2 where a = d for update); -connection j; -SET binlog_format='MIXED'; -set autocommit = 0; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---send -create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; - -connection b; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection c; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection d; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection e; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection f; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection g; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection h; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection i; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection j; ---error ER_LOCK_WAIT_TIMEOUT -reap; - -connection a; -commit; - -connection default; -disconnect a; -disconnect b; -disconnect c; -disconnect d; -disconnect e; -disconnect f; -disconnect g; -disconnect h; -disconnect i; -disconnect j; -drop table t1, t2, t3, t5, t6, t8, t9; - -# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID" ---error ER_WRONG_COLUMN_NAME -CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; - -# -# Bug #17152: Wrong result with BINARY comparison on aliased column -# - -CREATE TABLE t1 ( - a BIGINT(20) NOT NULL, - PRIMARY KEY (a) - ) ENGINE=INNODB DEFAULT CHARSET=UTF8; - -CREATE TABLE t2 ( - a BIGINT(20) NOT NULL, - b VARCHAR(128) NOT NULL, - c TEXT NOT NULL, - PRIMARY KEY (a,b), - KEY idx_t2_b_c (b,c(100)), - CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) - ON DELETE CASCADE - ) ENGINE=INNODB DEFAULT CHARSET=UTF8; - -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (1, 'bar', 'vbar'); -INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); -INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); -INSERT INTO t2 VALUES (1, 'customer_over', '1'); - -SELECT * FROM t2 WHERE b = 'customer_over'; -SELECT * FROM t2 WHERE BINARY b = 'customer_over'; -SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; -/* Bang: Empty result set, above was expected: */ -SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; -SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; - -drop table t2, t1; - -# -# Test optimize on table with open transaction -# - -CREATE TABLE t1 ( a int ) ENGINE=innodb; -BEGIN; -INSERT INTO t1 VALUES (1); -OPTIMIZE TABLE t1; -DROP TABLE t1; - -# -# Bug #24741 (existing cascade clauses disappear when adding foreign keys) -# - -CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; - -CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, - CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) - ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; - -ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON -DELETE CASCADE ON UPDATE CASCADE; - -SHOW CREATE TABLE t2; -DROP TABLE t2, t1; - -# -# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns -# for which there is a foreign key constraint ON ... SET NULL. -# - -CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; -CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (1); -ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; -# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on. ---error ER_FK_COLUMN_CANNOT_CHANGE -ALTER TABLE t2 MODIFY a INT NOT NULL; -DELETE FROM t1; -DROP TABLE t2,t1; - -# -# Bug #26835: table corruption after delete+insert -# - -CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) -ENGINE=InnoDB; -INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); -DELETE FROM t1; -INSERT INTO t1 VALUES ('DDD'); -SELECT * FROM t1; -DROP TABLE t1; - -# -# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables) -# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?)) -# - -CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB -AUTO_INCREMENT=42; - -INSERT INTO t1 VALUES (0),(347),(0); -SELECT * FROM t1; - -SHOW CREATE TABLE t1; - -CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; -INSERT INTO t2 VALUES(42),(347),(348); -ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); -SHOW CREATE TABLE t1; - -DROP TABLE t1,t2; - -# -# Bug #21101 (Prints wrong error message if max row size is too large) -# -SET innodb_strict_mode=ON; ---replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid} ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE t1 ( - c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), - c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), - c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), - c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), - c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), - c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), - c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), - c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) - ) ENGINE = InnoDB; -SET innodb_strict_mode=OFF; - -# -# Bug #31860 InnoDB assumes AUTOINC values can only be positive. -# -DROP TABLE IF EXISTS t1; -CREATE TABLE t1( - id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY - ) ENGINE=InnoDB; -INSERT INTO t1 VALUES(-10); -SELECT * FROM t1; -# -# NOTE: The server really needs to be restarted at this point -# for the test to be useful. -# -# Without the fix InnoDB would trip over an assertion here. -INSERT INTO t1 VALUES(NULL); -# The next value should be 1 and not -9 or a -ve number -SELECT * FROM t1; -DROP TABLE t1; - -# -# Bug #21409 Incorrect result returned when in READ-COMMITTED with -# query_cache ON -# -CONNECT (c1,localhost,root,,); -CONNECT (c2,localhost,root,,); -CONNECTION c1; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 ( a int ) ENGINE=InnoDB; -CREATE TABLE t2 LIKE t1; -SELECT * FROM t2; -CONNECTION c2; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -INSERT INTO t1 VALUES (1); -COMMIT; -CONNECTION c1; -SELECT * FROM t1 WHERE a=1; -DISCONNECT c1; -DISCONNECT c2; -CONNECT (c1,localhost,root,,); -CONNECT (c2,localhost,root,,); -CONNECTION c1; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -SELECT * FROM t2; -CONNECTION c2; -SET binlog_format='MIXED'; -SET TX_ISOLATION='read-committed'; -SET AUTOCOMMIT=0; -INSERT INTO t1 VALUES (2); -COMMIT; -CONNECTION c1; -# The result set below should be the same for both selects -SELECT * FROM t1 WHERE a=2; -SELECT * FROM t1 WHERE a=2; -DROP TABLE t1; -DROP TABLE t2; -DISCONNECT c1; -DISCONNECT c2; -CONNECTION default; - -# -# Bug #29157 UPDATE, changed rows incorrect -# -create table t1 (i int, j int) engine=innodb; -insert into t1 (i, j) values (1, 1), (2, 2); ---enable_info -update t1 set j = 2; ---disable_info -drop table t1; - -# -# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or -# I_S -# -set @save_innodb_file_per_table= @@global.innodb_file_per_table; -set @@global.innodb_file_per_table=0; -create table t1 (id int) comment='this is a comment' engine=innodb; -ANALYZE TABLE t1; -select table_comment, data_free > 0 as data_free_is_set - from information_schema.tables - where table_schema='test' and table_name = 't1'; -drop table t1; -set @@global.innodb_file_per_table= @save_innodb_file_per_table; - -# -# Bug 34920 test -# -CONNECTION default; -CREATE TABLE t1 ( - c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - c2 VARCHAR(128) NOT NULL, - PRIMARY KEY(c1) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; - -CREATE TABLE t2 ( - c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - c2 INT(10) UNSIGNED DEFAULT NULL, - PRIMARY KEY(c1) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; - -ANALYZE TABLE t2; -SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; -ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); -SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; -DROP TABLE t2; -DROP TABLE t1; -# End 34920 test -# -# Bug #29507 TRUNCATE shows to many rows effected -# -CONNECTION default; -CREATE TABLE t1 (c1 int default NULL, - c2 int default NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - ---enable_info -TRUNCATE TABLE t1; - -INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); -TRUNCATE TABLE t1; - ---disable_info -DROP TABLE t1; -# -# Bug#35537 Innodb doesn't increment handler_update and handler_delete. -# --- disable_query_log --- disable_result_log - -CONNECT (c1,localhost,root,,); - -DROP TABLE IF EXISTS bug35537; -CREATE TABLE bug35537 ( - c1 int -) ENGINE=InnoDB; - -INSERT INTO bug35537 VALUES (1); - --- enable_result_log - -SHOW SESSION STATUS LIKE 'Handler_update%'; -SHOW SESSION STATUS LIKE 'Handler_delete%'; - -UPDATE bug35537 SET c1 = 2 WHERE c1 = 1; -DELETE FROM bug35537 WHERE c1 = 2; - -SHOW SESSION STATUS LIKE 'Handler_update%'; -SHOW SESSION STATUS LIKE 'Handler_delete%'; - -DROP TABLE bug35537; - -DISCONNECT c1; -CONNECTION default; - -SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig; From 44e799590e1b685621b60a2701e33801b1b6c27a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 13 Dec 2016 12:55:18 +0100 Subject: [PATCH 103/135] buildbot issues * rpm upgrade fix * update test results * valgrind warning --- mysql-test/suite/funcs_1/r/myisam_views-big.result | 4 ++-- sql/table.cc | 2 +- support-files/rpm/server-prein.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index 0fbbfab9c1f..b6537582055 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -23219,7 +23219,7 @@ CREATE OR REPLACE VIEW test1.v20 AS SELECT f1, f2 FROM test3.t1 tab1 NATURAL JOIN test1.v19 tab2; SHOW CREATE VIEW test1.v20; View Create View character_set_client collation_connection -v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v20; f1 f2 @@ -23235,7 +23235,7 @@ CREATE VIEW test1.v21 AS SELECT f1, f2 FROM test3.t1 tab1 NATURAL JOIN test1.v20 tab2; SHOW CREATE VIEW test1.v21; View Create View character_set_client collation_connection -v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci +v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(`tab1`.`f1` = `tab2`.`f1` and `tab1`.`f2` = `tab2`.`f2`)) latin1 latin1_swedish_ci SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v21; f1 f2 diff --git a/sql/table.cc b/sql/table.cc index 9b312b593b4..71c70e2df2e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2875,7 +2875,7 @@ unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, TABLE *table, DBUG_ASSERT(vcol->expr == NULL); - if (parser_state.init(thd, expr_str->c_ptr(), expr_str->length())) + if (parser_state.init(thd, expr_str->c_ptr_safe(), expr_str->length())) goto end; if (init_lex_with_single_table(thd, table, &lex)) diff --git a/support-files/rpm/server-prein.sh b/support-files/rpm/server-prein.sh index 75f7e7d64cf..9f8d1229bfd 100644 --- a/support-files/rpm/server-prein.sh +++ b/support-files/rpm/server-prein.sh @@ -4,7 +4,7 @@ installed=`rpm -q --whatprovides mysql-server 2> /dev/null` if [ $? -eq 0 -a -n "$installed" ]; then installed=`echo "$installed"|sed -n 1p` - vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1` + vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1 | sed 's/Monty Program AB/MariaDB Foundation/'` version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` myvendor='%{mysql_vendor}' myversion='%{mysqlversion}' From e9ada862651fdb98f84871e4ec59bef1bb36646d Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 12 Dec 2016 16:42:25 +1100 Subject: [PATCH 104/135] Travis: add lib{stemmer,xml2,pcre3}-dev --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 273491ccc7c..3b609432e86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,9 +27,12 @@ addons: - libjudy-dev - libncurses5-dev - libpam0g-dev + - libpcre3-dev - libreadline-gplv2-dev + - libstemmer-dev - libssl-dev - libnuma-dev + - libxml2-dev - lsb-release - perl - po-debconf @@ -39,6 +42,11 @@ addons: - libjemalloc-dev - devscripts # implicit for any build on Ubuntu +# libsnappy-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3880 +# liblzma-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3879 +# libzmq-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3881 +# libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882 + script: - ${CC} --version ; ${CXX} --version - cd "${TRAVIS_BUILD_DIR}" From 441fa0056da27e83771a7d7ccd09da8b38f22417 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 14 Dec 2016 10:11:52 -0800 Subject: [PATCH 105/135] Fixed bug mdev-11488. The patch for bug mdev-10882 tried to fix it by providing an implementation of the virtual method build_clone for the class Item_cache. It's turned out that it is not easy provide a valid implementation for Item_cache::build_clone(). At the same time if the condition that can be pushed into a materialized view contains a cached item this item can be substituted for a basic constant of the same value. In such a way we can avoid building proper clones for Item_cache objects when constructing pushdown conditions. --- mysql-test/r/derived_cond_pushdown.result | 374 ++++++++++++++++++++++ mysql-test/t/derived_cond_pushdown.test | 106 ++++++ sql/item.cc | 73 +++++ sql/item.h | 22 +- 4 files changed, 566 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 5df1a8d7e6a..34e05911e82 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -7766,3 +7766,377 @@ EXPLAIN } DROP VIEW v; DROP TABLE t; +# +# MDEV-11488: pushdown of the predicate with cached value +# +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(3),(2); +CREATE TABLE t2 (j INT, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +3 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 3)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = 3)" + } + } + } + } + } +} +UPDATE t2 SET j = 2 WHERE j = 3; +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +2 +DROP TABLE t1,t2; +CREATE TABLE t1 (i FLOAT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1.5),(3.2),(2.71); +CREATE TABLE t2 (j FLOAT, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3.2),(2.71); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +2.71 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 2.7100000381469727)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = 2.7100000381469727)" + } + } + } + } + } +} +DROP TABLE t1,t2; +CREATE TABLE t1 (i DECIMAL(10,2)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1.5),(3.21),(2.47); +CREATE TABLE t2 (j DECIMAL(10,2), KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3.21),(4.55); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +3.21 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 3.21)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = 3.21)" + } + } + } + } + } +} +DROP TABLE t1,t2; +CREATE TABLE t1 (i VARCHAR(32)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('cc'),('aa'),('ddd'); +CREATE TABLE t2 (j VARCHAR(16), KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('bbb'),('aa'); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +aa +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 'aa')", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = 'aa')" + } + } + } + } + } +} +DROP TABLE t1,t2; +CREATE TABLE t1 (i DATETIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES +('2008-09-27 00:34:58'),('2007-05-28 00:00:00'), ('2009-07-25 09:21:20'); +CREATE TABLE t2 (j DATETIME, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES +('2007-05-28 00:00:00'), ('2010-08-25 00:00:00'); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +2007-05-28 00:00:00 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 2007-05-28 00:00:00)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = TIMESTAMP'2007-05-28 00:00:00')" + } + } + } + } + } +} +DROP TABLE t1,t2; +CREATE TABLE t1 (i DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('2008-09-27'),('2007-05-28'), ('2009-07-25'); +CREATE TABLE t2 (j DATE, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('2007-05-28'), ('2010-08-25'); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +2007-05-28 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 2007-05-28)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = TIMESTAMP'2007-05-28 00:00:00')" + } + } + } + } + } +} +DROP TABLE t1,t2; +CREATE TABLE t1 (i TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('00:34:58'),('10:00:02'), ('09:21:20'); +CREATE TABLE t2 (j TIME, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('10:00:02'), ('11:00:10'); +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +i +10:00:02 +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq +WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "system", + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "message": "Select tables optimized away" + } + } + } + }, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(sq.i = 10:00:02)", + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "(t1.i = TIME'10:00:02')" + } + } + } + } + } +} +DROP TABLE t1,t2; diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test index 2fb92b865c2..1457bd1f784 100644 --- a/mysql-test/t/derived_cond_pushdown.test +++ b/mysql-test/t/derived_cond_pushdown.test @@ -1166,4 +1166,110 @@ SELECT * FROM v AS v1, v AS v2 DROP VIEW v; DROP TABLE t; +--echo # +--echo # MDEV-11488: pushdown of the predicate with cached value +--echo # +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(3),(2); + +CREATE TABLE t2 (j INT, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +UPDATE t2 SET j = 2 WHERE j = 3; +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i FLOAT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1.5),(3.2),(2.71); + +CREATE TABLE t2 (j FLOAT, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3.2),(2.71); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i DECIMAL(10,2)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1.5),(3.21),(2.47); + +CREATE TABLE t2 (j DECIMAL(10,2), KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3.21),(4.55); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i VARCHAR(32)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('cc'),('aa'),('ddd'); + +CREATE TABLE t2 (j VARCHAR(16), KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('bbb'),('aa'); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i DATETIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES + ('2008-09-27 00:34:58'),('2007-05-28 00:00:00'), ('2009-07-25 09:21:20'); + +CREATE TABLE t2 (j DATETIME, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES + ('2007-05-28 00:00:00'), ('2010-08-25 00:00:00'); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('2008-09-27'),('2007-05-28'), ('2009-07-25'); + +CREATE TABLE t2 (j DATE, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('2007-05-28'), ('2010-08-25'); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (i TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('00:34:58'),('10:00:02'), ('09:21:20'); + +CREATE TABLE t2 (j TIME, KEY(j)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('10:00:02'), ('11:00:10'); + +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); +EXPLAIN FORMAT=JSON +SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq + WHERE i IN ( SELECT MIN(j) FROM t2 ); + +DROP TABLE t1,t2; diff --git a/sql/item.cc b/sql/item.cc index 880275ec997..ead45f84305 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -9406,6 +9406,17 @@ int Item_cache_int::save_in_field(Field *field, bool no_conversions) } +Item *Item_cache_int::convert_to_basic_const_item(THD *thd) +{ + Item *new_item; + DBUG_ASSERT(value_cached || example != 0); + new_item= null_value ? + (Item*) new (thd->mem_root) Item_null(thd) : + (Item*) new (thd->mem_root) Item_int(thd, val_int(), max_length); + return new_item; +} + + Item_cache_temporal::Item_cache_temporal(THD *thd, enum_field_types field_type_arg): Item_cache_int(thd, field_type_arg) @@ -9561,6 +9572,23 @@ Item *Item_cache_temporal::clone_item(THD *thd) } +Item *Item_cache_temporal::convert_to_basic_const_item(THD *thd) +{ + Item *new_item; + DBUG_ASSERT(value_cached || example != 0); + if (null_value) + new_item= (Item*) new (thd->mem_root) Item_null(thd); + else + { + MYSQL_TIME ltime; + unpack_time(val_datetime_packed(), <ime); + new_item= (Item*) new (thd->mem_root) Item_datetime_literal(thd, <ime, + decimals); + } + return new_item; +} + + bool Item_cache_real::cache_value() { if (!example) @@ -9609,6 +9637,18 @@ my_decimal *Item_cache_real::val_decimal(my_decimal *decimal_val) } +Item *Item_cache_real::convert_to_basic_const_item(THD *thd) +{ + Item *new_item; + DBUG_ASSERT(value_cached || example != 0); + new_item= null_value ? + (Item*) new (thd->mem_root) Item_null(thd) : + (Item*) new (thd->mem_root) Item_float(thd, val_real(), + decimals); + return new_item; +} + + bool Item_cache_decimal::cache_value() { if (!example) @@ -9660,6 +9700,19 @@ my_decimal *Item_cache_decimal::val_decimal(my_decimal *val) } +Item *Item_cache_decimal::convert_to_basic_const_item(THD *thd) +{ + Item *new_item; + my_decimal decimal_value; + my_decimal *result= val_decimal(&decimal_value); + DBUG_ASSERT(value_cached || example != 0); + new_item= null_value ? + (Item*) new (thd->mem_root) Item_null(thd) : + (Item*) new (thd->mem_root) Item_decimal(thd, result); + return new_item; +} + + bool Item_cache_str::cache_value() { if (!example) @@ -9739,6 +9792,26 @@ bool Item_cache_row::allocate(THD *thd, uint num) } +Item *Item_cache_str::convert_to_basic_const_item(THD *thd) +{ + Item *new_item; + char buff[MAX_FIELD_WIDTH]; + String tmp(buff, sizeof(buff), value->charset()); + String *result= val_str(&tmp); + DBUG_ASSERT(value_cached || example != 0); + if (null_value) + new_item= (Item*) new (thd->mem_root) Item_null(thd); + else + { + uint length= result->length(); + char *tmp_str= thd->strmake(result->ptr(), length); + new_item= new (thd->mem_root) Item_string(thd, tmp_str, length, + result->charset()); + } + return new_item; +} + + bool Item_cache_row::setup(THD *thd, Item *item) { example= item; diff --git a/sql/item.h b/sql/item.h index ac8f79116eb..5b3c3a6a0d5 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5422,15 +5422,14 @@ public: example->split_sum_func2(thd, ref_pointer_array, fields, &example, flags); } Item *get_example() const { return example; } - Item* build_clone(THD *thd, MEM_ROOT *mem_root) - { - Item_cache *copy= (Item_cache *) get_copy(thd, mem_root); - if (!copy) - return 0; - if (!( copy->example= example->build_clone(thd, mem_root))) - return 0; - return copy; - } + + virtual Item *convert_to_basic_const_item(THD *thd) { return 0; }; + Item *derived_field_transformer_for_having(THD *thd, uchar *arg) + { return convert_to_basic_const_item(thd); } + Item *derived_field_transformer_for_where(THD *thd, uchar *arg) + { return convert_to_basic_const_item(thd); } + Item *derived_grouping_field_transformer_for_where(THD *thd, uchar *arg) + { return convert_to_basic_const_item(thd); } }; @@ -5451,6 +5450,7 @@ public: enum Item_result result_type() const { return INT_RESULT; } bool cache_value(); int save_in_field(Field *field, bool no_conversions); + Item *convert_to_basic_const_item(THD *thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -5477,6 +5477,7 @@ public: Important when storing packed datetime values. */ Item *clone_item(THD *thd); + Item *convert_to_basic_const_item(THD *thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -5495,6 +5496,7 @@ public: my_decimal *val_decimal(my_decimal *); enum Item_result result_type() const { return REAL_RESULT; } bool cache_value(); + Item *convert_to_basic_const_item(THD *thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -5513,6 +5515,7 @@ public: my_decimal *val_decimal(my_decimal *); enum Item_result result_type() const { return DECIMAL_RESULT; } bool cache_value(); + Item *convert_to_basic_const_item(THD *thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; @@ -5541,6 +5544,7 @@ public: CHARSET_INFO *charset() const { return value->charset(); }; int save_in_field(Field *field, bool no_conversions); bool cache_value(); + Item *convert_to_basic_const_item(THD *thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } }; From 5cf6fd3e3927a4b99ede8b0c937039b569eb4072 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 14 Dec 2016 12:11:02 -0800 Subject: [PATCH 106/135] Adjusted test results after merge. --- mysql-test/r/derived_cond_pushdown.result | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 34e05911e82..7c672c12f03 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -7804,7 +7804,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 3)", + "attached_condition": "sq.i = 3", "materialized": { "query_block": { "select_id": 2, @@ -7813,7 +7813,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = 3)" + "attached_condition": "t1.i = 3" } } } @@ -7861,7 +7861,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 2.7100000381469727)", + "attached_condition": "sq.i = 2.7100000381469727", "materialized": { "query_block": { "select_id": 2, @@ -7870,7 +7870,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = 2.7100000381469727)" + "attached_condition": "t1.i = 2.7100000381469727" } } } @@ -7913,7 +7913,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 3.21)", + "attached_condition": "sq.i = 3.21", "materialized": { "query_block": { "select_id": 2, @@ -7922,7 +7922,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = 3.21)" + "attached_condition": "t1.i = 3.21" } } } @@ -7965,7 +7965,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 'aa')", + "attached_condition": "sq.i = 'aa'", "materialized": { "query_block": { "select_id": 2, @@ -7974,7 +7974,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = 'aa')" + "attached_condition": "t1.i = 'aa'" } } } @@ -8019,7 +8019,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 2007-05-28 00:00:00)", + "attached_condition": "sq.i = 2007-05-28 00:00:00", "materialized": { "query_block": { "select_id": 2, @@ -8028,7 +8028,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = TIMESTAMP'2007-05-28 00:00:00')" + "attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'" } } } @@ -8071,7 +8071,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 2007-05-28)", + "attached_condition": "sq.i = 2007-05-28", "materialized": { "query_block": { "select_id": 2, @@ -8080,7 +8080,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = TIMESTAMP'2007-05-28 00:00:00')" + "attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'" } } } @@ -8123,7 +8123,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(sq.i = 10:00:02)", + "attached_condition": "sq.i = 10:00:02", "materialized": { "query_block": { "select_id": 2, @@ -8132,7 +8132,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "(t1.i = TIME'10:00:02')" + "attached_condition": "t1.i = TIME'10:00:02'" } } } From a1833ac5cc00ea9b245390688ef2ba86bdee9a1b Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 15 Dec 2016 02:34:02 +0200 Subject: [PATCH 107/135] Follow-up for 180065ebb0 - removal of redundant parentheses --- .../suite/engines/iuds/r/type_bit_iuds.result | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result index df43e8ed8d2..5051293e238 100644 --- a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result +++ b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result @@ -10239,11 +10239,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 000 @@ -21468,11 +21468,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 111 @@ -32709,11 +32709,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 222 @@ -43956,11 +43956,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 62273127622730316227313027 @@ -55215,11 +55215,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 62273127622730316227313027 @@ -66496,11 +66496,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 2AAAAAAA2AAAAAAA2AAAAAAA @@ -77759,11 +77759,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 62273127622730316227313027 @@ -89028,11 +89028,11 @@ FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 1777777777777777777777 1111111111111111111111111111111111111111111111111111111111111111 FFFFFFFFFFFFFFFF 610471403046014230061 1111111111111111111111111111111111111111111111111111111111111111 SELECT HEX(c1+0),HEX(c2+1),HEX(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT OCT(c1+0),OCT(c2+1),OCT(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT BIN(c1+0),BIN(c2+1),BIN(c3+2) FROM t2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`c2` + 1)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '`test`.`t2`.`c2` + 1' SELECT CONCAT(HEX(c1),HEX(c2),HEX(c3)) FROM t2; CONCAT(HEX(c1),HEX(c2),HEX(c3)) 62273127622730316227313027 From 9213ac8fd8fde72f2ecbf831bc657941964f8387 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 15 Dec 2016 02:35:31 +0200 Subject: [PATCH 108/135] Follow-up for a411d7f4f6 - change in formatting of SHOW CREATE TABLE --- .../funcs/r/ix_index_non_string.result | 2 +- .../funcs/r/ix_unique_non_string.result | 2 +- .../funcs/r/ta_2part_column_to_pk.result | 4 +- .../funcs/r/ta_2part_diff_to_pk.result | 124 +++++++-------- .../funcs/r/ta_3part_column_to_pk.result | 4 +- .../engines/funcs/r/ta_add_column.result | 142 +++++++++--------- .../engines/funcs/r/ta_add_column2.result | 8 +- .../funcs/r/ta_add_column_first.result | 92 ++++++------ .../funcs/r/ta_add_column_first2.result | 8 +- .../funcs/r/ta_add_column_middle.result | 142 +++++++++--------- .../funcs/r/ta_add_column_middle2.result | 8 +- .../engines/funcs/r/ta_add_string2.result | 16 +- .../funcs/r/ta_add_string_first2.result | 16 +- .../funcs/r/ta_add_string_middle2.result | 32 ++-- .../funcs/r/ta_add_unique_index.result | 72 ++++----- .../engines/funcs/r/ta_column_to_index.result | 48 +++--- .../funcs/r/ta_column_to_not_null.result | 4 +- .../engines/funcs/r/ta_column_to_null.result | 4 +- .../engines/funcs/r/ta_column_to_pk.result | 4 +- .../engines/funcs/r/ta_drop_column.result | 8 +- .../engines/funcs/r/ta_drop_index.result | 24 +-- .../engines/funcs/r/ta_drop_pk_number.result | 4 +- .../suite/engines/funcs/r/ta_rename.result | 8 +- .../engines/funcs/r/tc_column_key.result | 2 +- .../engines/funcs/r/tc_column_not_null.result | 2 +- .../r/tc_column_primary_key_number.result | 2 +- .../funcs/r/tc_column_unique_key.result | 2 +- .../funcs/r/tc_temporary_column.result | 2 +- 28 files changed, 393 insertions(+), 393 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/ix_index_non_string.result b/mysql-test/suite/engines/funcs/r/ix_index_non_string.result index 1811d926851..908327b1513 100644 --- a/mysql-test/suite/engines/funcs/r/ix_index_non_string.result +++ b/mysql-test/suite/engines/funcs/r/ix_index_non_string.result @@ -427,7 +427,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ix_unique_non_string.result b/mysql-test/suite/engines/funcs/r/ix_unique_non_string.result index ee6fe0a2eeb..c9f1040c151 100644 --- a/mysql-test/suite/engines/funcs/r/ix_unique_non_string.result +++ b/mysql-test/suite/engines/funcs/r/ix_unique_non_string.result @@ -427,7 +427,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_2part_column_to_pk.result b/mysql-test/suite/engines/funcs/r/ta_2part_column_to_pk.result index a4d134d9495..5513053491d 100644 --- a/mysql-test/suite/engines/funcs/r/ta_2part_column_to_pk.result +++ b/mysql-test/suite/engines/funcs/r/ta_2part_column_to_pk.result @@ -342,7 +342,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD PRIMARY KEY (c1,c2); @@ -352,7 +352,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`,`c2`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/engines/funcs/r/ta_2part_diff_to_pk.result b/mysql-test/suite/engines/funcs/r/ta_2part_diff_to_pk.result index 59f476f3750..03651dcfde0 100644 --- a/mysql-test/suite/engines/funcs/r/ta_2part_diff_to_pk.result +++ b/mysql-test/suite/engines/funcs/r/ta_2part_diff_to_pk.result @@ -398,7 +398,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bit(1) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -410,7 +410,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bit(1) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -846,7 +846,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` tinyint(4) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -858,7 +858,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` tinyint(4) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -1294,7 +1294,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` smallint(6) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -1306,7 +1306,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` smallint(6) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -1742,7 +1742,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` mediumint(9) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -1754,7 +1754,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` mediumint(9) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -2190,7 +2190,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -2202,7 +2202,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -2638,7 +2638,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -2650,7 +2650,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -3086,7 +3086,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bigint(20) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -3098,7 +3098,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bigint(20) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -3534,7 +3534,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -3546,7 +3546,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -3982,7 +3982,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -3994,7 +3994,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -4430,7 +4430,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` float NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -4442,7 +4442,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` float NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -4878,7 +4878,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -4890,7 +4890,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -5326,7 +5326,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -5338,7 +5338,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -5774,7 +5774,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` date NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -5786,7 +5786,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` date NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -6222,7 +6222,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` time NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -6234,7 +6234,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` time NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -6279,7 +6279,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6291,7 +6291,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6307,7 +6307,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6319,7 +6319,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6335,7 +6335,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6347,7 +6347,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6363,7 +6363,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6375,7 +6375,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6391,7 +6391,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6403,7 +6403,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6419,7 +6419,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6431,7 +6431,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6447,7 +6447,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6459,7 +6459,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6475,7 +6475,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6487,7 +6487,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6503,7 +6503,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6515,7 +6515,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6531,7 +6531,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6543,7 +6543,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6559,7 +6559,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6571,7 +6571,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6587,7 +6587,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6599,7 +6599,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6615,7 +6615,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6627,7 +6627,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6643,7 +6643,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6655,7 +6655,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -6670,7 +6670,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -6682,7 +6682,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, @@ -6699,7 +6699,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6711,7 +6711,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, PRIMARY KEY (`c1`,`c2`) @@ -7118,7 +7118,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` year(4) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL @@ -7130,7 +7130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` year(4) NOT NULL, `c3` int(11) DEFAULT NULL, `c4` varchar(10) NOT NULL, diff --git a/mysql-test/suite/engines/funcs/r/ta_3part_column_to_pk.result b/mysql-test/suite/engines/funcs/r/ta_3part_column_to_pk.result index ed477738ae3..ee57ab00455 100644 --- a/mysql-test/suite/engines/funcs/r/ta_3part_column_to_pk.result +++ b/mysql-test/suite/engines/funcs/r/ta_3part_column_to_pk.result @@ -370,7 +370,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -381,7 +381,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`,`c2`,`c3`) diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column.result b/mysql-test/suite/engines/funcs/r/ta_add_column.result index 2dcbc272464..0600180ee0c 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column.result @@ -842,7 +842,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NOT NULL; SHOW TABLES; @@ -851,7 +851,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bit(1) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1898,7 +1898,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NOT NULL; SHOW TABLES; @@ -1907,7 +1907,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` tinyint(4) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2954,7 +2954,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NOT NULL; SHOW TABLES; @@ -2963,7 +2963,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` smallint(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4010,7 +4010,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NOT NULL; SHOW TABLES; @@ -4019,7 +4019,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` mediumint(9) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5066,7 +5066,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NOT NULL; SHOW TABLES; @@ -5075,7 +5075,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6122,7 +6122,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NOT NULL; SHOW TABLES; @@ -6131,7 +6131,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7178,7 +7178,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NOT NULL; SHOW TABLES; @@ -7187,7 +7187,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` bigint(20) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8234,7 +8234,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NOT NULL; SHOW TABLES; @@ -8243,7 +8243,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9290,7 +9290,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NOT NULL; SHOW TABLES; @@ -9299,7 +9299,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` double NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10346,7 +10346,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NOT NULL; SHOW TABLES; @@ -10355,7 +10355,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` float NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11402,7 +11402,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NOT NULL; SHOW TABLES; @@ -11411,7 +11411,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12458,7 +12458,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NOT NULL; SHOW TABLES; @@ -12467,7 +12467,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` decimal(10,0) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13514,7 +13514,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NOT NULL; SHOW TABLES; @@ -13523,7 +13523,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` date NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14570,7 +14570,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NOT NULL; SHOW TABLES; @@ -14579,7 +14579,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` time NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15328,7 +15328,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15350,7 +15350,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15372,7 +15372,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15394,7 +15394,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15416,7 +15416,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15438,7 +15438,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15460,7 +15460,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15482,7 +15482,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15504,7 +15504,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15526,7 +15526,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15548,7 +15548,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15570,7 +15570,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15592,7 +15592,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15614,7 +15614,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15626,7 +15626,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NOT NULL; SHOW TABLES; @@ -15635,7 +15635,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15658,7 +15658,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15680,7 +15680,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyblob NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15702,7 +15702,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` blob NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15724,7 +15724,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumblob NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15746,7 +15746,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` longblob NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15768,7 +15768,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinytext NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15790,7 +15790,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` text NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15812,7 +15812,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumtext NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15834,7 +15834,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` longtext NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16682,7 +16682,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NOT NULL; SHOW TABLES; @@ -16691,7 +16691,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` year(4) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17738,7 +17738,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NOT NULL; SHOW TABLES; @@ -17747,7 +17747,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` tinyblob NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18794,7 +18794,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NOT NULL; SHOW TABLES; @@ -18803,7 +18803,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` blob NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19850,7 +19850,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NOT NULL; SHOW TABLES; @@ -19859,7 +19859,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` mediumblob NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20906,7 +20906,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NOT NULL; SHOW TABLES; @@ -20915,7 +20915,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` longblob NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21962,7 +21962,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NOT NULL; SHOW TABLES; @@ -21971,7 +21971,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` tinytext NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23018,7 +23018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NOT NULL; SHOW TABLES; @@ -23027,7 +23027,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` text NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24074,7 +24074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NOT NULL; SHOW TABLES; @@ -24083,7 +24083,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` mediumtext NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -25130,7 +25130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NOT NULL; SHOW TABLES; @@ -25139,7 +25139,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` longtext NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column2.result b/mysql-test/suite/engines/funcs/r/ta_add_column2.result index 1a1d074af21..cf376f736fb 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column2.result @@ -2568,7 +2568,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2590,7 +2590,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2612,7 +2612,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2634,7 +2634,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_first.result b/mysql-test/suite/engines/funcs/r/ta_add_column_first.result index 1fd73d3507d..6007bbe4de6 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_first.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_first.result @@ -842,7 +842,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NOT NULL FIRST; SHOW TABLES; @@ -852,7 +852,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1898,7 +1898,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NOT NULL FIRST; SHOW TABLES; @@ -1908,7 +1908,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2954,7 +2954,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NOT NULL FIRST; SHOW TABLES; @@ -2964,7 +2964,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4010,7 +4010,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NOT NULL FIRST; SHOW TABLES; @@ -4020,7 +4020,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5066,7 +5066,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NOT NULL FIRST; SHOW TABLES; @@ -5076,7 +5076,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6122,7 +6122,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NOT NULL FIRST; SHOW TABLES; @@ -6132,7 +6132,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7178,7 +7178,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NOT NULL FIRST; SHOW TABLES; @@ -7188,7 +7188,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8234,7 +8234,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NOT NULL FIRST; SHOW TABLES; @@ -8244,7 +8244,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9290,7 +9290,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NOT NULL FIRST; SHOW TABLES; @@ -9300,7 +9300,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10346,7 +10346,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NOT NULL FIRST; SHOW TABLES; @@ -10356,7 +10356,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11402,7 +11402,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NOT NULL FIRST; SHOW TABLES; @@ -11412,7 +11412,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12458,7 +12458,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NOT NULL FIRST; SHOW TABLES; @@ -12468,7 +12468,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13514,7 +13514,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NOT NULL FIRST; SHOW TABLES; @@ -13524,7 +13524,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14570,7 +14570,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NOT NULL FIRST; SHOW TABLES; @@ -14580,7 +14580,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15626,7 +15626,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NOT NULL FIRST; SHOW TABLES; @@ -15636,7 +15636,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16682,7 +16682,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NOT NULL FIRST; SHOW TABLES; @@ -16692,7 +16692,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyblob NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17738,7 +17738,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NOT NULL FIRST; SHOW TABLES; @@ -17748,7 +17748,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` blob NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18794,7 +18794,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NOT NULL FIRST; SHOW TABLES; @@ -18804,7 +18804,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumblob NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19850,7 +19850,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NOT NULL FIRST; SHOW TABLES; @@ -19860,7 +19860,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` longblob NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20906,7 +20906,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NOT NULL FIRST; SHOW TABLES; @@ -20916,7 +20916,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinytext NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21962,7 +21962,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NOT NULL FIRST; SHOW TABLES; @@ -21972,7 +21972,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` text NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23018,7 +23018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NOT NULL FIRST; SHOW TABLES; @@ -23028,7 +23028,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumtext NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24074,7 +24074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NOT NULL FIRST; SHOW TABLES; @@ -24084,7 +24084,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` longtext NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result b/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result index 8c0871e4f77..5555215a5ec 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result @@ -2567,7 +2567,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c1` char(15) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2589,7 +2589,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c1` varchar(15) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2611,7 +2611,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c1` binary(15) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2633,7 +2633,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c1` varbinary(15) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result b/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result index 75deecf05b7..47c17aba9ab 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result @@ -1071,7 +1071,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1083,7 +1083,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` bit(1) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -2415,7 +2415,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2427,7 +2427,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` tinyint(4) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -3759,7 +3759,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3771,7 +3771,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` smallint(6) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -5103,7 +5103,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5115,7 +5115,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` mediumint(9) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -6447,7 +6447,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6459,7 +6459,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` int(11) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -7791,7 +7791,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7803,7 +7803,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` int(11) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -9135,7 +9135,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9147,7 +9147,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` bigint(20) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -10479,7 +10479,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10491,7 +10491,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` double NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -11823,7 +11823,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11835,7 +11835,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` double NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -13167,7 +13167,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13179,7 +13179,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` float NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -14511,7 +14511,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14523,7 +14523,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` decimal(10,0) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -15855,7 +15855,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15867,7 +15867,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` decimal(10,0) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -17199,7 +17199,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17211,7 +17211,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` date NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -18543,7 +18543,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18555,7 +18555,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` time NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -19508,7 +19508,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` bit(1) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19536,7 +19536,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` tinyint(4) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19564,7 +19564,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` smallint(6) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19592,7 +19592,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` mediumint(9) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19620,7 +19620,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19648,7 +19648,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` int(11) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19676,7 +19676,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` bigint(20) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19704,7 +19704,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` double NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19732,7 +19732,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` double NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19760,7 +19760,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` float NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19788,7 +19788,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` decimal(10,0) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19816,7 +19816,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` decimal(10,0) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19844,7 +19844,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` date NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19872,7 +19872,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` time NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19887,7 +19887,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19899,7 +19899,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -19928,7 +19928,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` year(4) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19956,7 +19956,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyblob NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` tinyblob NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19984,7 +19984,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` blob NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` blob NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20012,7 +20012,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumblob NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` mediumblob NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20040,7 +20040,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` longblob NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` longblob NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20068,7 +20068,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinytext NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` tinytext NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20096,7 +20096,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` text NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` text NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20124,7 +20124,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumtext NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` mediumtext NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20152,7 +20152,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` longtext NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` longtext NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21231,7 +21231,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21243,7 +21243,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` year(4) NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -22575,7 +22575,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22587,7 +22587,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` tinyblob NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -23919,7 +23919,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23931,7 +23931,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` blob NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -25263,7 +25263,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25275,7 +25275,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` mediumblob NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -26607,7 +26607,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26619,7 +26619,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` longblob NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -27951,7 +27951,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27963,7 +27963,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` tinytext NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -29295,7 +29295,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29307,7 +29307,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` text NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -30639,7 +30639,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30651,7 +30651,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` mediumtext NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) @@ -31983,7 +31983,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31995,7 +31995,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c4` longtext NOT NULL, `c3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`c1`) diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result b/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result index 5303ee0ce71..3b903781d91 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result @@ -3268,7 +3268,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` char(20) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3296,7 +3296,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` varchar(20) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3324,7 +3324,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` binary(20) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3352,7 +3352,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c3` varbinary(20) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/engines/funcs/r/ta_add_string2.result b/mysql-test/suite/engines/funcs/r/ta_add_string2.result index 82c4f5ff75b..d17f66523f7 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_string2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_string2.result @@ -842,7 +842,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NOT NULL; SHOW TABLES; @@ -851,7 +851,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` char(5) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1898,7 +1898,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NOT NULL; SHOW TABLES; @@ -1907,7 +1907,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` varchar(5) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2954,7 +2954,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NOT NULL; SHOW TABLES; @@ -2963,7 +2963,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` binary(5) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -4010,7 +4010,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NOT NULL; SHOW TABLES; @@ -4019,7 +4019,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` varbinary(5) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result b/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result index 8b2ad0d98b9..6298df8d18d 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result @@ -842,7 +842,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NOT NULL FIRST; SHOW TABLES; @@ -852,7 +852,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1898,7 +1898,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NOT NULL FIRST; SHOW TABLES; @@ -1908,7 +1908,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2954,7 +2954,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NOT NULL FIRST; SHOW TABLES; @@ -2964,7 +2964,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -4010,7 +4010,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NOT NULL FIRST; SHOW TABLES; @@ -4020,7 +4020,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) NOT NULL, - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_string_middle2.result b/mysql-test/suite/engines/funcs/r/ta_add_string_middle2.result index 8a032e4108b..593090236fe 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_string_middle2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_string_middle2.result @@ -398,7 +398,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` char(10) DEFAULT NULL, PRIMARY KEY (`c1`) @@ -410,7 +410,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` char(5) DEFAULT NULL, `c3` char(10) DEFAULT NULL, @@ -846,7 +846,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` char(10) NOT NULL, PRIMARY KEY (`c1`) @@ -858,7 +858,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` char(5) NOT NULL, `c3` char(10) NOT NULL, @@ -1294,7 +1294,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` varchar(10) DEFAULT NULL, PRIMARY KEY (`c1`) @@ -1306,7 +1306,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` varchar(5) DEFAULT NULL, `c3` varchar(10) DEFAULT NULL, @@ -1742,7 +1742,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` varchar(10) NOT NULL, PRIMARY KEY (`c1`) @@ -1754,7 +1754,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` varchar(5) NOT NULL, `c3` varchar(10) NOT NULL, @@ -2190,7 +2190,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` binary(10) DEFAULT NULL, PRIMARY KEY (`c1`) @@ -2202,7 +2202,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` binary(5) DEFAULT NULL, `c3` binary(10) DEFAULT NULL, @@ -2638,7 +2638,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` binary(10) NOT NULL, PRIMARY KEY (`c1`) @@ -2650,7 +2650,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` binary(5) NOT NULL, `c3` binary(10) NOT NULL, @@ -3086,7 +3086,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` varbinary(10) DEFAULT NULL, PRIMARY KEY (`c1`) @@ -3098,7 +3098,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` varbinary(5) DEFAULT NULL, `c3` varbinary(10) DEFAULT NULL, @@ -3534,7 +3534,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c3` varbinary(10) NOT NULL, PRIMARY KEY (`c1`) @@ -3546,7 +3546,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` int(11) NOT NULL, `c4` varbinary(5) NOT NULL, `c3` varbinary(10) NOT NULL, diff --git a/mysql-test/suite/engines/funcs/r/ta_add_unique_index.result b/mysql-test/suite/engines/funcs/r/ta_add_unique_index.result index 2a7f3684541..f963adbe673 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_unique_index.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_unique_index.result @@ -314,7 +314,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE (c1); SHOW TABLES; @@ -323,7 +323,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -666,7 +666,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE KEY (c1); SHOW TABLES; @@ -675,7 +675,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1018,7 +1018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE INDEX (c1); SHOW TABLES; @@ -1027,7 +1027,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1370,7 +1370,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE (c1); SHOW TABLES; @@ -1379,7 +1379,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1722,7 +1722,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY (c1); SHOW TABLES; @@ -1731,7 +1731,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2074,7 +2074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE INDEX (c1); SHOW TABLES; @@ -2083,7 +2083,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2426,7 +2426,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE (c1); SHOW TABLES; @@ -2435,7 +2435,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `cst1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2778,7 +2778,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE KEY (c1); SHOW TABLES; @@ -2787,7 +2787,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `cst1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3130,7 +3130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE INDEX (c1); SHOW TABLES; @@ -3139,7 +3139,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `cst1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3482,7 +3482,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE i1 (c1); SHOW TABLES; @@ -3491,7 +3491,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3834,7 +3834,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE KEY i1 (c1); SHOW TABLES; @@ -3843,7 +3843,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4186,7 +4186,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD UNIQUE INDEX i1 (c1); SHOW TABLES; @@ -4195,7 +4195,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4538,7 +4538,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE i1 (c1); SHOW TABLES; @@ -4547,7 +4547,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4890,7 +4890,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1 (c1); SHOW TABLES; @@ -4899,7 +4899,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5242,7 +5242,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT UNIQUE INDEX i1 (c1); SHOW TABLES; @@ -5251,7 +5251,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5594,7 +5594,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE i1 (c1); SHOW TABLES; @@ -5603,7 +5603,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5946,7 +5946,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE KEY i1 (c1); SHOW TABLES; @@ -5955,7 +5955,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6298,7 +6298,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD CONSTRAINT cst1 UNIQUE INDEX i1 (c1); SHOW TABLES; @@ -6307,7 +6307,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_index.result b/mysql-test/suite/engines/funcs/r/ta_column_to_index.result index 41dcf1f8549..88986855ec2 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_index.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_index.result @@ -314,7 +314,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY (c1); SHOW TABLES; @@ -323,7 +323,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -666,7 +666,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY USING BTREE (c1); SHOW TABLES; @@ -675,7 +675,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) USING BTREE ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1018,7 +1018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY USING HASH (c1); SHOW TABLES; @@ -1027,7 +1027,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) USING HASH ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1370,7 +1370,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX (c1); SHOW TABLES; @@ -1379,7 +1379,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1722,7 +1722,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX USING BTREE (c1); SHOW TABLES; @@ -1731,7 +1731,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) USING BTREE ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2074,7 +2074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX USING HASH (c1); SHOW TABLES; @@ -2083,7 +2083,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `c1` (`c1`) USING HASH ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2426,7 +2426,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY i1 (c1); SHOW TABLES; @@ -2435,7 +2435,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2778,7 +2778,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY i1 USING BTREE (c1); SHOW TABLES; @@ -2787,7 +2787,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) USING BTREE ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3130,7 +3130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD KEY i1 USING HASH (c1); SHOW TABLES; @@ -3139,7 +3139,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) USING HASH ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3482,7 +3482,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX i1 (c1); SHOW TABLES; @@ -3491,7 +3491,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3834,7 +3834,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX i1 USING BTREE (c1); SHOW TABLES; @@ -3843,7 +3843,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) USING BTREE ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4186,7 +4186,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD INDEX i1 USING HASH (c1); SHOW TABLES; @@ -4195,7 +4195,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) USING HASH ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result b/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result index 6538ebe1102..af6f47bdf45 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result @@ -309,7 +309,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -813,7 +813,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_null.result b/mysql-test/suite/engines/funcs/r/ta_column_to_null.result index 55f9d589185..04850bedf1b 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_null.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_null.result @@ -300,7 +300,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t2 MODIFY c1 TIMESTAMP NULL; SHOW TABLES; @@ -804,7 +804,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t2 CHANGE c1 c1 TIMESTAMP NULL; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_pk.result b/mysql-test/suite/engines/funcs/r/ta_column_to_pk.result index ed3a17495f1..c76df99b424 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_pk.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_pk.result @@ -314,7 +314,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD PRIMARY KEY (c1); SHOW TABLES; @@ -323,7 +323,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_drop_column.result b/mysql-test/suite/engines/funcs/r/ta_drop_column.result index eb5b118785b..b650da1fdf3 100644 --- a/mysql-test/suite/engines/funcs/r/ta_drop_column.result +++ b/mysql-test/suite/engines/funcs/r/ta_drop_column.result @@ -300,7 +300,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP c2; @@ -309,7 +309,7 @@ ERROR 42000: You can't delete all columns with ALTER TABLE; use DROP TABLE inste SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -636,7 +636,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP COLUMN c2; @@ -645,7 +645,7 @@ ERROR 42000: You can't delete all columns with ALTER TABLE; use DROP TABLE inste SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_drop_index.result b/mysql-test/suite/engines/funcs/r/ta_drop_index.result index 9e1f268bf25..1dface5be50 100644 --- a/mysql-test/suite/engines/funcs/r/ta_drop_index.result +++ b/mysql-test/suite/engines/funcs/r/ta_drop_index.result @@ -314,7 +314,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP KEY i1; @@ -324,7 +324,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -666,7 +666,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP KEY i1; @@ -676,7 +676,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1018,7 +1018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP KEY i1; @@ -1028,7 +1028,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1370,7 +1370,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP INDEX i1; @@ -1380,7 +1380,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1722,7 +1722,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP INDEX i1; @@ -1732,7 +1732,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2074,7 +2074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), KEY `i1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP INDEX i1; @@ -2084,7 +2084,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_drop_pk_number.result b/mysql-test/suite/engines/funcs/r/ta_drop_pk_number.result index 615c861d50d..554037236cc 100644 --- a/mysql-test/suite/engines/funcs/r/ta_drop_pk_number.result +++ b/mysql-test/suite/engines/funcs/r/ta_drop_pk_number.result @@ -314,7 +314,7 @@ t9 SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t9 DROP PRIMARY KEY; @@ -324,7 +324,7 @@ t9 SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t9; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_rename.result b/mysql-test/suite/engines/funcs/r/ta_rename.result index f9e78428f9e..f3d2a4aa514 100644 --- a/mysql-test/suite/engines/funcs/r/ta_rename.result +++ b/mysql-test/suite/engines/funcs/r/ta_rename.result @@ -356,7 +356,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 RENAME t2; @@ -368,7 +368,7 @@ ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; @@ -756,7 +756,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 RENAME TO t2; @@ -768,7 +768,7 @@ ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `c2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_key.result b/mysql-test/suite/engines/funcs/r/tc_column_key.result index 0751f981178..dd7b96787e2 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_key.result @@ -227,7 +227,7 @@ t9 SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t9; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_not_null.result b/mysql-test/suite/engines/funcs/r/tc_column_not_null.result index 62a5f5e8d16..2faf94fa930 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_not_null.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_not_null.result @@ -210,7 +210,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_primary_key_number.result b/mysql-test/suite/engines/funcs/r/tc_column_primary_key_number.result index 91c2f4f8a7c..16337051d2d 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_primary_key_number.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_primary_key_number.result @@ -227,7 +227,7 @@ t9 SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t9; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_unique_key.result b/mysql-test/suite/engines/funcs/r/tc_column_unique_key.result index e4892c7fb86..baba2510e5a 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_unique_key.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_unique_key.result @@ -227,7 +227,7 @@ t9 SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), UNIQUE KEY `c1` (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t9; diff --git a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result index 84eae4fc468..d2e5152070c 100644 --- a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result +++ b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result @@ -500,7 +500,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; From e14bdcb81c88156ce5e413865f7fe124321120eb Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 24 Aug 2016 13:29:09 +1000 Subject: [PATCH 109/135] travis: gcc-5 and gcc-6 --- .travis.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3b609432e86..7677661587a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,21 @@ cache: - apt - ccache +env: + matrix: + - GCC_VERSION=5 + - GCC_VERSION=6 addons: apt: + sources: + - ubuntu-toolchain-r-test +# - llvm-toolchain-trusty-3.8 +# - llvm-toolchain-trusty-3.9 packages: # make sure these match debian/control contents + - gcc-5 + - g++-5 + - gcc-6 + - g++-6 - bison - chrpath - cmake @@ -48,7 +60,8 @@ addons: # libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882 script: - - ${CC} --version ; ${CXX} --version + - export MYSQL_BUILD_CC=/usr/bin/gcc-${GCC_VERSION} MYSQL_BUILD_CXX=/usr/bin/g++-${GCC_VERSION} + - ${MYSQL_BUILD_CC} --version ; ${MYSQL_BUILD_CXX} --version - cd "${TRAVIS_BUILD_DIR}" - env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh; From a8e0c6fd9bb8deb774c2f4f713bb9e4f05215a71 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 15 Dec 2016 09:59:40 +1100 Subject: [PATCH 110/135] Travis: add refs for future capability - when travis catches up --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7677661587a..0671841f622 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,12 @@ addons: apt: sources: - ubuntu-toolchain-r-test +# below requires https://github.com/travis-ci/apt-source-whitelist/pull/309 # - llvm-toolchain-trusty-3.8 # - llvm-toolchain-trusty-3.9 +# llvm urls awaiting fix +# https://github.com/travis-ci/apt-source-whitelist/pull/288 +# https://github.com/travis-ci/apt-source-whitelist/pull/309 packages: # make sure these match debian/control contents - gcc-5 - g++-5 From eabb0aef12e1a6310dea18a2c72efcef42b6dd86 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 14 Dec 2016 17:47:24 +0100 Subject: [PATCH 111/135] sporadic crashes of innodb.innodb_prefix_index_restart_server in slow shutdown mode purge threads really must exit only when there is nothing to purge. Restore the trx_commit_disallowed check and don't stop purge threads until all connection thread transactions are gone. --- storage/innobase/handler/ha_innodb.cc | 6 ++++++ storage/innobase/srv/srv0srv.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cac438c71d8..42dce9d79b7 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -340,6 +340,12 @@ thd_destructor_proxy(void *) mysql_mutex_unlock(&thd_destructor_mutex); thd_destructor_myvar = NULL; + srv_fast_shutdown = (ulint) innobase_fast_shutdown; + if (srv_fast_shutdown == 0) { + while (trx_sys_any_active_transactions()) { + os_thread_sleep(1000); + } + } srv_purge_wakeup(); destroy_thd(thd); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 2e9e3b7ea8a..efc33a9baa2 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -3073,6 +3073,12 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( n_pages_purged = trx_purge(1, srv_purge_batch_size, false); } +#ifdef UNIV_DEBUG + if (srv_fast_shutdown == 0) { + trx_commit_disallowed = true; + } +#endif /* UNIV_DEBUG */ + /* This trx_purge is called to remove any undo records (added by background threads) after completion of the above loop. When srv_fast_shutdown != 0, a large batch size can cause significant From 8d770859c9d28c6b7ce8b052eaca706a18651562 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 14 Dec 2016 17:46:58 +0100 Subject: [PATCH 112/135] InnoDB purge thread and other bg threads in slow shutdown mode stop all bg threads that might generate new undo records to purge before stopping purge threads. --- storage/innobase/handler/ha_innodb.cc | 5 +++++ storage/innobase/include/srv0start.h | 5 +++++ storage/innobase/srv/srv0start.cc | 23 +++++++++++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 42dce9d79b7..83dd0c17eaa 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -345,6 +345,11 @@ thd_destructor_proxy(void *) while (trx_sys_any_active_transactions()) { os_thread_sleep(1000); } + + /* Some background threads might generate undo pages that will + need to be purged, so they have to be shut down before purge + threads if slow shutdown is requested. */ + srv_shutdown_bg_undo_sources(); } srv_purge_wakeup(); diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 0dd98e5b19b..82b5446c62a 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -88,6 +88,11 @@ Shuts down the Innobase database. dberr_t innobase_shutdown_for_mysql(void); +/****************************************************************//** +Shuts down background threads that can generate undo pages. */ +void +srv_shutdown_bg_undo_sources(void); + /******************************************************************** Signal all per-table background threads to shutdown, and wait for them to do so. */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 0c5007fbc13..96c2d8fa8c4 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2769,6 +2769,21 @@ srv_fts_close(void) } #endif + +/****************************************************************//** +Shuts down background threads that can generate undo pages. */ +void +srv_shutdown_bg_undo_sources(void) +/*===========================*/ +{ + fts_optimize_shutdown(); + dict_stats_shutdown(); + + /* Shutdown key rotation threads */ + fil_crypt_threads_end(); +} + + /****************************************************************//** Shuts down the InnoDB database. @return DB_SUCCESS or error code */ @@ -2785,12 +2800,8 @@ innobase_shutdown_for_mysql(void) return(DB_SUCCESS); } - if (!srv_read_only_mode) { - fts_optimize_shutdown(); - dict_stats_shutdown(); - - /* Shutdown key rotation threads */ - fil_crypt_threads_end(); + if (!srv_read_only_mode && srv_fast_shutdown) { + srv_shutdown_bg_undo_sources(); } /* 1. Flush the buffer pool to disk, write the current lsn to From 8938031bc7eb78d406553465341338038cfb2e1a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 14 Dec 2016 17:47:10 +0100 Subject: [PATCH 113/135] InnoDB: don't stop purge threads if there's work to do in slow shutdown mode don't stop purge threads until they've purged everything there is --- storage/innobase/srv/srv0srv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index efc33a9baa2..51e898d98d8 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -2668,7 +2668,7 @@ srv_purge_should_exit( ulint n_purged) /*!< in: pages purged in last batch */ { if (thd_kill_level(thd)) { - return(true); + return(srv_fast_shutdown != 0 || n_purged == 0); } switch (srv_shutdown_state) { From e5377be211692e3f2a6f2add24dcb83f316f8154 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 16 Dec 2016 12:32:56 +0400 Subject: [PATCH 114/135] MDEV-11562 Assertion `js->state == JST_VALUE' failed in check_contains(json_engine_t*, json_engine_t*). check_contains() fixed. When an item of an array is a complex structure, it can be half-read after the end of the recursive check_contains() call. So we just manually get to it's ending. --- include/json_lib.h | 24 +++++++++++++++++++----- mysql-test/r/func_json.result | 6 ++++++ mysql-test/t/func_json.test | 2 ++ sql/item_jsonfunc.cc | 5 ++++- strings/json_lib.c | 23 +++++------------------ 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index b26d865fd36..ce7f27317bc 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -295,13 +295,27 @@ int json_read_value(json_engine_t *j); int json_skip_key(json_engine_t *j); +typedef const int *json_level_t; + /* - json_skip_level() makes parser quickly skip the JSON content - to the end of the current object or array. - It is used when we're not interested in the rest of an array - or the rest of the keys of an object. + json_skip_to_level() makes parser quickly get out of nested + loops and arrays. It is used when we're not interested in what is + there in the rest of these structures. + The 'level' should be remembered in advance. + json_level_t level= json_get_level(j); + .... // getting into the nested JSON structures + json_skip_to_level(j, level); */ -int json_skip_level(json_engine_t *j); +#define json_get_level(j) (j->stack_p) + +int json_skip_to_level(json_engine_t *j, json_level_t level); + +/* + json_skip_level() works as above with just current structre. + So it gets to the end of the current JSON array or object. +*/ +#define json_skip_level(json_engine) \ + json_skip_to_level((json_engine), (json_engine)->stack_p) #define json_skip_array_item json_skip_key diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 99e1e95372f..6466b1a2dc2 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -143,6 +143,12 @@ json_contains('[1, {"a":1}]', '{}') select json_contains('[1, {"a":1}]', '{"a":1}'); json_contains('[1, {"a":1}]', '{"a":1}') 1 +select json_contains('[{"abc":"def", "def":"abc"}]', '["foo","bar"]'); +json_contains('[{"abc":"def", "def":"abc"}]', '["foo","bar"]') +0 +select json_contains('[{"abc":"def", "def":"abc"}, "bar"]', '["bar", {}]'); +json_contains('[{"abc":"def", "def":"abc"}, "bar"]', '["bar", {}]') +1 select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]"); json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]") 1 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 8685d82b635..8e36a3ed18b 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -53,6 +53,8 @@ select json_contains('{"b":[1,2], "a":1}', '{"a":1, "b":2}'); select json_contains('{"a":1}', '{}'); select json_contains('[1, {"a":1}]', '{}'); select json_contains('[1, {"a":1}]', '{"a":1}'); +select json_contains('[{"abc":"def", "def":"abc"}]', '["foo","bar"]'); +select json_contains('[{"abc":"def", "def":"abc"}, "bar"]', '["bar", {}]'); select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[1]"); select json_contains_path('{"key1":1, "key2":[2,3]}', "oNE", "$.key2[10]"); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 7bf2283dd53..9535feb0d8e 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -796,17 +796,20 @@ static int check_contains(json_engine_t *js, json_engine_t *value) { while (json_scan_next(js) == 0 && js->state != JST_ARRAY_END) { + json_level_t c_level; DBUG_ASSERT(js->state == JST_VALUE); if (json_read_value(js)) return FALSE; + c_level= json_value_scalar(js) ? NULL : json_get_level(js); if (check_contains(js, value)) { if (json_skip_level(js)) return FALSE; return TRUE; } - if (value->s.error || js->s.error) + if (value->s.error || js->s.error || + (c_level && json_skip_to_level(js, c_level))) return FALSE; } return FALSE; diff --git a/strings/json_lib.c b/strings/json_lib.c index acca7eb0739..a93200cd4dd 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1158,25 +1158,12 @@ int json_path_setup(json_path_t *p, } -int json_skip_level(json_engine_t *j) +int json_skip_to_level(json_engine_t *j, json_level_t level) { - int ct= 0; - - while (json_scan_next(j) == 0) - { - switch (j->state) { - case JST_OBJ_START: - case JST_ARRAY_START: - ct++; - break; - case JST_OBJ_END: - case JST_ARRAY_END: - if (ct == 0) - return 0; - ct--; - break; - } - } + do { + if (j->stack_p < level) + return 0; + } while (json_scan_next(j) == 0); return 1; } From beded4350f18801d69755c24bd3fbabaf606883f Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 16 Dec 2016 12:43:44 +0400 Subject: [PATCH 115/135] MDEV-JSON_CONTAINS_PATH returns incorrect results and produces wrong warning. The Item_func_json_contains_path was mistakenly set with the no '*' paths limitation. --- mysql-test/r/func_json.result | 3 +++ mysql-test/t/func_json.test | 1 + sql/item_jsonfunc.cc | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 6466b1a2dc2..7c311c23033 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -176,6 +176,9 @@ NULL select json_contains_path('{ "a": true }', 'all', NULL ); json_contains_path('{ "a": true }', 'all', NULL ) NULL +select json_contains_path('{"a":{"b":"c"}}', 'one', '$.a.*'); +json_contains_path('{"a":{"b":"c"}}', 'one', '$.a.*') +1 select json_extract('{"key1":"asd", "key2":[2,3]}', "$.key1"); json_extract('{"key1":"asd", "key2":[2,3]}', "$.key1") "asd" diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 8e36a3ed18b..f7cc6f99f73 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -65,6 +65,7 @@ select json_contains_path('{"key1":1, "key2":[2,3]}', "aLl", "$.key1", "$.ma"); select json_contains_path('{"key1":1, "key2":[2,3]}', "aLl", "$.key1", "$.key2"); select json_contains_path('{ "a": true }', NULL, '$.a' ); select json_contains_path('{ "a": true }', 'all', NULL ); +select json_contains_path('{"a":{"b":"c"}}', 'one', '$.a.*'); select json_extract('{"key1":"asd", "key2":[2,3]}', "$.key1"); select json_extract('{"key1":"asd", "key2":[2,3]}', "$.keyX", "$.keyY"); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 9535feb0d8e..fc3f772321a 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1032,8 +1032,8 @@ longlong Item_func_json_contains_path::val_int() { String *s_p= args[n_arg]->val_str(tmp_paths+(n_arg-2)); if (s_p && - path_setup_nwc(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), - (const uchar *) s_p->ptr() + s_p->length())) + json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) { report_path_error(s_p, &c_path->p, n_arg-2); goto return_null; From 30c231b03a270d3056d2e0da6e263ac10091567b Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 16 Dec 2016 13:51:35 +0400 Subject: [PATCH 116/135] MDEV-11569 JSON_ARRAY_INSERT produces an invalid result. String insertion fixed. --- mysql-test/r/func_json.result | 5 +++- mysql-test/t/func_json.test | 1 + sql/item_jsonfunc.cc | 55 ++++++++++++++++++----------------- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 7c311c23033..8ce3ccb876f 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -75,10 +75,13 @@ json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[4]', 'x') ["a", {"b": [1, 2]}, [3, 4], "x"] select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[1].b[0]', 'x'); json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[1].b[0]', 'x') -["a", {"b": [ "x",1, 2]}, [3, 4]] +["a", {"b": ["x", 1, 2]}, [3, 4]] select json_array_insert('true', '$', 1); json_array_insert('true', '$', 1) NULL +select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[2][1]', 'y'); +json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[2][1]', 'y') +["a", {"b": [1, 2]}, [3, "y", 4]] select json_contains('{"k1":123, "k2":345}', '123', '$.k1'); json_contains('{"k1":123, "k2":345}', '123', '$.k1') 1 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index f7cc6f99f73..b85b89c068d 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -30,6 +30,7 @@ select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[3]', 'x'); select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[4]', 'x'); select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[1].b[0]', 'x'); select json_array_insert('true', '$', 1); +select json_array_insert('["a", {"b": [1, 2]}, [3, 4]]', '$[2][1]', 'y'); select json_contains('{"k1":123, "k2":345}', '123', '$.k1'); select json_contains('"you"', '"you"'); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index fc3f772321a..413b241f496 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1396,27 +1396,19 @@ String *Item_func_json_array_insert::val_str(String *str) item_pos= 0; n_item= 0; - while (json_scan_next(&je) == 0 && - je.state != JST_ARRAY_END && item_pos == 0) + while (json_scan_next(&je) == 0 && je.state != JST_ARRAY_END) { - switch (je.state) + DBUG_ASSERT(je.state == JST_VALUE); + if (n_item == c_path->p.last_step[1].n_item) { - case JST_VALUE: - if (n_item == c_path->p.last_step[1].n_item) - { - item_pos= (const char *) je.s.c_str; - break; - } - n_item++; - break; - case JST_OBJ_START: - case JST_ARRAY_START: - if (json_skip_level(&je)) - break; - break; - default: + item_pos= (const char *) je.s.c_str; break; } + n_item++; + + if (json_read_value(&je) || + (!json_value_scalar(&je) && json_skip_level(&je))) + goto js_error; } if (je.s.error) @@ -1424,16 +1416,27 @@ String *Item_func_json_array_insert::val_str(String *str) str->length(0); str->set_charset(js->charset()); - if (!item_pos) + if (item_pos) + { + if (append_simple(str, js->ptr(), item_pos - js->ptr()) || + (n_item > 0 && str->append(" ", 1)) || + append_json_value(str, args[n_arg+1], &tmp_val) || + str->append(",", 1) || + (n_item == 0 && str->append(" ", 1)) || + append_simple(str, item_pos, js->end() - item_pos)) + goto return_null; /* Out of memory. */ + } + else + { + /* Insert position wasn't found - append to the array. */ + DBUG_ASSERT(je.state == JST_ARRAY_END); item_pos= (const char *) (je.s.c_str - je.sav_c_len); - - if (append_simple(str, js->ptr(), item_pos - js->ptr()) || - ((je.state == JST_ARRAY_END) ? - (n_item > 0 && str->append(", ", 2)) : str->append(" ", 1)) || - append_json_value(str, args[n_arg+1], &tmp_val) || - (je.state != JST_ARRAY_END && str->append(",", 1)) || - append_simple(str, item_pos, js->end() - item_pos)) - goto return_null; /* Out of memory. */ + if (append_simple(str, js->ptr(), item_pos - js->ptr()) || + (n_item > 0 && str->append(", ", 2)) || + append_json_value(str, args[n_arg+1], &tmp_val) || + append_simple(str, item_pos, js->end() - item_pos)) + goto return_null; /* Out of memory. */ + } { /* Swap str and js. */ From ce55094f4fee3c0ff2c58ac4dd3ef2c16c5e20c3 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 16 Dec 2016 14:06:12 +0400 Subject: [PATCH 117/135] MDEV-11572 JSON_DEPTH returns wrong results. JSON depth calculation fixed. --- mysql-test/r/func_json.result | 3 +++ mysql-test/t/func_json.test | 1 + sql/item_jsonfunc.cc | 1 + 3 files changed, 5 insertions(+) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 8ce3ccb876f..a704274a112 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -405,6 +405,9 @@ json_depth('[[], {}]') select json_depth('[[[1,2,3],"s"], {}, []]'); json_depth('[[[1,2,3],"s"], {}, []]') 4 +select json_depth('[10, {"a": 20}]'); +json_depth('[10, {"a": 20}]') +3 select json_length(''); json_length('') NULL diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index b85b89c068d..a1d3d819adf 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -163,6 +163,7 @@ select cast(NULL AS JSON); select json_depth(cast(NULL as JSON)); select json_depth('[[], {}]'); select json_depth('[[[1,2,3],"s"], {}, []]'); +select json_depth('[10, {"a": 20}]'); select json_length(''); select json_length('{}'); diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 413b241f496..42570984e8d 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1624,6 +1624,7 @@ longlong Item_func_json_depth::val_int() switch (je.state) { case JST_VALUE: + case JST_KEY: if (inc_depth) { c_depth++; From 239287b22e7bb7dfe27970ac2f32f8874f24229c Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 2 Nov 2016 09:20:47 +0400 Subject: [PATCH 118/135] Starting the 10.3 branch --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 73750e953b1..8354f68b237 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 -MYSQL_VERSION_MINOR=2 -MYSQL_VERSION_PATCH=3 +MYSQL_VERSION_MINOR=3 +MYSQL_VERSION_PATCH=0 From e5dfe04da02244e592db0b5955a4d95148e0928a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 2 Nov 2016 18:04:35 +0400 Subject: [PATCH 119/135] MDEV-11146 SP variables of the SET data type erroneously allow values with comma There was a duplicate code to create TYPELIB from List: - In typelib() and mysql_prepare_create_table(), which was used to initialize table fields. - create_typelib() and sp_prepare_create_field(), which was used to initialize SP variables. create_typelib() was incomplete and didn't check for wrong SET values. Fix: - Moving the code from create_typelib() and mysql_prepare_create_field() to news methods Column_definition::create_interval_from_interval_list() and Column_definition::prepare_interval_field(). - Moving the code from calculate_interval_lengths() in sql_table.cc to a new method Column_definition::calculate_interval_lengths(), as it's now needed only in Column_definition::create_interval_from_interval_list() - Reusing the new method Column_definition::prepare_interval_field() in both mysql_prepare_create_table() and sp_prepare_create_field(), instead of the old duplicate code pieces - Removing global functions typelib() and create_typelib() This patch also fixes: MDEV-11155 Bad error message when creating a SET column with comma and non-ASCII characters The problem was that ErrCongString() was called with a wrong "charset" parameter. --- mysql-test/r/ctype_utf8.result | 12 +++ mysql-test/r/sp-bugs.result | 11 +++ mysql-test/t/ctype_utf8.test | 17 ++++ mysql-test/t/sp-bugs.test | 14 ++++ sql/field.cc | 83 +++++++++++++++++++ sql/field.h | 96 +++++++++++++++++++++ sql/sp_head.cc | 59 +------------ sql/sql_table.cc | 147 +++++---------------------------- sql/sql_table.h | 3 +- sql/table.cc | 24 ------ sql/table.h | 1 - 11 files changed, 259 insertions(+), 208 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index c3c94d4865f..ce6b34fa731 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -11142,3 +11142,15 @@ SET STORAGE_ENGINE=Default; # # End of 10.2 tests # +# +# Start of 10.3 tests +# +# +# MDEV-11155 Bad error message when creating a SET column with comma and non-ASCII characters +# +SET NAMES utf8; +CREATE TABLE t1 (a SET('a,bü')); +ERROR 22007: Illegal set 'a,bü' value found during parsing +# +# End of 10.3 tests +# diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result index ccccacd09a5..3db1e68321c 100644 --- a/mysql-test/r/sp-bugs.result +++ b/mysql-test/r/sp-bugs.result @@ -281,3 +281,14 @@ end| start transaction; call sp(); drop procedure sp; +# +# MDEV-11146 SP variables of the SET data type erroneously allow values with comma +# +CREATE PROCEDURE p1() +BEGIN +DECLARE a SET('a','b','c','a,b'); +SET a='a,b'; +SELECT a, a+0; +END; +$$ +ERROR 22007: Illegal set 'a,b' value found during parsing diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 352359a03b6..39a124bf7c5 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -2074,3 +2074,20 @@ let $coll_pad='utf8_bin'; --echo # --echo # End of 10.2 tests --echo # + +--echo # +--echo # Start of 10.3 tests +--echo # + + +--echo # +--echo # MDEV-11155 Bad error message when creating a SET column with comma and non-ASCII characters +--echo # + +SET NAMES utf8; +--error ER_ILLEGAL_VALUE_FOR_TYPE +CREATE TABLE t1 (a SET('a,bü')); + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test index 4671aee11e1..3239dfeaeec 100644 --- a/mysql-test/t/sp-bugs.test +++ b/mysql-test/t/sp-bugs.test @@ -307,3 +307,17 @@ start transaction; call sp(); drop procedure sp; +--echo # +--echo # MDEV-11146 SP variables of the SET data type erroneously allow values with comma +--echo # + +DELIMITER $$; +--error ER_ILLEGAL_VALUE_FOR_TYPE +CREATE PROCEDURE p1() +BEGIN + DECLARE a SET('a','b','c','a,b'); + SET a='a,b'; + SELECT a, a+0; +END; +$$ +DELIMITER ;$$ diff --git a/sql/field.cc b/sql/field.cc index 673bf22a4a5..6fa6838e063 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -9721,6 +9721,86 @@ void Field_bit_as_char::sql_type(String &res) const Handling of field and Create_field *****************************************************************************/ +bool Column_definition::create_interval_from_interval_list(MEM_ROOT *mem_root, + bool reuse_interval_list_values) +{ + DBUG_ENTER("Column_definition::create_interval_from_interval_list"); + DBUG_ASSERT(!interval); + if (!(interval= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB)))) + DBUG_RETURN(true); // EOM + + List_iterator it(interval_list); + StringBuffer<64> conv; + char comma_buf[5]; /* 5 bytes for 'filename' charset */ + DBUG_ASSERT(sizeof(comma_buf) >= charset->mbmaxlen); + int comma_length= charset->cset->wc_mb(charset, ',', + (uchar*) comma_buf, + (uchar*) comma_buf + + sizeof(comma_buf)); + DBUG_ASSERT(comma_length >= 0 && comma_length <= (int) sizeof(comma_buf)); + + if (!multi_alloc_root(mem_root, + &interval->type_names, + sizeof(char*) * (interval_list.elements + 1), + &interval->type_lengths, + sizeof(uint) * (interval_list.elements + 1), + NullS)) + goto err; // EOM + + interval->name= ""; + interval->count= interval_list.elements; + + for (uint i= 0; i < interval->count; i++) + { + uint32 dummy; + String *tmp= it++; + LEX_CSTRING value; + if (String::needs_conversion(tmp->length(), tmp->charset(), + charset, &dummy)) + { + uint cnv_errs; + conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), charset, &cnv_errs); + value.str= strmake_root(mem_root, conv.ptr(), conv.length()); + value.length= conv.length(); + } + else + { + value.str= reuse_interval_list_values ? tmp->ptr() : + strmake_root(mem_root, + tmp->ptr(), + tmp->length()); + value.length= tmp->length(); + } + if (!value.str) + goto err; // EOM + + // Strip trailing spaces. + value.length= charset->cset->lengthsp(charset, value.str, value.length); + ((char*) value.str)[value.length]= '\0'; + + if (sql_type == MYSQL_TYPE_SET) + { + if (charset->coll->instr(charset, value.str, value.length, + comma_buf, comma_length, NULL, 0)) + { + ErrConvString err(tmp); + my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", err.ptr()); + goto err; + } + } + interval->type_names[i]= value.str; + interval->type_lengths[i]= value.length; + } + interval->type_names[interval->count]= 0; // End marker + interval->type_lengths[interval->count]= 0; + interval_list.empty(); // Don't need interval_list anymore + DBUG_RETURN(false); +err: + interval= NULL; // Avoid having both non-empty interval_list and interval + DBUG_RETURN(true); +} + + /** Convert create_field::length from number of characters to number of bytes. */ @@ -10533,6 +10613,9 @@ Column_definition::Column_definition(THD *thd, Field *old_field, interval= ((Field_enum*) old_field)->typelib; else interval=0; + + interval_list.empty(); // prepare_interval_field() needs this + char_length= length; /* diff --git a/sql/field.h b/sql/field.h index fd62218f144..b55cc9a0c58 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3726,6 +3726,44 @@ Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, */ class Column_definition: public Sql_alloc { + /** + Create "interval" from "interval_list". + @param mem_root - memory root to create the TYPELIB + instance and its values on + @param reuse_interval_list_values - determines if TYPELIB can reuse strings + from interval_list, or should always + allocate a copy on mem_root, even if + character set conversion is not needed + @retval false on success + @retval true on error (bad values, or EOM) + */ + bool create_interval_from_interval_list(MEM_ROOT *mem_root, + bool reuse_interval_list_values); + + /* + Calculate TYPELIB (set or enum) max and total lengths + + @param cs charset+collation pair of the interval + @param max_length length of the longest item + @param tot_length sum of the item lengths + + After this method call: + - ENUM uses max_length + - SET uses tot_length. + */ + void calculate_interval_lengths(uint32 *max_length, uint32 *tot_length) + { + const char **pos; + uint *len; + *max_length= *tot_length= 0; + for (pos= interval->type_names, len= interval->type_lengths; + *pos ; pos++, len++) + { + size_t length= charset->cset->numchars(charset, *pos, *pos + *len); + *tot_length+= length; + set_if_bigger(*max_length, (uint32)length); + } + } public: const char *field_name; LEX_STRING comment; // Comment for field @@ -3775,7 +3813,65 @@ public: Column_definition(THD *thd, Field *field, Field *orig_field); void create_length_to_internal_length(void); + /** + Prepare a SET/ENUM field. + Create "interval" from "interval_list" if needed, and adjust "length". + @param mem_root - Memory root to allocate TYPELIB and + its values on + @param reuse_interval_list_values - determines if TYPELIB can reuse value + buffers from interval_list, or should + always allocate a copy on mem_root, + even if character set conversion + is not needed + */ + bool prepare_interval_field(MEM_ROOT *mem_root, + bool reuse_interval_list_values) + { + DBUG_ENTER("Column_definition::prepare_interval_field"); + DBUG_ASSERT(sql_type == MYSQL_TYPE_ENUM || sql_type == MYSQL_TYPE_SET); + /* + Interval values are either in "interval" or in "interval_list", + but not in both at the same time, and are not empty at the same time. + - Values are in "interval_list" when we're coming from the parser + in CREATE TABLE or in CREATE {FUNCTION|PROCEDURE}. + - Values are in "interval" when we're in ALTER TABLE. + In a corner case with an empty set like SET(''): + - after the parser we have interval_list.elements==1 + - in ALTER TABLE we have a non-NULL interval with interval->count==1, + with interval->type_names[0]=="" and interval->type_lengths[0]==0. + So the assert is still valid for this corner case. + + ENUM and SET with no values at all (e.g. ENUM(), SET()) are not possible, + as the parser requires at least one element, so for a ENUM or SET field it + should never happen that both internal_list.elements and interval are 0. + */ + DBUG_ASSERT((interval == NULL) == (interval_list.elements > 0)); + + /* + Create typelib from interval_list, and if necessary + convert strings from client character set to the + column character set. + */ + if (interval_list.elements && + create_interval_from_interval_list(mem_root, + reuse_interval_list_values)) + DBUG_RETURN(true); + + uint32 field_length, dummy; + if (sql_type == MYSQL_TYPE_SET) + { + calculate_interval_lengths(&dummy, &field_length); + length= field_length + (interval->count - 1); + } + else /* MYSQL_TYPE_ENUM */ + { + calculate_interval_lengths(&field_length, &dummy); + length= field_length; + } + set_if_smaller(length, MAX_FIELD_WIDTH - 1); + DBUG_RETURN(false); + } bool check(THD *thd); bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 0b9b503aef3..c5d64618ea4 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -747,58 +747,6 @@ sp_head::set_stmt_end(THD *thd) } -static TYPELIB * -create_typelib(MEM_ROOT *mem_root, Column_definition *field_def, List *src) -{ - TYPELIB *result= NULL; - CHARSET_INFO *cs= field_def->charset; - DBUG_ENTER("create_typelib"); - - if (src->elements) - { - result= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB)); - result->count= src->elements; - result->name= ""; - if (!(result->type_names=(const char **) - alloc_root(mem_root,(sizeof(char *)+sizeof(int))*(result->count+1)))) - DBUG_RETURN(0); - result->type_lengths= (uint*)(result->type_names + result->count+1); - List_iterator it(*src); - String conv; - for (uint i=0; i < result->count; i++) - { - uint32 dummy; - uint length; - String *tmp= it++; - - if (String::needs_conversion(tmp->length(), tmp->charset(), - cs, &dummy)) - { - uint cnv_errs; - conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); - - length= conv.length(); - result->type_names[i]= (char*) strmake_root(mem_root, conv.ptr(), - length); - } - else - { - length= tmp->length(); - result->type_names[i]= strmake_root(mem_root, tmp->ptr(), length); - } - - // Strip trailing spaces. - length= cs->cset->lengthsp(cs, result->type_names[i], length); - result->type_lengths[i]= length; - ((uchar *)result->type_names[i])[length]= '\0'; - } - result->type_names[result->count]= 0; - result->type_lengths[result->count]= 0; - } - DBUG_RETURN(result); -} - - sp_head::~sp_head() { LEX *lex; @@ -2362,11 +2310,8 @@ sp_head::fill_field_definition(THD *thd, LEX *lex, if (field_def->check(thd)) return TRUE; - if (field_def->interval_list.elements) - field_def->interval= create_typelib(mem_root, field_def, - &field_def->interval_list); - - sp_prepare_create_field(thd, field_def); + if (sp_prepare_create_field(thd, mem_root, field_def)) + return true; if (prepare_create_field(field_def, &unused1, HA_CAN_GEOMETRY)) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f8a61b641c0..fa99605bd6d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2821,40 +2821,6 @@ bool check_duplicates_in_interval(const char *set_or_name, } -/* - Check TYPELIB (set or enum) max and total lengths - - SYNOPSIS - calculate_interval_lengths() - cs charset+collation pair of the interval - typelib list of values for the column - max_length length of the longest item - tot_length sum of the item lengths - - DESCRIPTION - After this function call: - - ENUM uses max_length - - SET uses tot_length. - - RETURN VALUES - void -*/ -void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval, - uint32 *max_length, uint32 *tot_length) -{ - const char **pos; - uint *len; - *max_length= *tot_length= 0; - for (pos= interval->type_names, len= interval->type_lengths; - *pos ; pos++, len++) - { - size_t length= cs->cset->numchars(cs, *pos, *pos + *len); - *tot_length+= length; - set_if_bigger(*max_length, (uint32)length); - } -} - - /* Prepare a create_table instance for packing @@ -3251,79 +3217,16 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (sql_field->sql_type == MYSQL_TYPE_SET || sql_field->sql_type == MYSQL_TYPE_ENUM) { - uint32 dummy; - CHARSET_INFO *cs= sql_field->charset; - TYPELIB *interval= sql_field->interval; - /* - Create typelib from interval_list, and if necessary - convert strings from client character set to the - column character set. + Create the typelib in runtime memory - we will free the + occupied memory at the same time when we free this + sql_field -- at the end of execution. + Pass "true" as the last argument to reuse "interval_list" + values in "interval" in cases when no character conversion is needed, + to avoid extra copying. */ - if (!interval) - { - /* - Create the typelib in runtime memory - we will free the - occupied memory at the same time when we free this - sql_field -- at the end of execution. - */ - interval= sql_field->interval= typelib(thd->mem_root, - sql_field->interval_list); - List_iterator int_it(sql_field->interval_list); - String conv, *tmp; - char comma_buf[5]; /* 5 bytes for 'filename' charset */ - DBUG_ASSERT(sizeof(comma_buf) >= cs->mbmaxlen); - int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf, - (uchar*) comma_buf + - sizeof(comma_buf)); - DBUG_ASSERT(comma_length > 0); - for (uint i= 0; (tmp= int_it++); i++) - { - size_t lengthsp; - if (String::needs_conversion(tmp->length(), tmp->charset(), - cs, &dummy)) - { - uint cnv_errs; - conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); - interval->type_names[i]= strmake_root(thd->mem_root, conv.ptr(), - conv.length()); - interval->type_lengths[i]= conv.length(); - } - - // Strip trailing spaces. - lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], - interval->type_lengths[i]); - interval->type_lengths[i]= lengthsp; - ((uchar *)interval->type_names[i])[lengthsp]= '\0'; - if (sql_field->sql_type == MYSQL_TYPE_SET) - { - if (cs->coll->instr(cs, interval->type_names[i], - interval->type_lengths[i], - comma_buf, comma_length, NULL, 0)) - { - ErrConvString err(tmp->ptr(), tmp->length(), cs); - my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", err.ptr()); - DBUG_RETURN(TRUE); - } - } - } - sql_field->interval_list.empty(); // Don't need interval_list anymore - } - - if (sql_field->sql_type == MYSQL_TYPE_SET) - { - uint32 field_length; - calculate_interval_lengths(cs, interval, &dummy, &field_length); - sql_field->length= field_length + (interval->count - 1); - } - else /* MYSQL_TYPE_ENUM */ - { - uint32 field_length; - DBUG_ASSERT(sql_field->sql_type == MYSQL_TYPE_ENUM); - calculate_interval_lengths(cs, interval, &field_length, &dummy); - sql_field->length= field_length; - } - set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1); + if (sql_field->prepare_interval_field(thd->mem_root, true)) + DBUG_RETURN(true); // E.g. wrong values with commas: SET('a,b') } if (sql_field->sql_type == MYSQL_TYPE_BIT) @@ -4349,28 +4252,18 @@ static bool prepare_blob_field(THD *thd, Column_definition *sql_field) */ -void sp_prepare_create_field(THD *thd, Column_definition *sql_field) +bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root, + Column_definition *sql_field) { if (sql_field->sql_type == MYSQL_TYPE_SET || sql_field->sql_type == MYSQL_TYPE_ENUM) { - uint32 field_length, dummy; - if (sql_field->sql_type == MYSQL_TYPE_SET) - { - calculate_interval_lengths(sql_field->charset, - sql_field->interval, &dummy, - &field_length); - sql_field->length= field_length + - (sql_field->interval->count - 1); - } - else /* MYSQL_TYPE_ENUM */ - { - calculate_interval_lengths(sql_field->charset, - sql_field->interval, - &field_length, &dummy); - sql_field->length= field_length; - } - set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1); + /* + Pass "false" as the last argument to allocate TYPELIB values on mem_root, + even if no character set conversion is needed. + */ + if (sql_field->prepare_interval_field(mem_root, false)) + return true; // E.g. wrong values with commas: SET('a,b') } if (sql_field->sql_type == MYSQL_TYPE_BIT) @@ -4380,8 +4273,12 @@ void sp_prepare_create_field(THD *thd, Column_definition *sql_field) } sql_field->create_length_to_internal_length(); DBUG_ASSERT(sql_field->default_value == 0); - /* Can't go wrong as sql_field->def is not defined */ - (void) prepare_blob_field(thd, sql_field); + /* + prepare_blob_field() can return an error on attempt to create a too long + VARCHAR/VARBINARY field when the current sql_mode does not allow automatic + conversion to TEXT/BLOB. + */ + return prepare_blob_field(thd, sql_field); } diff --git a/sql/sql_table.h b/sql/sql_table.h index 628c51f678f..0d1a2ccf459 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -251,7 +251,8 @@ bool quick_rm_table(THD *thd, handlerton *base, const char *db, const char *table_name, uint flags, const char *table_path=0); void close_cached_table(THD *thd, TABLE *table); -void sp_prepare_create_field(THD *thd, Column_definition *sql_field); +bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root, + Column_definition *sql_field); int prepare_create_field(Column_definition *sql_field, uint *blob_columns, longlong table_flags); diff --git a/sql/table.cc b/sql/table.cc index 71c70e2df2e..0d1286695cd 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3534,30 +3534,6 @@ fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types, } /* fix_type_pointers */ -TYPELIB *typelib(MEM_ROOT *mem_root, List &strings) -{ - TYPELIB *result= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB)); - if (!result) - return 0; - result->count=strings.elements; - result->name=""; - uint nbytes= (sizeof(char*) + sizeof(uint)) * (result->count + 1); - if (!(result->type_names= (const char**) alloc_root(mem_root, nbytes))) - return 0; - result->type_lengths= (uint*) (result->type_names + result->count + 1); - List_iterator it(strings); - String *tmp; - for (uint i=0; (tmp=it++) ; i++) - { - result->type_names[i]= tmp->ptr(); - result->type_lengths[i]= tmp->length(); - } - result->type_names[result->count]= 0; // End marker - result->type_lengths[result->count]= 0; - return result; -} - - /* Search after a field with given start & length If an exact field isn't found, return longest field with starts diff --git a/sql/table.h b/sql/table.h index c2c523181a0..e68f4ec8563 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2736,7 +2736,6 @@ inline bool is_infoschema_db(const char *name) INFORMATION_SCHEMA_NAME.str, name); } -TYPELIB *typelib(MEM_ROOT *mem_root, List &strings); inline void mark_as_null_row(TABLE *table) { From 8b4f181c60acc163438b7f85365b4f429e49a3a8 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 16 Nov 2016 10:08:17 +0400 Subject: [PATCH 120/135] MDEV-10811 Change design from "Item is Type_handler" to "Item has Type_handler" --- sql/filesort.cc | 6 ++++-- sql/item.h | 44 +++++++++++++++++++------------------------- sql/item_func.h | 2 ++ sql/item_sum.cc | 3 ++- sql/item_sum.h | 4 ++++ sql/item_timefunc.h | 2 ++ sql/sql_type.cc | 2 +- sql/sql_type.h | 44 ++++++++------------------------------------ 8 files changed, 42 insertions(+), 65 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index 2210dc569df..c77304eba7c 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1183,7 +1183,8 @@ static void make_sortkey(register Sort_param *param, } else { // Item - sort_field->item->make_sort_key(to, sort_field->item, sort_field, param); + sort_field->item->type_handler()->make_sort_key(to, sort_field->item, + sort_field, param); if ((maybe_null= sort_field->item->maybe_null)) to++; } @@ -1983,7 +1984,8 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, } else { - sortorder->item->sortlength(thd, sortorder->item, sortorder); + sortorder->item->type_handler()->sortlength(thd, sortorder->item, + sortorder); if (use_strnxfrm(sortorder->item->collation.collation)) { *multi_byte_charset= true; diff --git a/sql/item.h b/sql/item.h index 5b3c3a6a0d5..e0634e63c9b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -642,8 +642,7 @@ public: class Item: public Value_source, - public Type_std_attributes, - public Type_handler + public Type_std_attributes { void operator=(Item &); /** @@ -855,35 +854,20 @@ public: { return save_in_field(field, 1); } virtual bool send(Protocol *protocol, String *str); virtual bool eq(const Item *, bool binary_cmp) const; - const Type_handler *type_handler() const + virtual enum_field_types field_type() const= 0; + virtual const Type_handler *type_handler() const { - return get_handler_by_field_type(field_type()); - } - Field *make_num_distinct_aggregator_field(MEM_ROOT *mem_root, - const Item *item) const - { - return type_handler()->make_num_distinct_aggregator_field(mem_root, this); - } - Field *make_conversion_table_field(TABLE *table, - uint metadata, const Field *target) const - { - DBUG_ASSERT(0); // Should not be called in Item context - return NULL; + return Type_handler::get_handler_by_field_type(field_type()); } /* result_type() of an item specifies how the value should be returned */ - Item_result result_type() const { return type_handler()->result_type(); } - /* ... while cmp_type() specifies how it should be compared */ - Item_result cmp_type() const { return type_handler()->cmp_type(); } - void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + virtual Item_result result_type() const { - type_handler()->make_sort_key(to, item, sort_field, param); + return type_handler()->result_type(); } - void sortlength(THD *thd, - const Type_std_attributes *item, - SORT_FIELD_ATTR *attr) const + /* ... while cmp_type() specifies how it should be compared */ + virtual Item_result cmp_type() const { - type_handler()->sortlength(thd, item, attr); + return type_handler()->cmp_type(); } virtual Item_result cast_to_int_type() const { return cmp_type(); } enum_field_types string_field_type() const @@ -2182,6 +2166,8 @@ public: inline uint get_var_idx() const; inline enum Type type() const; + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const @@ -2840,6 +2826,8 @@ public: enum Type item_type; + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const @@ -4835,6 +4823,8 @@ public: /** All of the subclasses should have the same type tag */ enum Type type() const { return COPY_STR_ITEM; } + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const @@ -5356,6 +5346,8 @@ public: }; enum Type type() const { return CACHE_ITEM; } + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const @@ -5669,6 +5661,8 @@ protected: public: Item_type_holder(THD*, Item*); + const Type_handler *type_handler() const + { return Type_handler_hybrid_real_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_real_field_type::field_type(); } enum_field_types real_field_type() const diff --git a/sql/item_func.h b/sql/item_func.h index d4314f7bd6a..d30ab750e33 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -399,6 +399,8 @@ public: Item_hybrid_func(THD *thd, List &list): Item_func(thd, list) { } Item_hybrid_func(THD *thd, Item_hybrid_func *item) :Item_func(thd, item), Type_handler_hybrid_field_type(item) { } + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 51a6c2bd3eb..3754bc1a954 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -867,7 +867,8 @@ bool Aggregator_distinct::setup(THD *thd) if (always_null) DBUG_RETURN(FALSE); - Field *field= arg->make_num_distinct_aggregator_field(thd->mem_root, arg); + Field *field= arg->type_handler()-> + make_num_distinct_aggregator_field(thd->mem_root, arg); if (!field || !(table= create_virtual_tmp_table(thd, field))) DBUG_RETURN(TRUE); diff --git a/sql/item_sum.h b/sql/item_sum.h index b9075db0196..76cc983ad9e 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -755,6 +755,8 @@ public: longlong val_int(); String *val_str(String*str); my_decimal *val_decimal(my_decimal *); + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const @@ -1012,6 +1014,8 @@ protected: void reset_field(); String *val_str(String *); bool keep_field_type(void) const { return 1; } + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum Item_result result_type () const { return Type_handler_hybrid_field_type::result_type(); } enum Item_result cmp_type () const diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index d8f69e2098d..dafcdf64b45 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -565,6 +565,8 @@ protected: public: Item_temporal_hybrid_func(THD *thd, Item *a, Item *b): Item_temporal_func(thd, a, b) {} + const Type_handler *type_handler() const + { return Type_handler_hybrid_field_type::type_handler(); } enum_field_types field_type() const { return Type_handler_hybrid_field_type::field_type(); } enum Item_result result_type () const diff --git a/sql/sql_type.cc b/sql/sql_type.cc index d85664568a1..a80417f60b9 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -68,7 +68,7 @@ static Type_handler_set type_handler_set; all around the code. */ const Type_handler * -Type_handler::string_type_handler(uint max_octet_length) const +Type_handler::string_type_handler(uint max_octet_length) { if (max_octet_length >= 16777216) return &type_handler_long_blob; diff --git a/sql/sql_type.h b/sql/sql_type.h index 596c338720e..4b05a4663c4 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -33,12 +33,12 @@ struct SORT_FIELD_ATTR; class Type_handler { protected: - const Type_handler *string_type_handler(uint max_octet_length) const; void make_sort_key_longlong(uchar *to, bool maybe_null, bool null_value, bool unsigned_flag, longlong value) const; public: + static const Type_handler *string_type_handler(uint max_octet_length); static const Type_handler *get_handler_by_field_type(enum_field_types type); static const Type_handler *get_handler_by_real_type(enum_field_types type); virtual enum_field_types field_type() const= 0; @@ -499,7 +499,7 @@ public: Makes sure that field_type(), cmp_type() and result_type() are always in sync to each other for hybrid functions. */ -class Type_handler_hybrid_field_type: public Type_handler +class Type_handler_hybrid_field_type { const Type_handler *m_type_handler; const Type_handler *get_handler_by_result_type(Item_result type) const; @@ -509,11 +509,12 @@ public: :m_type_handler(handler) { } Type_handler_hybrid_field_type(enum_field_types type) - :m_type_handler(get_handler_by_field_type(type)) + :m_type_handler(Type_handler::get_handler_by_field_type(type)) { } Type_handler_hybrid_field_type(const Type_handler_hybrid_field_type *other) :m_type_handler(other->m_type_handler) { } + const Type_handler *type_handler() const { return m_type_handler; } enum_field_types field_type() const { return m_type_handler->field_type(); } enum_field_types real_field_type() const { @@ -540,42 +541,12 @@ public: } const Type_handler *set_handler_by_field_type(enum_field_types type) { - return (m_type_handler= get_handler_by_field_type(type)); + return (m_type_handler= Type_handler::get_handler_by_field_type(type)); } const Type_handler *set_handler_by_real_type(enum_field_types type) { - return (m_type_handler= get_handler_by_real_type(type)); + return (m_type_handler= Type_handler::get_handler_by_real_type(type)); } - const Type_handler * - type_handler_adjusted_to_max_octet_length(uint max_octet_length, - CHARSET_INFO *cs) const - { - return - m_type_handler->type_handler_adjusted_to_max_octet_length(max_octet_length, - cs); - } - Field *make_num_distinct_aggregator_field(MEM_ROOT *mem_root, - const Item *item) const - { - return m_type_handler->make_num_distinct_aggregator_field(mem_root, item); - } - Field *make_conversion_table_field(TABLE *table, uint metadata, - const Field *target) const - { - return m_type_handler->make_conversion_table_field(table, metadata, target); - } - void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const - { - m_type_handler->make_sort_key(to, item, sort_field, param); - } - void sortlength(THD *thd, - const Type_std_attributes *item, - SORT_FIELD_ATTR *attr) const - { - m_type_handler->sortlength(thd, item, attr); - } - }; @@ -587,7 +558,8 @@ class Type_handler_hybrid_real_field_type: { public: Type_handler_hybrid_real_field_type(enum_field_types type) - :Type_handler_hybrid_field_type(get_handler_by_real_type(type)) + :Type_handler_hybrid_field_type(Type_handler:: + get_handler_by_real_type(type)) { } }; From 01546ee403f1d2893bbc990bcc7d4b6f49fd6639 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Nov 2016 15:40:45 +0400 Subject: [PATCH 121/135] MDEV-11245 Move prepare_create_field and sp_prepare_create_field() as methods to Column_definition Some upcoming tasks, e.g.: - MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations - MDEV-10914 ROW data type for stored routine variables will need to reuse the code implemented in prepare_create_field(), sp_prepare_create_field(), prepare_blob_field(). Before reusing this code, it's a good idea to move these global functions as methods to Column_definition. This patch: - actually moves prepare_create_field(), sp_prepare_create_field(), prepare_blob_field() as methods to Column_definition - makes sp_prepare_create_field() call prepare_create_field() at the end, to avoid duplicate code in MDEV-10577 and MDEV-10914. - changes the return data type for prepare_create_field() from int to bool, to make it consistent with all other functions returning "ok" or "error". - moves the implementation sp_head::fill_field_definition() from sp_head.cc to sp_head.h, as it now uses globally visible Column_definition methods, and is very simple, so inlining is now possible. - removes the unused "LEX*" argument from sp_head::fill_field_definition() --- sql/field.h | 7 ++ sql/sp_head.cc | 36 -------- sql/sp_head.h | 18 +++- sql/sql_table.cc | 224 +++++++++++++++++++++-------------------------- sql/sql_table.h | 5 -- sql/sql_yacc.yy | 7 +- 6 files changed, 124 insertions(+), 173 deletions(-) diff --git a/sql/field.h b/sql/field.h index b55cc9a0c58..36ac7f5f528 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3872,6 +3872,13 @@ public: set_if_smaller(length, MAX_FIELD_WIDTH - 1); DBUG_RETURN(false); } + + bool prepare_blob_field(THD *thd); + + bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root); + + bool prepare_create_field(uint *blob_columns, longlong table_flags); + bool check(THD *thd); bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c5d64618ea4..441de33b776 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -23,8 +23,6 @@ #include "probes_mysql.h" #include "sql_show.h" // append_identifier #include "sql_db.h" // mysql_opt_change_db, mysql_change_db -#include "sql_table.h" // sp_prepare_create_field, - // prepare_create_field #include "sql_acl.h" // *_ACL #include "sql_array.h" // Dynamic_array #include "log_event.h" // Query_log_event @@ -2287,40 +2285,6 @@ sp_head::backpatch(sp_label *lab) DBUG_VOID_RETURN; } -/** - Prepare an instance of Column_definition for field creation - (fill all necessary attributes). - - @param[in] thd Thread handle - @param[in] lex Yacc parsing context - @param[out] field_def An instance of create_field to be filled - - @retval - FALSE on success - @retval - TRUE on error -*/ - -bool -sp_head::fill_field_definition(THD *thd, LEX *lex, - Column_definition *field_def) -{ - uint unused1= 0; - - if (field_def->check(thd)) - return TRUE; - - if (sp_prepare_create_field(thd, mem_root, field_def)) - return true; - - if (prepare_create_field(field_def, &unused1, HA_CAN_GEOMETRY)) - { - return TRUE; - } - - return FALSE; -} - int sp_head::new_cont_backpatch(sp_instr_opt_meta *i) diff --git a/sql/sp_head.h b/sql/sp_head.h index 9f1745f2aab..a3a34531c89 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -417,9 +417,23 @@ public: Field *create_result_field(uint field_max_length, const char *field_name, TABLE *table); - bool fill_field_definition(THD *thd, LEX *lex, - Column_definition *field_def); + /** + Check and prepare an instance of Column_definition for field creation + (fill all necessary attributes). + + @param[in] thd Thread handle + @param[in] lex Yacc parsing context + @param[out] field_def An instance of create_field to be filled + + @retval false on success + @retval true on error + */ + bool fill_field_definition(THD *thd, Column_definition *field_def) + { + return field_def->check(thd) || + field_def->sp_prepare_create_field(thd, mem_root); + } void set_info(longlong created, longlong modified, st_sp_chistics *chistics, sql_mode_t sql_mode); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index fa99605bd6d..12a89aa51e7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -75,7 +75,6 @@ static int copy_data_between_tables(THD *thd, TABLE *from,TABLE *to, Alter_info::enum_enable_or_disable keys_onoff, Alter_table_ctx *alter_ctx); -static bool prepare_blob_field(THD *thd, Column_definition *sql_field); static int mysql_prepare_create_table(THD *, HA_CREATE_INFO *, Alter_info *, uint *, handler *, KEY **, uint *, int); static uint blob_length_by_type(enum_field_types type); @@ -2822,48 +2821,39 @@ bool check_duplicates_in_interval(const char *set_or_name, /* - Prepare a create_table instance for packing + Prepare a Column_definition instance for packing + Members such as pack_flag are valid after this call. - SYNOPSIS - prepare_create_field() - sql_field field to prepare for packing - blob_columns count for BLOBs - table_flags table flags + @param IN/OUT blob_columns - count for BLOBs + @param IN table_flags - table flags - DESCRIPTION - This function prepares a Create_field instance. - Fields such as pack_flag are valid after this call. - - RETURN VALUES - 0 ok - 1 Error + @retval false - ok + @retval true - error (not supported type, bad definition, etc) */ -int prepare_create_field(Column_definition *sql_field, - uint *blob_columns, - longlong table_flags) +bool Column_definition::prepare_create_field(uint *blob_columns, + longlong table_flags) { uint dup_val_count; - uint decimals= sql_field->decimals; - DBUG_ENTER("prepare_create_field"); + uint decimals_orig= decimals; + DBUG_ENTER("Column_definition::prepare_create_field"); /* This code came from mysql_prepare_create_table. Indent preserved to make patching easier */ - DBUG_ASSERT(sql_field->charset); + DBUG_ASSERT(charset); - switch (sql_field->sql_type) { + switch (sql_type) { case MYSQL_TYPE_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_LONG_BLOB: - sql_field->pack_flag=FIELDFLAG_BLOB | - pack_length_to_packflag(sql_field->pack_length - - portable_sizeof_char_ptr); - if (sql_field->charset->state & MY_CS_BINSORT) - sql_field->pack_flag|=FIELDFLAG_BINARY; - sql_field->length=8; // Unireg field length + pack_flag= FIELDFLAG_BLOB | + pack_length_to_packflag(pack_length - portable_sizeof_char_ptr); + if (charset->state & MY_CS_BINSORT) + pack_flag|= FIELDFLAG_BINARY; + length= 8; // Unireg field length (*blob_columns)++; break; case MYSQL_TYPE_GEOMETRY: @@ -2873,66 +2863,59 @@ int prepare_create_field(Column_definition *sql_field, my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "GEOMETRY"); DBUG_RETURN(1); } - sql_field->pack_flag=FIELDFLAG_GEOM | - pack_length_to_packflag(sql_field->pack_length - - portable_sizeof_char_ptr); - if (sql_field->charset->state & MY_CS_BINSORT) - sql_field->pack_flag|=FIELDFLAG_BINARY; - sql_field->length=8; // Unireg field length + pack_flag= FIELDFLAG_GEOM | + pack_length_to_packflag(pack_length - portable_sizeof_char_ptr); + if (charset->state & MY_CS_BINSORT) + pack_flag|= FIELDFLAG_BINARY; + length= 8; // Unireg field length (*blob_columns)++; break; #else my_error(ER_FEATURE_DISABLED, MYF(0), - sym_group_geom.name, sym_group_geom.needed_define); - DBUG_RETURN(1); + sym_group_geom.name, sym_group_geom.needed_define); + DBUG_RETURN(true); #endif /*HAVE_SPATIAL*/ case MYSQL_TYPE_VARCHAR: #ifndef QQ_ALL_HANDLERS_SUPPORT_VARCHAR if (table_flags & HA_NO_VARCHAR) { /* convert VARCHAR to CHAR because handler is not yet up to date */ - sql_field->sql_type= MYSQL_TYPE_VAR_STRING; - sql_field->pack_length= calc_pack_length(sql_field->sql_type, - (uint) sql_field->length); - if ((sql_field->length / sql_field->charset->mbmaxlen) > - MAX_FIELD_CHARLENGTH) + sql_type= MYSQL_TYPE_VAR_STRING; + pack_length= calc_pack_length(sql_type, (uint) length); + if ((length / charset->mbmaxlen) > MAX_FIELD_CHARLENGTH) { - my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name, - static_cast(MAX_FIELD_CHARLENGTH)); - DBUG_RETURN(1); + my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), field_name, + static_cast(MAX_FIELD_CHARLENGTH)); + DBUG_RETURN(true); } } #endif /* fall through */ case MYSQL_TYPE_STRING: - sql_field->pack_flag=0; - if (sql_field->charset->state & MY_CS_BINSORT) - sql_field->pack_flag|=FIELDFLAG_BINARY; + pack_flag= 0; + if (charset->state & MY_CS_BINSORT) + pack_flag|= FIELDFLAG_BINARY; break; case MYSQL_TYPE_ENUM: - sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) | - FIELDFLAG_INTERVAL; - if (sql_field->charset->state & MY_CS_BINSORT) - sql_field->pack_flag|=FIELDFLAG_BINARY; - if (check_duplicates_in_interval("ENUM",sql_field->field_name, - sql_field->interval, - sql_field->charset, &dup_val_count)) - DBUG_RETURN(1); + pack_flag= pack_length_to_packflag(pack_length) | FIELDFLAG_INTERVAL; + if (charset->state & MY_CS_BINSORT) + pack_flag|= FIELDFLAG_BINARY; + if (check_duplicates_in_interval("ENUM", field_name, interval, + charset, &dup_val_count)) + DBUG_RETURN(true); break; case MYSQL_TYPE_SET: - sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) | - FIELDFLAG_BITFIELD; - if (sql_field->charset->state & MY_CS_BINSORT) - sql_field->pack_flag|=FIELDFLAG_BINARY; - if (check_duplicates_in_interval("SET",sql_field->field_name, - sql_field->interval, - sql_field->charset, &dup_val_count)) - DBUG_RETURN(1); + pack_flag= pack_length_to_packflag(pack_length) | FIELDFLAG_BITFIELD; + if (charset->state & MY_CS_BINSORT) + pack_flag|= FIELDFLAG_BINARY; + if (check_duplicates_in_interval("SET", field_name, interval, + charset, &dup_val_count)) + DBUG_RETURN(true); /* Check that count of unique members is not more then 64 */ - if (sql_field->interval->count - dup_val_count > sizeof(longlong)*8) + if (interval->count - dup_val_count > sizeof(longlong)*8) { - my_error(ER_TOO_BIG_SET, MYF(0), sql_field->field_name); - DBUG_RETURN(1); + my_error(ER_TOO_BIG_SET, MYF(0), field_name); + DBUG_RETURN(true); } break; case MYSQL_TYPE_DATE: // Rest of string types @@ -2942,7 +2925,7 @@ int prepare_create_field(Column_definition *sql_field, case MYSQL_TYPE_TIME2: case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_NULL: - sql_field->pack_flag=f_settype((uint) sql_field->sql_type); + pack_flag= f_settype((uint) sql_type); break; case MYSQL_TYPE_BIT: /* @@ -2951,12 +2934,10 @@ int prepare_create_field(Column_definition *sql_field, */ break; case MYSQL_TYPE_NEWDECIMAL: - sql_field->pack_flag=(FIELDFLAG_NUMBER | - (sql_field->flags & UNSIGNED_FLAG ? 0 : - FIELDFLAG_DECIMAL) | - (sql_field->flags & ZEROFILL_FLAG ? - FIELDFLAG_ZEROFILL : 0) | - (decimals << FIELDFLAG_DEC_SHIFT)); + pack_flag= (FIELDFLAG_NUMBER | + (flags & UNSIGNED_FLAG ? 0 : FIELDFLAG_DECIMAL) | + (flags & ZEROFILL_FLAG ? FIELDFLAG_ZEROFILL : 0) | + (decimals_orig << FIELDFLAG_DEC_SHIFT)); break; case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: @@ -2965,28 +2946,26 @@ int prepare_create_field(Column_definition *sql_field, FLOATING_POINT_DECIMALS to keep things compatible with earlier MariaDB versions. */ - if (decimals >= FLOATING_POINT_DECIMALS) - decimals= FLOATING_POINT_DECIMALS; + if (decimals_orig >= FLOATING_POINT_DECIMALS) + decimals_orig= FLOATING_POINT_DECIMALS; /* fall-trough */ case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP2: /* fall-through */ default: - sql_field->pack_flag=(FIELDFLAG_NUMBER | - (sql_field->flags & UNSIGNED_FLAG ? 0 : - FIELDFLAG_DECIMAL) | - (sql_field->flags & ZEROFILL_FLAG ? - FIELDFLAG_ZEROFILL : 0) | - f_settype((uint) sql_field->sql_type) | - (decimals << FIELDFLAG_DEC_SHIFT)); + pack_flag= (FIELDFLAG_NUMBER | + (flags & UNSIGNED_FLAG ? 0 : FIELDFLAG_DECIMAL) | + (flags & ZEROFILL_FLAG ? FIELDFLAG_ZEROFILL : 0) | + f_settype((uint) sql_type) | + (decimals_orig << FIELDFLAG_DEC_SHIFT)); break; } - if (!(sql_field->flags & NOT_NULL_FLAG) || - (sql_field->vcol_info)) /* Make virtual columns allow NULL values */ - sql_field->pack_flag|= FIELDFLAG_MAYBE_NULL; - if (sql_field->flags & NO_DEFAULT_VALUE_FLAG) - sql_field->pack_flag|= FIELDFLAG_NO_DEFAULT; - DBUG_RETURN(0); + if (!(flags & NOT_NULL_FLAG) || + (vcol_info)) /* Make virtual columns allow NULL values */ + pack_flag|= FIELDFLAG_MAYBE_NULL; + if (flags & NO_DEFAULT_VALUE_FLAG) + pack_flag|= FIELDFLAG_NO_DEFAULT; + DBUG_RETURN(false); } @@ -3239,7 +3218,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } sql_field->create_length_to_internal_length(); - if (prepare_blob_field(thd, sql_field)) + if (sql_field->prepare_blob_field(thd)) DBUG_RETURN(TRUE); /* @@ -3404,8 +3383,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, { DBUG_ASSERT(sql_field->charset != 0); - if (prepare_create_field(sql_field, &blob_columns, - file->ha_table_flags())) + if (sql_field->prepare_create_field(&blob_columns, file->ha_table_flags())) DBUG_RETURN(TRUE); if (sql_field->sql_type == MYSQL_TYPE_VARCHAR) create_info->varchar= TRUE; @@ -4185,7 +4163,6 @@ static void set_table_default_charset(THD *thd, SYNOPSIS prepare_blob_field() - sql_field Field to check RETURN 0 ok @@ -4193,45 +4170,42 @@ static void set_table_default_charset(THD *thd, In this case the error is given */ -static bool prepare_blob_field(THD *thd, Column_definition *sql_field) +bool Column_definition::prepare_blob_field(THD *thd) { - DBUG_ENTER("prepare_blob_field"); + DBUG_ENTER("Column_definition::prepare_blob_field"); - if (sql_field->length > MAX_FIELD_VARCHARLENGTH && - !(sql_field->flags & BLOB_FLAG)) + if (length > MAX_FIELD_VARCHARLENGTH && !(flags & BLOB_FLAG)) { /* Convert long VARCHAR columns to TEXT or BLOB */ char warn_buff[MYSQL_ERRMSG_SIZE]; if (thd->is_strict_mode()) { - my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name, - static_cast(MAX_FIELD_VARCHARLENGTH / - sql_field->charset->mbmaxlen)); + my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), field_name, + static_cast(MAX_FIELD_VARCHARLENGTH / charset->mbmaxlen)); DBUG_RETURN(1); } - sql_field->sql_type= MYSQL_TYPE_BLOB; - sql_field->flags|= BLOB_FLAG; + sql_type= MYSQL_TYPE_BLOB; + flags|= BLOB_FLAG; my_snprintf(warn_buff, sizeof(warn_buff), ER_THD(thd, ER_AUTO_CONVERT), - sql_field->field_name, - (sql_field->charset == &my_charset_bin) ? "VARBINARY" : - "VARCHAR", - (sql_field->charset == &my_charset_bin) ? "BLOB" : "TEXT"); + field_name, + (charset == &my_charset_bin) ? "VARBINARY" : "VARCHAR", + (charset == &my_charset_bin) ? "BLOB" : "TEXT"); push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_AUTO_CONVERT, warn_buff); } - if ((sql_field->flags & BLOB_FLAG) && sql_field->length) + if ((flags & BLOB_FLAG) && length) { - if (sql_field->sql_type == FIELD_TYPE_BLOB || - sql_field->sql_type == FIELD_TYPE_TINY_BLOB || - sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB) + if (sql_type == FIELD_TYPE_BLOB || + sql_type == FIELD_TYPE_TINY_BLOB || + sql_type == FIELD_TYPE_MEDIUM_BLOB) { /* The user has given a length to the blob column */ - sql_field->sql_type= get_blob_type_from_length(sql_field->length); - sql_field->pack_length= calc_pack_length(sql_field->sql_type, 0); + sql_type= get_blob_type_from_length(length); + pack_length= calc_pack_length(sql_type, 0); } - sql_field->length= 0; + length= 0; } DBUG_RETURN(0); } @@ -4244,41 +4218,39 @@ static bool prepare_blob_field(THD *thd, Column_definition *sql_field) SYNOPSIS sp_prepare_create_field() - thd Thread object - sql_field Field to prepare + thd Thread object + mem_root Memory root to allocate components on (e.g. interval) DESCRIPTION Prepares the field structures for field creation. */ -bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root, - Column_definition *sql_field) +bool Column_definition::sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root) { - if (sql_field->sql_type == MYSQL_TYPE_SET || - sql_field->sql_type == MYSQL_TYPE_ENUM) + if (sql_type == MYSQL_TYPE_SET || sql_type == MYSQL_TYPE_ENUM) { /* Pass "false" as the last argument to allocate TYPELIB values on mem_root, even if no character set conversion is needed. */ - if (sql_field->prepare_interval_field(mem_root, false)) + if (prepare_interval_field(mem_root, false)) return true; // E.g. wrong values with commas: SET('a,b') } - if (sql_field->sql_type == MYSQL_TYPE_BIT) - { - sql_field->pack_flag= FIELDFLAG_NUMBER | - FIELDFLAG_TREAT_BIT_AS_CHAR; - } - sql_field->create_length_to_internal_length(); - DBUG_ASSERT(sql_field->default_value == 0); + if (sql_type == MYSQL_TYPE_BIT) + pack_flag= FIELDFLAG_NUMBER | FIELDFLAG_TREAT_BIT_AS_CHAR; + create_length_to_internal_length(); + DBUG_ASSERT(default_value == 0); /* prepare_blob_field() can return an error on attempt to create a too long VARCHAR/VARBINARY field when the current sql_mode does not allow automatic conversion to TEXT/BLOB. */ - return prepare_blob_field(thd, sql_field); + if (prepare_blob_field(thd)) + return true; + uint unused1; + return prepare_create_field(&unused1, HA_CAN_GEOMETRY); } diff --git a/sql/sql_table.h b/sql/sql_table.h index 0d1a2ccf459..1750def3a84 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -251,11 +251,6 @@ bool quick_rm_table(THD *thd, handlerton *base, const char *db, const char *table_name, uint flags, const char *table_path=0); void close_cached_table(THD *thd, TABLE *table); -bool sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root, - Column_definition *sql_field); -int prepare_create_field(Column_definition *sql_field, - uint *blob_columns, - longlong table_flags); CHARSET_INFO* get_sql_field_charset(Create_field *sql_field, HA_CREATE_INFO *create_info); bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2cd84a27d45..b5d49382bff 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3009,7 +3009,7 @@ sp_param_name_and_type: LEX *lex= Lex; sp_variable *spvar= $2; - if (lex->sphead->fill_field_definition(thd, lex, lex->last_field)) + if (lex->sphead->fill_field_definition(thd, lex->last_field)) { MYSQL_YYABORT; } @@ -3121,8 +3121,7 @@ sp_decl: spvar->default_value= dflt_value_item; spvar->field_def.field_name= spvar->name.str; - if (lex->sphead->fill_field_definition(thd, lex, - &spvar->field_def)) + if (lex->sphead->fill_field_definition(thd, &spvar->field_def)) { MYSQL_YYABORT; } @@ -16715,7 +16714,7 @@ sf_tail: } type_with_opt_collate /* $11 */ { /* $12 */ - if (Lex->sphead->fill_field_definition(thd, Lex, Lex->last_field)) + if (Lex->sphead->fill_field_definition(thd, Lex->last_field)) MYSQL_YYABORT; } sp_c_chistics /* $13 */ From cba0092196bff42e956de6a2c364e3951541a9d6 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 21 Nov 2016 17:23:10 +0400 Subject: [PATCH 122/135] MDEV-11294 Move definitions of Derivation, DTCollation, Type_std_attributes from field.h and item.h to sql_type.h --- sql/field.h | 28 ++++---- sql/item.h | 153 ---------------------------------------- sql/item_func.cc | 4 +- sql/sql_type.h | 180 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 196 insertions(+), 169 deletions(-) diff --git a/sql/field.h b/sql/field.h index 36ac7f5f528..76cdfe63319 100644 --- a/sql/field.h +++ b/sql/field.h @@ -31,6 +31,7 @@ #include "my_decimal.h" /* my_decimal */ #include "sql_error.h" /* Sql_condition */ #include "compat56.h" +#include "sql_type.h" /* Type_std_attributes */ class Send_field; class Copy_field; @@ -403,25 +404,10 @@ public: }; -enum Derivation -{ - DERIVATION_IGNORABLE= 6, - DERIVATION_NUMERIC= 5, - DERIVATION_COERCIBLE= 4, - DERIVATION_SYSCONST= 3, - DERIVATION_IMPLICIT= 2, - DERIVATION_NONE= 1, - DERIVATION_EXPLICIT= 0 -}; - - #define STORAGE_TYPE_MASK 7 #define COLUMN_FORMAT_MASK 7 #define COLUMN_FORMAT_SHIFT 3 -#define my_charset_numeric my_charset_latin1 -#define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII - /* The length of the header part for each virtual column in the .frm file */ #define FRM_VCOL_OLD_HEADER_SIZE(b) (3 + MY_TEST(b)) #define FRM_VCOL_NEW_BASE_SIZE 16 @@ -796,6 +782,18 @@ public: uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg); virtual ~Field() {} + + DTCollation dtcollation() const + { + return DTCollation(charset(), derivation(), repertoire()); + } + Type_std_attributes type_std_attributes() const + { + return Type_std_attributes(field_length, decimals(), + MY_TEST(flags & UNSIGNED_FLAG), + dtcollation()); + } + /** Convenience definition of a copy function returned by Field::get_copy_func() diff --git a/sql/item.h b/sql/item.h index e0634e63c9b..b08788903a8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -113,124 +113,11 @@ bool mark_unsupported_function(const char *w1, const char *w2, #define SPLIT_SUM_SKIP_REGISTERED 1 /* Skip registered funcs */ #define SPLIT_SUM_SELECT 2 /* SELECT item; Split all parts */ -/* - "Declared Type Collation" - A combination of collation and its derivation. - - Flags for collation aggregation modes: - MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset - MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value - (i.e. constant). - MY_COLL_ALLOW_CONV - allow any kind of conversion - (combination of the above two) - MY_COLL_ALLOW_NUMERIC_CONV - if all items were numbers, convert to - @@character_set_connection - MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE - (e.g. when aggregating for comparison) - MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV - and MY_COLL_DISALLOW_NONE -*/ - -#define MY_COLL_ALLOW_SUPERSET_CONV 1 -#define MY_COLL_ALLOW_COERCIBLE_CONV 2 -#define MY_COLL_DISALLOW_NONE 4 -#define MY_COLL_ALLOW_NUMERIC_CONV 8 - -#define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV) -#define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE) #define NO_EXTRACTION_FL (1 << 6) #define FULL_EXTRACTION_FL (1 << 7) #define EXTRACTION_MASK (NO_EXTRACTION_FL | FULL_EXTRACTION_FL) -class DTCollation { -public: - CHARSET_INFO *collation; - enum Derivation derivation; - uint repertoire; - - void set_repertoire_from_charset(CHARSET_INFO *cs) - { - repertoire= cs->state & MY_CS_PUREASCII ? - MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; - } - DTCollation() - { - collation= &my_charset_bin; - derivation= DERIVATION_NONE; - repertoire= MY_REPERTOIRE_UNICODE30; - } - DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg) - { - collation= collation_arg; - derivation= derivation_arg; - set_repertoire_from_charset(collation_arg); - } - DTCollation(CHARSET_INFO *collation_arg, - Derivation derivation_arg, - uint repertoire_arg) - :collation(collation_arg), - derivation(derivation_arg), - repertoire(repertoire_arg) - { } - void set(const DTCollation &dt) - { - collation= dt.collation; - derivation= dt.derivation; - repertoire= dt.repertoire; - } - void set(CHARSET_INFO *collation_arg, Derivation derivation_arg) - { - collation= collation_arg; - derivation= derivation_arg; - set_repertoire_from_charset(collation_arg); - } - void set(CHARSET_INFO *collation_arg, - Derivation derivation_arg, - uint repertoire_arg) - { - collation= collation_arg; - derivation= derivation_arg; - repertoire= repertoire_arg; - } - void set_numeric() - { - collation= &my_charset_numeric; - derivation= DERIVATION_NUMERIC; - repertoire= MY_REPERTOIRE_NUMERIC; - } - void set(CHARSET_INFO *collation_arg) - { - collation= collation_arg; - set_repertoire_from_charset(collation_arg); - } - void set(Derivation derivation_arg) - { derivation= derivation_arg; } - bool aggregate(const DTCollation &dt, uint flags= 0); - bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) - { set(dt1); return aggregate(dt2, flags); } - const char *derivation_name() const - { - switch(derivation) - { - case DERIVATION_NUMERIC: return "NUMERIC"; - case DERIVATION_IGNORABLE: return "IGNORABLE"; - case DERIVATION_COERCIBLE: return "COERCIBLE"; - case DERIVATION_IMPLICIT: return "IMPLICIT"; - case DERIVATION_SYSCONST: return "SYSCONST"; - case DERIVATION_EXPLICIT: return "EXPLICIT"; - case DERIVATION_NONE: return "NONE"; - default: return "UNKNOWN"; - } - } - int sortcmp(const String *s, const String *t) const - { - return collation->coll->strnncollsp(collation, - (uchar *) s->ptr(), s->length(), - (uchar *) t->ptr(), t->length()); - } -}; - void dummy_error_processor(THD *thd, void *data); @@ -601,46 +488,6 @@ public: }; -/** - A class to store type attributes for the standard data types. - Does not include attributes for the extended data types - such as ENUM, SET, GEOMETRY. -*/ -class Type_std_attributes -{ -public: - DTCollation collation; - uint decimals; - /* - The maximum value length in characters multiplied by collation->mbmaxlen. - Almost always it's the maximum value length in bytes. - */ - uint32 max_length; - bool unsigned_flag; - Type_std_attributes() - :collation(&my_charset_bin, DERIVATION_COERCIBLE), - decimals(0), max_length(0), unsigned_flag(false) - { } - Type_std_attributes(const Type_std_attributes *other) - :collation(other->collation), - decimals(other->decimals), - max_length(other->max_length), - unsigned_flag(other->unsigned_flag) - { } - void set(const Type_std_attributes *other) - { - *this= *other; - } - void set(const Field *field) - { - decimals= field->decimals(); - max_length= field->field_length; - collation.set(field->charset()); - unsigned_flag= MY_TEST(field->flags & UNSIGNED_FLAG); - } -}; - - class Item: public Value_source, public Type_std_attributes { diff --git a/sql/item_func.cc b/sql/item_func.cc index 9bafe25e431..01d4e81f835 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -6611,7 +6611,9 @@ void Item_func_sp::fix_length_and_dec() DBUG_ENTER("Item_func_sp::fix_length_and_dec"); DBUG_ASSERT(sp_result_field); - Type_std_attributes::set(sp_result_field); + Type_std_attributes::set(sp_result_field->type_std_attributes()); + // There is a bug in the line below. See MDEV-11292 for details. + collation.derivation= DERIVATION_COERCIBLE; maybe_null= 1; DBUG_VOID_RETURN; diff --git a/sql/sql_type.h b/sql/sql_type.h index 4b05a4663c4..de5c31a87e1 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -30,6 +30,186 @@ class Sort_param; struct TABLE; struct SORT_FIELD_ATTR; + +/* + Flags for collation aggregation modes, used in TDCollation::agg(): + + MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset + MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value + (i.e. constant). + MY_COLL_ALLOW_CONV - allow any kind of conversion + (combination of the above two) + MY_COLL_ALLOW_NUMERIC_CONV - if all items were numbers, convert to + @@character_set_connection + MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE + (e.g. when aggregating for comparison) + MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV + and MY_COLL_DISALLOW_NONE +*/ + +#define MY_COLL_ALLOW_SUPERSET_CONV 1 +#define MY_COLL_ALLOW_COERCIBLE_CONV 2 +#define MY_COLL_DISALLOW_NONE 4 +#define MY_COLL_ALLOW_NUMERIC_CONV 8 + +#define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV) +#define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE) + + +#define my_charset_numeric my_charset_latin1 +#define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII + + +enum Derivation +{ + DERIVATION_IGNORABLE= 6, + DERIVATION_NUMERIC= 5, + DERIVATION_COERCIBLE= 4, + DERIVATION_SYSCONST= 3, + DERIVATION_IMPLICIT= 2, + DERIVATION_NONE= 1, + DERIVATION_EXPLICIT= 0 +}; + + +/** + "Declared Type Collation" + A combination of collation and its derivation. +*/ + +class DTCollation { +public: + CHARSET_INFO *collation; + enum Derivation derivation; + uint repertoire; + + void set_repertoire_from_charset(CHARSET_INFO *cs) + { + repertoire= cs->state & MY_CS_PUREASCII ? + MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; + } + DTCollation() + { + collation= &my_charset_bin; + derivation= DERIVATION_NONE; + repertoire= MY_REPERTOIRE_UNICODE30; + } + DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg) + { + collation= collation_arg; + derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); + } + DTCollation(CHARSET_INFO *collation_arg, + Derivation derivation_arg, + uint repertoire_arg) + :collation(collation_arg), + derivation(derivation_arg), + repertoire(repertoire_arg) + { } + void set(const DTCollation &dt) + { + collation= dt.collation; + derivation= dt.derivation; + repertoire= dt.repertoire; + } + void set(CHARSET_INFO *collation_arg, Derivation derivation_arg) + { + collation= collation_arg; + derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(CHARSET_INFO *collation_arg, + Derivation derivation_arg, + uint repertoire_arg) + { + collation= collation_arg; + derivation= derivation_arg; + repertoire= repertoire_arg; + } + void set_numeric() + { + collation= &my_charset_numeric; + derivation= DERIVATION_NUMERIC; + repertoire= MY_REPERTOIRE_NUMERIC; + } + void set(CHARSET_INFO *collation_arg) + { + collation= collation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(Derivation derivation_arg) + { derivation= derivation_arg; } + bool aggregate(const DTCollation &dt, uint flags= 0); + bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) + { set(dt1); return aggregate(dt2, flags); } + const char *derivation_name() const + { + switch(derivation) + { + case DERIVATION_NUMERIC: return "NUMERIC"; + case DERIVATION_IGNORABLE: return "IGNORABLE"; + case DERIVATION_COERCIBLE: return "COERCIBLE"; + case DERIVATION_IMPLICIT: return "IMPLICIT"; + case DERIVATION_SYSCONST: return "SYSCONST"; + case DERIVATION_EXPLICIT: return "EXPLICIT"; + case DERIVATION_NONE: return "NONE"; + default: return "UNKNOWN"; + } + } + int sortcmp(const String *s, const String *t) const + { + return collation->coll->strnncollsp(collation, + (uchar *) s->ptr(), s->length(), + (uchar *) t->ptr(), t->length()); + } +}; + + +/** + A class to store type attributes for the standard data types. + Does not include attributes for the extended data types + such as ENUM, SET, GEOMETRY. +*/ +class Type_std_attributes +{ +public: + DTCollation collation; + uint decimals; + /* + The maximum value length in characters multiplied by collation->mbmaxlen. + Almost always it's the maximum value length in bytes. + */ + uint32 max_length; + bool unsigned_flag; + Type_std_attributes() + :collation(&my_charset_bin, DERIVATION_COERCIBLE), + decimals(0), max_length(0), unsigned_flag(false) + { } + Type_std_attributes(const Type_std_attributes *other) + :collation(other->collation), + decimals(other->decimals), + max_length(other->max_length), + unsigned_flag(other->unsigned_flag) + { } + Type_std_attributes(uint32 max_length_arg, uint decimals_arg, + bool unsigned_flag_arg, const DTCollation &dtc) + :collation(dtc), + decimals(decimals_arg), + max_length(max_length_arg), + unsigned_flag(unsigned_flag_arg) + { } + void set(const Type_std_attributes *other) + { + *this= *other; + } + void set(const Type_std_attributes &other) + { + *this= other; + } +}; + + class Type_handler { protected: From 4b4efb04854388f525d6515e5f95ecb92d992b34 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 24 Nov 2016 21:57:14 +0400 Subject: [PATCH 123/135] MDEV-11346 Move functions case_stmt_xxx and add_select_to_union_list as methods to LEX The full list of functions moved: int case_stmt_action_expr(LEX *, Item* expr); int case_stmt_action_when(LEX *, Item *when, bool simple); int case_stmt_action_then(LEX *); bool add_select_to_union_list(LEX *,bool is_union_distinct, bool is_top_level); This is a preparatory change for "MDEV-10142 PL/SQL parser", to reuse the code easier between sql_yacc.yy and coming soon sql_yacc_ora.yy. --- sql/sql_lex.h | 6 +++ sql/sql_yacc.yy | 100 ++++++++++++++++++++++-------------------------- 2 files changed, 52 insertions(+), 54 deletions(-) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8f5deb8e7bd..6e248594d4b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3010,6 +3010,12 @@ public: return false; } + int case_stmt_action_expr(Item* expr); + int case_stmt_action_when(Item *when, bool simple); + int case_stmt_action_then(); + bool add_select_to_union_list(bool is_union_distinct, bool is_top_level); + bool setup_select_in_parentheses(); + // Check if "KEY IF NOT EXISTS name" used outside of ALTER context bool check_add_key(DDL_options_st ddl) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index b5d49382bff..3703a027186 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -290,22 +290,20 @@ static bool push_sp_empty_label(THD *thd) @return 0 on success */ -int case_stmt_action_expr(LEX *lex, Item* expr) +int LEX::case_stmt_action_expr(Item* expr) { - sp_head *sp= lex->sphead; - sp_pcontext *parsing_ctx= lex->spcont; - int case_expr_id= parsing_ctx->register_case_expr(); + int case_expr_id= spcont->register_case_expr(); sp_instr_set_case_expr *i; - if (parsing_ctx->push_case_expr_id(case_expr_id)) + if (spcont->push_case_expr_id(case_expr_id)) return 1; - i= new (lex->thd->mem_root) - sp_instr_set_case_expr(sp->instructions(), parsing_ctx, case_expr_id, expr, - lex); + i= new (thd->mem_root) + sp_instr_set_case_expr(sphead->instructions(), spcont, case_expr_id, expr, + this); - sp->add_cont_backpatch(i); - return sp->add_instr(i); + sphead->add_cont_backpatch(i); + return sphead->add_instr(i); } /** @@ -316,33 +314,30 @@ int case_stmt_action_expr(LEX *lex, Item* expr) @param simple true for simple cases, false for searched cases */ -int case_stmt_action_when(LEX *lex, Item *when, bool simple) +int LEX::case_stmt_action_when(Item *when, bool simple) { - sp_head *sp= lex->sphead; - sp_pcontext *ctx= lex->spcont; - uint ip= sp->instructions(); + uint ip= sphead->instructions(); sp_instr_jump_if_not *i; Item_case_expr *var; Item *expr; - THD *thd= lex->thd; if (simple) { var= new (thd->mem_root) - Item_case_expr(thd, ctx->get_current_case_expr_id()); + Item_case_expr(thd, spcont->get_current_case_expr_id()); #ifndef DBUG_OFF if (var) { - var->m_sp= sp; + var->m_sp= sphead; } #endif expr= new (thd->mem_root) Item_func_eq(thd, var, when); - i= new (thd->mem_root) sp_instr_jump_if_not(ip, ctx, expr, lex); + i= new (thd->mem_root) sp_instr_jump_if_not(ip, spcont, expr, this); } else - i= new (thd->mem_root) sp_instr_jump_if_not(ip, ctx, when, lex); + i= new (thd->mem_root) sp_instr_jump_if_not(ip, spcont, when, this); /* BACKPATCH: Registering forward jump from @@ -350,10 +345,11 @@ int case_stmt_action_when(LEX *lex, Item *when, bool simple) (jump_if_not from instruction 2 to 5, 5 to 8 ... in the example) */ - return !MY_TEST(i) || - sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0)) || - sp->add_cont_backpatch(i) || - sp->add_instr(i); + return + !MY_TEST(i) || + sphead->push_backpatch(thd, i, spcont->push_label(thd, empty_lex_str, 0)) || + sphead->add_cont_backpatch(i) || + sphead->add_instr(i); } /** @@ -362,13 +358,11 @@ int case_stmt_action_when(LEX *lex, Item *when, bool simple) @param lex the parser lex context */ -int case_stmt_action_then(LEX *lex) +int LEX::case_stmt_action_then() { - sp_head *sp= lex->sphead; - sp_pcontext *ctx= lex->spcont; - uint ip= sp->instructions(); - sp_instr_jump *i= new (lex->thd->mem_root) sp_instr_jump(ip, ctx); - if (!MY_TEST(i) || sp->add_instr(i)) + uint ip= sphead->instructions(); + sp_instr_jump *i= new (thd->mem_root) sp_instr_jump(ip, spcont); + if (!MY_TEST(i) || sphead->add_instr(i)) return 1; /* @@ -377,7 +371,7 @@ int case_stmt_action_then(LEX *lex) (jump_if_not from instruction 2 to 5, 5 to 8 ... in the example) */ - sp->backpatch(ctx->pop_label()); + sphead->backpatch(spcont->pop_label()); /* BACKPATCH: Registering forward jump from @@ -385,7 +379,7 @@ int case_stmt_action_then(LEX *lex) (jump from instruction 4 to 12, 7 to 12 ... in the example) */ - return sp->push_backpatch(lex->thd, i, ctx->last_label()); + return sphead->push_backpatch(thd, i, spcont->last_label()); } static bool @@ -673,43 +667,43 @@ Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal, @return false if successful, true if an error was reported. In the latter case parsing should stop. */ -bool add_select_to_union_list(LEX *lex, bool is_union_distinct, - bool is_top_level) +bool LEX::add_select_to_union_list(bool is_union_distinct, + bool is_top_level) { /* Only the last SELECT can have INTO. Since the grammar won't allow INTO in a nested SELECT, we make this check only when creating a top-level SELECT. */ - if (is_top_level && lex->result) + if (is_top_level && result) { my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO"); return TRUE; } - if (lex->current_select->order_list.first && !lex->current_select->braces) + if (current_select->order_list.first && !current_select->braces) { my_error(ER_WRONG_USAGE, MYF(0), "UNION", "ORDER BY"); return TRUE; } - if (lex->current_select->explicit_limit && !lex->current_select->braces) + if (current_select->explicit_limit && !current_select->braces) { my_error(ER_WRONG_USAGE, MYF(0), "UNION", "LIMIT"); return TRUE; } - if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) + if (current_select->linkage == GLOBAL_OPTIONS_TYPE) { - my_parse_error(lex->thd, ER_SYNTAX_ERROR); + my_parse_error(thd, ER_SYNTAX_ERROR); return TRUE; } /* This counter shouldn't be incremented for UNION parts */ - lex->nest_level--; - if (mysql_new_select(lex, 0)) + nest_level--; + if (mysql_new_select(this, 0)) return TRUE; - mysql_init_select(lex); - lex->current_select->linkage=UNION_TYPE; + mysql_init_select(this); + current_select->linkage=UNION_TYPE; if (is_union_distinct) /* UNION DISTINCT - remember position */ - lex->current_select->master_unit()->union_distinct= - lex->current_select; + current_select->master_unit()->union_distinct= + current_select; return FALSE; } @@ -4094,7 +4088,7 @@ case_stmt_body: { Lex->sphead->reset_lex(thd); /* For expr $2 */ } expr { - if (case_stmt_action_expr(Lex, $2)) + if (Lex->case_stmt_action_expr($2)) MYSQL_YYABORT; if (Lex->sphead->restore_lex(thd)) @@ -4126,7 +4120,7 @@ simple_when_clause: /* Simple case: = */ LEX *lex= Lex; - if (case_stmt_action_when(lex, $3, true)) + if (lex->case_stmt_action_when($3, true)) MYSQL_YYABORT; /* For expr $3 */ if (lex->sphead->restore_lex(thd)) @@ -4135,8 +4129,7 @@ simple_when_clause: THEN_SYM sp_proc_stmts1 { - LEX *lex= Lex; - if (case_stmt_action_then(lex)) + if (Lex->case_stmt_action_then()) MYSQL_YYABORT; } ; @@ -4149,7 +4142,7 @@ searched_when_clause: expr { LEX *lex= Lex; - if (case_stmt_action_when(lex, $3, false)) + if (lex->case_stmt_action_when($3, false)) MYSQL_YYABORT; /* For expr $3 */ if (lex->sphead->restore_lex(thd)) @@ -4158,8 +4151,7 @@ searched_when_clause: THEN_SYM sp_proc_stmts1 { - LEX *lex= Lex; - if (case_stmt_action_then(lex)) + if (Lex->case_stmt_action_then()) MYSQL_YYABORT; } ; @@ -16183,7 +16175,7 @@ union_clause: union_list: UNION_SYM union_option { - if (add_select_to_union_list(Lex, (bool)$2, TRUE)) + if (Lex->add_select_to_union_list((bool)$2, TRUE)) MYSQL_YYABORT; } union_list_part2 @@ -16199,7 +16191,7 @@ union_list: union_list_view: UNION_SYM union_option { - if (add_select_to_union_list(Lex, (bool)$2, TRUE)) + if (Lex->add_select_to_union_list((bool)$2, TRUE)) MYSQL_YYABORT; } query_expression_body_view @@ -16240,7 +16232,7 @@ order_or_limit: union_head_non_top: UNION_SYM union_option { - if (add_select_to_union_list(Lex, (bool)$2, FALSE)) + if (Lex->add_select_to_union_list((bool)$2, FALSE)) MYSQL_YYABORT; } ; From cb16d753b2db936afff844cca0dd434fa7fe736b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 25 Nov 2016 07:40:10 +0400 Subject: [PATCH 124/135] MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler Also fixes: MDEV-11331 Wrong result for INSERT INTO t1 (datetime_field) VALUES (hybrid_function_of_TIME_data_type) MDEV-11333 Expect "Impossible where condition" for WHERE timestamp_field>=DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR) This patch does the following: 1. Splits the function Item::save_in_field() into pieces: - Item::save_str_in_field() - Item::save_real_in_field() - Item::save_decimal_in_field() - Item::save_int_in_field() 2. Adds the missing "no_conversion" parameters to Item::save_time_in_field() and Item::save_date_in_field(), so this parameter is now correctly passed to set_field_to_null_with_conversions(). This fixes the problem reported in 11333. 3. Introduces a new virtual method Type_handler::Item_save_in_field() and uses the methods Item::save_xxx_in_field() from the implementations of Type_handler_xxx::Item_save_in_field(). These changes additionally fix the problem reported in MDEV-11331, as the old code erroneously handled expressions like COALESE(datetime-expression) through the STRING_RESULT branch of Item::save_in_field() and therefore they looked like string type expressions for the target fields. Now such expressions are correctly handled by Item::save_date_in_field(). --- mysql-test/r/default.result | 13 +--- mysql-test/r/type_datetime.result | 21 ++++++ mysql-test/r/type_timestamp.result | 32 +++++++++ mysql-test/t/default.test | 2 - mysql-test/t/type_datetime.test | 21 ++++++ mysql-test/t/type_timestamp.test | 24 +++++++ sql/item.cc | 106 ++++++++++++++++------------- sql/item.h | 11 ++- sql/item_timefunc.h | 2 +- sql/sql_type.cc | 44 ++++++++++++ sql/sql_type.h | 42 +++++++++--- 11 files changed, 242 insertions(+), 76 deletions(-) diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index efc2ec640f3..fb203cd3141 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -991,14 +991,9 @@ t1 CREATE TABLE `t1` ( `a` decimal(30,6) DEFAULT coalesce(current_timestamp(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 INSERT IGNORE INTO t1 VALUES(); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 SET sql_mode = 'STRICT_ALL_TABLES'; INSERT INTO t1 VALUES(); -ERROR 01000: Data truncated for column 'a' at row 1 SET sql_mode = DEFAULT; DROP TABLE t1; # @@ -1011,8 +1006,6 @@ t1 CREATE TABLE `t1` ( `a` decimal(30,6) DEFAULT coalesce(curtime(6)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 DROP TABLE t1; # # DECIMAL + CURRENT_DATE, no truncation @@ -1024,8 +1017,6 @@ t1 CREATE TABLE `t1` ( `a` decimal(30,6) DEFAULT coalesce(curdate()) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 DROP TABLE t1; # # COALESCE for SQL Standard @@ -1082,10 +1073,10 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 VALUES (); Warnings: Note 1265 Data truncated for column 'a' at row 1 -Warning 1265 Data truncated for column 'b' at row 1 +Note 1265 Data truncated for column 'b' at row 1 SELECT * FROM t1; a b -20010101102030 2001 +20010101102030 20010101102030 DROP TABLE t1; # # Check DEFAULT() function diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 8588ad185ed..0df6b2b04c3 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1199,3 +1199,24 @@ DROP TABLE t1; # # End of 10.2 tests # +# +# Start of 10.3 tests +# +# +# MDEV-11331 Wrong result for INSERT INTO t1 (datetime_field) VALUES (hybrid_function_of_TIME_data_type) +# +SET timestamp=UNIX_TIMESTAMP('2001-02-03 10:00:00'); +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (TIME'10:20:30'); +INSERT INTO t1 VALUES (COALESCE(TIME'10:20:30')); +INSERT INTO t1 VALUES (LEAST(TIME'10:20:30',TIME'10:20:30')); +SELECT * FROM t1; +a +2001-02-03 10:20:30 +2001-02-03 10:20:30 +2001-02-03 10:20:30 +DROP TABLE t1; +SET timestamp=DEFAULT; +# +# End of 10.3 tests +# diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 93180218fe4..c5e41a237fc 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -950,3 +950,35 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.3 tests +# +# +# MDEV-11333 MDEV-11333 Expect "Impossible where condition" for WHERE timestamp_field>=DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR) +# +SELECT DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR); +DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR) +NULL +Warnings: +Warning 1441 Datetime function: datetime field overflow +CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +EXPLAIN SELECT * FROM t1 WHERE a >= DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 1441 Datetime function: datetime field overflow +EXPLAIN SELECT * FROM t1 WHERE a >= COALESCE(DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 1441 Datetime function: datetime field overflow +DROP TABLE t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index d9d7f429848..a81f4867add 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -756,11 +756,9 @@ DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6))); SHOW CREATE TABLE t1; -# Same as insert into t1 values ("2016-06-05 12:54:52.342095"); INSERT INTO t1 VALUES(); INSERT IGNORE INTO t1 VALUES(); SET sql_mode = 'STRICT_ALL_TABLES'; ---error WARN_DATA_TRUNCATED INSERT INTO t1 VALUES(); SET sql_mode = DEFAULT; DROP TABLE t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index b16d426ab70..1809f304457 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -751,3 +751,24 @@ DROP TABLE t1; --echo # --echo # End of 10.2 tests --echo # + +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-11331 Wrong result for INSERT INTO t1 (datetime_field) VALUES (hybrid_function_of_TIME_data_type) +--echo # +SET timestamp=UNIX_TIMESTAMP('2001-02-03 10:00:00'); +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (TIME'10:20:30'); +INSERT INTO t1 VALUES (COALESCE(TIME'10:20:30')); +INSERT INTO t1 VALUES (LEAST(TIME'10:20:30',TIME'10:20:30')); +SELECT * FROM t1; +DROP TABLE t1; +SET timestamp=DEFAULT; + + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 460769f8961..2dad92b6b90 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -555,3 +555,27 @@ let defval='0000-00-00 00:00:00'; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-11333 MDEV-11333 Expect "Impossible where condition" for WHERE timestamp_field>=DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR) +--echo # + +SELECT DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR); +CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +INSERT INTO t1 VALUES('2001-01-01'),('2002-02-02'),('2003-03-03'); +EXPLAIN SELECT * FROM t1 WHERE a >= DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR); +EXPLAIN SELECT * FROM t1 WHERE a >= COALESCE(DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR)); +DROP TABLE t1; + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/sql/item.cc b/sql/item.cc index ead45f84305..64d6cb703bd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -419,21 +419,21 @@ longlong Item::val_int_from_decimal() return result; } -int Item::save_time_in_field(Field *field) +int Item::save_time_in_field(Field *field, bool no_conversions) { MYSQL_TIME ltime; if (get_time(<ime)) - return set_field_to_null_with_conversions(field, 0); + return set_field_to_null_with_conversions(field, no_conversions); field->set_notnull(); return field->store_time_dec(<ime, decimals); } -int Item::save_date_in_field(Field *field) +int Item::save_date_in_field(Field *field, bool no_conversions) { MYSQL_TIME ltime; if (get_date(<ime, sql_mode_for_dates(field->table->in_use))) - return set_field_to_null_with_conversions(field, 0); + return set_field_to_null_with_conversions(field, no_conversions); field->set_notnull(); return field->store_time_dec(<ime, decimals); } @@ -6265,54 +6265,62 @@ int Item_null::save_safe_in_field(Field *field) Note: all Item_XXX::val_str(str) methods must NOT assume that str != str_value. For example, see fix for bug #44743. */ +int Item::save_str_in_field(Field *field, bool no_conversions) +{ + String *result; + CHARSET_INFO *cs= collation.collation; + char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns + str_value.set_quick(buff, sizeof(buff), cs); + result=val_str(&str_value); + if (null_value) + { + str_value.set_quick(0, 0, cs); + return set_field_to_null_with_conversions(field, no_conversions); + } + + /* NOTE: If null_value == FALSE, "result" must be not NULL. */ + + field->set_notnull(); + int error= field->store(result->ptr(),result->length(),cs); + str_value.set_quick(0, 0, cs); + return error; +} + + +int Item::save_real_in_field(Field *field, bool no_conversions) +{ + double nr= val_real(); + if (null_value) + return set_field_to_null_with_conversions(field, no_conversions); + field->set_notnull(); + return field->store(nr); +} + + +int Item::save_decimal_in_field(Field *field, bool no_conversions) +{ + my_decimal decimal_value; + my_decimal *value= val_decimal(&decimal_value); + if (null_value) + return set_field_to_null_with_conversions(field, no_conversions); + field->set_notnull(); + return field->store_decimal(value); +} + + +int Item::save_int_in_field(Field *field, bool no_conversions) +{ + longlong nr= val_int(); + if (null_value) + return set_field_to_null_with_conversions(field, no_conversions); + field->set_notnull(); + return field->store(nr, unsigned_flag); +} + int Item::save_in_field(Field *field, bool no_conversions) { - int error; - if (result_type() == STRING_RESULT) - { - String *result; - CHARSET_INFO *cs= collation.collation; - char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns - str_value.set_quick(buff, sizeof(buff), cs); - result=val_str(&str_value); - if (null_value) - { - str_value.set_quick(0, 0, cs); - return set_field_to_null_with_conversions(field, no_conversions); - } - - /* NOTE: If null_value == FALSE, "result" must be not NULL. */ - - field->set_notnull(); - error=field->store(result->ptr(),result->length(),cs); - str_value.set_quick(0, 0, cs); - } - else if (result_type() == REAL_RESULT) - { - double nr= val_real(); - if (null_value) - return set_field_to_null_with_conversions(field, no_conversions); - field->set_notnull(); - error=field->store(nr); - } - else if (result_type() == DECIMAL_RESULT) - { - my_decimal decimal_value; - my_decimal *value= val_decimal(&decimal_value); - if (null_value) - return set_field_to_null_with_conversions(field, no_conversions); - field->set_notnull(); - error=field->store_decimal(value); - } - else - { - longlong nr=val_int(); - if (null_value) - return set_field_to_null_with_conversions(field, no_conversions); - field->set_notnull(); - error=field->store(nr, unsigned_flag); - } + int error= type_handler()->Item_save_in_field(this, field, no_conversions); return error ? error : (field->table->in_use->is_error() ? 1 : 0); } diff --git a/sql/item.h b/sql/item.h index b08788903a8..1c910d16247 100644 --- a/sql/item.h +++ b/sql/item.h @@ -991,8 +991,13 @@ public: // Check NULL value for a TIME, DATE or DATETIME expression bool is_null_from_temporal(); - int save_time_in_field(Field *field); - int save_date_in_field(Field *field); + int save_time_in_field(Field *field, bool no_conversions); + int save_date_in_field(Field *field, bool no_conversions); + int save_str_in_field(Field *field, bool no_conversions); + int save_real_in_field(Field *field, bool no_conversions); + int save_int_in_field(Field *field, bool no_conversions); + int save_decimal_in_field(Field *field, bool no_conversions); + int save_str_value_in_field(Field *field, String *result); virtual Field *get_tmp_table_field() { return 0; } @@ -3459,7 +3464,7 @@ public: my_decimal *val_decimal(my_decimal *decimal_value) { return val_decimal_from_date(decimal_value); } int save_in_field(Field *field, bool no_conversions) - { return save_date_in_field(field); } + { return save_date_in_field(field, no_conversions); } }; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index dafcdf64b45..ad92f50661b 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -548,7 +548,7 @@ public: Field *create_field_for_create_select(TABLE *table) { return tmp_table_field_from_field_type(table, false, false); } int save_in_field(Field *field, bool no_conversions) - { return save_date_in_field(field); } + { return save_date_in_field(field, no_conversions); } void fix_length_and_dec(); }; diff --git a/sql/sql_type.cc b/sql/sql_type.cc index a80417f60b9..42aa37a19a7 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -640,3 +640,47 @@ Field *Type_handler_set::make_conversion_table_field(TABLE *table, metadata & 0x00ff/*pack_length()*/, ((const Field_enum*) target)->typelib, target->charset()); } + +/*************************************************************************/ + +int Type_handler_time_common::Item_save_in_field(Item *item, Field *field, + bool no_conversions) const +{ + return item->save_time_in_field(field, no_conversions); +} + +int Type_handler_temporal_with_date::Item_save_in_field(Item *item, + Field *field, + bool no_conversions) + const +{ + return item->save_date_in_field(field, no_conversions); +} + + +int Type_handler_string_result::Item_save_in_field(Item *item, Field *field, + bool no_conversions) const +{ + return item->save_str_in_field(field, no_conversions); +} + + +int Type_handler_real_result::Item_save_in_field(Item *item, Field *field, + bool no_conversions) const +{ + return item->save_real_in_field(field, no_conversions); +} + + +int Type_handler_decimal_result::Item_save_in_field(Item *item, Field *field, + bool no_conversions) const +{ + return item->save_decimal_in_field(field, no_conversions); +} + + +int Type_handler_int_result::Item_save_in_field(Item *item, Field *field, + bool no_conversions) const +{ + return item->save_int_in_field(field, no_conversions); +} diff --git a/sql/sql_type.h b/sql/sql_type.h index de5c31a87e1..0147ee5639b 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -272,6 +272,9 @@ public: virtual void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const= 0; + + virtual int Item_save_in_field(Item *item, Field *field, + bool no_conversions) const= 0; }; @@ -288,6 +291,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; }; @@ -303,6 +307,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; }; @@ -318,6 +323,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; }; @@ -349,6 +355,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; }; @@ -463,28 +470,43 @@ public: }; -class Type_handler_time: public Type_handler_temporal_result +class Type_handler_time_common: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_time_common() { } + enum_field_types field_type() const { return MYSQL_TYPE_TIME; } + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; +}; + + +class Type_handler_time: public Type_handler_time_common { public: virtual ~Type_handler_time() {} - enum_field_types field_type() const { return MYSQL_TYPE_TIME; } Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; -class Type_handler_time2: public Type_handler_temporal_result +class Type_handler_time2: public Type_handler_time_common { public: virtual ~Type_handler_time2() {} - enum_field_types field_type() const { return MYSQL_TYPE_TIME; } enum_field_types real_field_type() const { return MYSQL_TYPE_TIME2; } Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; -class Type_handler_date: public Type_handler_temporal_result +class Type_handler_temporal_with_date: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_temporal_with_date() {} + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; +}; + + +class Type_handler_date: public Type_handler_temporal_with_date { public: virtual ~Type_handler_date() {} @@ -494,7 +516,7 @@ public: }; -class Type_handler_newdate: public Type_handler_temporal_result +class Type_handler_newdate: public Type_handler_temporal_with_date { public: virtual ~Type_handler_newdate() {} @@ -504,7 +526,7 @@ public: }; -class Type_handler_datetime: public Type_handler_temporal_result +class Type_handler_datetime: public Type_handler_temporal_with_date { public: virtual ~Type_handler_datetime() {} @@ -514,7 +536,7 @@ public: }; -class Type_handler_datetime2: public Type_handler_temporal_result +class Type_handler_datetime2: public Type_handler_temporal_with_date { public: virtual ~Type_handler_datetime2() {} @@ -525,7 +547,7 @@ public: }; -class Type_handler_timestamp: public Type_handler_temporal_result +class Type_handler_timestamp: public Type_handler_temporal_with_date { public: virtual ~Type_handler_timestamp() {} @@ -535,7 +557,7 @@ public: }; -class Type_handler_timestamp2: public Type_handler_temporal_result +class Type_handler_timestamp2: public Type_handler_temporal_with_date { public: virtual ~Type_handler_timestamp2() {} From 2637828065d5687c58b03be883a422b5d326af47 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 24 Nov 2016 16:26:30 +0400 Subject: [PATCH 125/135] MDEV-11344 Split Arg_comparator::set_compare_func() into virtual methods in Type_handler This patch: - Introduces a new virtuial method Type_handler::set_comparator_func and moves pieces of the code from the switch in Arg_comparator::set_compare_func into the corresponding Type_handler_xxx::set_comparator_func. - Adds Type_handler::get_handler_by_cmp_type() - Moves Type_handler_hybrid_field_type::get_handler_by_result_type() to a static method Type_handler::get_handler_by_result_type(), for symmetry with similar methods: * Type_handler::get_handler_by_field_type() * Type_handler::get_handler_by_real_type() * Type_handler::get_handler_by_cmp_type() - Introduces Type_handler_row, to unify the code for the scalar data types and the ROW data type (currently for comparison purposes only). - Adds public type_handler_row, as it's now needed in item_row.h - Makes type_handler_null public, as it's now needed in item_cmpfunc.h Note, other type_handler_xxx will become public as well later. - Removes the global variable Arg_comparator::comparator_matrix, as it's not needed any more. --- sql/item_cmpfunc.cc | 212 ++++++++++++++++++++++++-------------------- sql/item_cmpfunc.h | 21 +++-- sql/item_row.h | 1 + sql/mysqld.cc | 8 -- sql/sql_type.cc | 50 +++++++++-- sql/sql_type.h | 77 +++++++++++++++- 6 files changed, 250 insertions(+), 119 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9891d117912..381db9e4975 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -522,78 +522,6 @@ void Item_bool_rowready_func2::fix_length_and_dec() } -int Arg_comparator::set_compare_func(Item_func_or_sum *item, Item_result type) -{ - owner= item; - func= comparator_matrix[type] - [is_owner_equal_func()]; - - switch (type) { - case TIME_RESULT: - m_compare_collation= &my_charset_numeric; - break; - case ROW_RESULT: - { - uint n= (*a)->cols(); - if (n != (*b)->cols()) - { - my_error(ER_OPERAND_COLUMNS, MYF(0), n); - comparators= 0; - return 1; - } - if (!(comparators= new Arg_comparator[n])) - return 1; - for (uint i=0; i < n; i++) - { - if ((*a)->element_index(i)->cols() != (*b)->element_index(i)->cols()) - { - my_error(ER_OPERAND_COLUMNS, MYF(0), (*a)->element_index(i)->cols()); - return 1; - } - if (comparators[i].set_cmp_func(owner, (*a)->addr(i), - (*b)->addr(i), set_null)) - return 1; - } - break; - } - case INT_RESULT: - { - if (func == &Arg_comparator::compare_int_signed) - { - if ((*a)->unsigned_flag) - func= (((*b)->unsigned_flag)? - &Arg_comparator::compare_int_unsigned : - &Arg_comparator::compare_int_unsigned_signed); - else if ((*b)->unsigned_flag) - func= &Arg_comparator::compare_int_signed_unsigned; - } - else if (func== &Arg_comparator::compare_e_int) - { - if ((*a)->unsigned_flag ^ (*b)->unsigned_flag) - func= &Arg_comparator::compare_e_int_diff_signedness; - } - break; - } - case STRING_RESULT: - case DECIMAL_RESULT: - break; - case REAL_RESULT: - { - if ((*a)->decimals < NOT_FIXED_DEC && (*b)->decimals < NOT_FIXED_DEC) - { - precision= 5 / log_10[MY_MAX((*a)->decimals, (*b)->decimals) + 1]; - if (func == &Arg_comparator::compare_real) - func= &Arg_comparator::compare_real_fixed; - else if (func == &Arg_comparator::compare_e_real) - func= &Arg_comparator::compare_e_real_fixed; - } - break; - } - } - return 0; -} - - /** Prepare the comparator (set the comparison function) for comparing items *a1 and *a2 in the context of 'type'. @@ -615,9 +543,51 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg, set_null= set_null && owner_arg; a= a1; b= a2; - m_compare_type= item_cmp_type(*a1, *a2); + m_compare_handler= Type_handler::get_handler_by_cmp_type(item_cmp_type(*a1, + *a2)); + return m_compare_handler->set_comparator_func(this); +} - if (m_compare_type == STRING_RESULT && + +bool Arg_comparator::set_cmp_func_for_row_arguments() +{ + uint n= (*a)->cols(); + if (n != (*b)->cols()) + { + my_error(ER_OPERAND_COLUMNS, MYF(0), n); + comparators= 0; + return true; + } + if (!(comparators= new Arg_comparator[n])) + return true; + for (uint i=0; i < n; i++) + { + if ((*a)->element_index(i)->cols() != (*b)->element_index(i)->cols()) + { + my_error(ER_OPERAND_COLUMNS, MYF(0), (*a)->element_index(i)->cols()); + return true; + } + if (comparators[i].set_cmp_func(owner, (*a)->addr(i), + (*b)->addr(i), set_null)) + return true; + } + return false; +} + + +bool Arg_comparator::set_cmp_func_row() +{ + func= is_owner_equal_func() ? &Arg_comparator::compare_e_row : + &Arg_comparator::compare_row; + return set_cmp_func_for_row_arguments(); +} + + +bool Arg_comparator::set_cmp_func_string() +{ + func= is_owner_equal_func() ? &Arg_comparator::compare_e_string : + &Arg_comparator::compare_string; + if (compare_type() == STRING_RESULT && (*a)->result_type() == STRING_RESULT && (*b)->result_type() == STRING_RESULT) { @@ -626,37 +596,87 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg, generated item, like in natural join */ if (owner->agg_arg_charsets_for_comparison(&m_compare_collation, a, b)) - return 1; + return true; } + a= cache_converted_constant(thd, a, &a_cache, compare_type()); + b= cache_converted_constant(thd, b, &b_cache, compare_type()); + return false; +} - if (m_compare_type == TIME_RESULT) + +bool Arg_comparator::set_cmp_func_temporal() +{ + enum_field_types f_type= a[0]->field_type_for_temporal_comparison(b[0]); + m_compare_collation= &my_charset_numeric; + if (f_type == MYSQL_TYPE_TIME) { - enum_field_types f_type= a[0]->field_type_for_temporal_comparison(b[0]); - if (f_type == MYSQL_TYPE_TIME) - { - func= is_owner_equal_func() ? &Arg_comparator::compare_e_time : - &Arg_comparator::compare_time; - } - else - { - func= is_owner_equal_func() ? &Arg_comparator::compare_e_datetime : - &Arg_comparator::compare_datetime; - } - return 0; + func= is_owner_equal_func() ? &Arg_comparator::compare_e_time : + &Arg_comparator::compare_time; } - - if (m_compare_type == INT_RESULT && - (*a)->field_type() == MYSQL_TYPE_YEAR && - (*b)->field_type() == MYSQL_TYPE_YEAR) + else { - m_compare_type= TIME_RESULT; func= is_owner_equal_func() ? &Arg_comparator::compare_e_datetime : &Arg_comparator::compare_datetime; } + return false; +} - a= cache_converted_constant(thd, a, &a_cache, m_compare_type); - b= cache_converted_constant(thd, b, &b_cache, m_compare_type); - return set_compare_func(owner_arg, m_compare_type); + +bool Arg_comparator::set_cmp_func_int() +{ + func= is_owner_equal_func() ? &Arg_comparator::compare_e_int : + &Arg_comparator::compare_int_signed; + if ((*a)->field_type() == MYSQL_TYPE_YEAR && + (*b)->field_type() == MYSQL_TYPE_YEAR) + { + func= is_owner_equal_func() ? &Arg_comparator::compare_e_datetime : + &Arg_comparator::compare_datetime; + } + else if (func == &Arg_comparator::compare_int_signed) + { + if ((*a)->unsigned_flag) + func= (((*b)->unsigned_flag)? + &Arg_comparator::compare_int_unsigned : + &Arg_comparator::compare_int_unsigned_signed); + else if ((*b)->unsigned_flag) + func= &Arg_comparator::compare_int_signed_unsigned; + } + else if (func== &Arg_comparator::compare_e_int) + { + if ((*a)->unsigned_flag ^ (*b)->unsigned_flag) + func= &Arg_comparator::compare_e_int_diff_signedness; + } + a= cache_converted_constant(thd, a, &a_cache, compare_type()); + b= cache_converted_constant(thd, b, &b_cache, compare_type()); + return false; +} + + +bool Arg_comparator::set_cmp_func_real() +{ + func= is_owner_equal_func() ? &Arg_comparator::compare_e_real : + &Arg_comparator::compare_real; + if ((*a)->decimals < NOT_FIXED_DEC && (*b)->decimals < NOT_FIXED_DEC) + { + precision= 5 / log_10[MY_MAX((*a)->decimals, (*b)->decimals) + 1]; + if (func == &Arg_comparator::compare_real) + func= &Arg_comparator::compare_real_fixed; + else if (func == &Arg_comparator::compare_e_real) + func= &Arg_comparator::compare_e_real_fixed; + } + a= cache_converted_constant(thd, a, &a_cache, compare_type()); + b= cache_converted_constant(thd, b, &b_cache, compare_type()); + return false; +} + + +bool Arg_comparator::set_cmp_func_decimal() +{ + func= is_owner_equal_func() ? &Arg_comparator::compare_e_decimal : + &Arg_comparator::compare_decimal; + a= cache_converted_constant(thd, a, &a_cache, compare_type()); + b= cache_converted_constant(thd, b, &b_cache, compare_type()); + return false; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 69b95c669a3..49d26ce6f0a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -47,7 +47,7 @@ typedef int (*Item_field_cmpfunc)(Item *f1, Item *f2, void *arg); class Arg_comparator: public Sql_alloc { Item **a, **b; - Item_result m_compare_type; + const Type_handler *m_compare_handler; CHARSET_INFO *m_compare_collation; arg_cmp_func func; Item_func_or_sum *owner; @@ -58,7 +58,7 @@ class Arg_comparator: public Sql_alloc THD *thd; Item *a_cache, *b_cache; // Cached values of a and b items // when one of arguments is NULL. - int set_compare_func(Item_func_or_sum *owner, Item_result type); + int set_cmp_func(Item_func_or_sum *owner_arg, Item **a1, Item **a2); int compare_temporal(enum_field_types type); @@ -68,17 +68,26 @@ public: /* Allow owner function to use string buffers. */ String value1, value2; - Arg_comparator(): m_compare_type(STRING_RESULT), + Arg_comparator(): + m_compare_handler(&type_handler_null), m_compare_collation(&my_charset_bin), set_null(TRUE), comparators(0), thd(0), a_cache(0), b_cache(0) {}; Arg_comparator(Item **a1, Item **a2): a(a1), b(a2), - m_compare_type(STRING_RESULT), + m_compare_handler(&type_handler_null), m_compare_collation(&my_charset_bin), set_null(TRUE), comparators(0), thd(0), a_cache(0), b_cache(0) {}; public: + bool set_cmp_func_for_row_arguments(); + bool set_cmp_func_row(); + bool set_cmp_func_string(); + bool set_cmp_func_temporal(); + bool set_cmp_func_int(); + bool set_cmp_func_real(); + bool set_cmp_func_decimal(); + inline int set_cmp_func(Item_func_or_sum *owner_arg, Item **a1, Item **a2, bool set_null_arg) { @@ -110,13 +119,13 @@ public: Item** cache_converted_constant(THD *thd, Item **value, Item **cache, Item_result type); - static arg_cmp_func comparator_matrix [6][2]; inline bool is_owner_equal_func() { return (owner->type() == Item::FUNC_ITEM && ((Item_func*)owner)->functype() == Item_func::EQUAL_FUNC); } - Item_result compare_type() const { return m_compare_type; } + const Type_handler *compare_type_handler() const { return m_compare_handler; } + Item_result compare_type() const { return m_compare_handler->cmp_type(); } CHARSET_INFO *compare_collation() const { return m_compare_collation; } Arg_comparator *subcomparators() const { return comparators; } void cleanup() diff --git a/sql/item_row.h b/sql/item_row.h index bbfebb56010..f8858738b78 100644 --- a/sql/item_row.h +++ b/sql/item_row.h @@ -56,6 +56,7 @@ public: {} enum Type type() const { return ROW_ITEM; }; + const Type_handler *type_handler() const { return &type_handler_row; } void illegal_method_call(const char *); bool is_null() { return null_value; } void make_field(THD *thd, Send_field *) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e7fb7b7e0c9..845d2b6d1ad 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -309,14 +309,6 @@ static my_bool opt_autocommit; ///< for --autocommit command-line option */ static my_bool opt_verbose= 0; -arg_cmp_func Arg_comparator::comparator_matrix[6][2] = -{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string}, - {&Arg_comparator::compare_real, &Arg_comparator::compare_e_real}, - {&Arg_comparator::compare_int_signed, &Arg_comparator::compare_e_int}, - {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}, - {&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}, - {&Arg_comparator::compare_datetime, &Arg_comparator::compare_e_datetime}}; - /* Timer info to be used by the SQL layer */ MY_TIMER_INFO sys_timer_info; diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 42aa37a19a7..e78a3a60f51 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -39,7 +39,6 @@ static Type_handler_timestamp type_handler_timestamp; static Type_handler_timestamp2 type_handler_timestamp2; static Type_handler_olddecimal type_handler_olddecimal; static Type_handler_newdecimal type_handler_newdecimal; -static Type_handler_null type_handler_null; static Type_handler_string type_handler_string; static Type_handler_varchar type_handler_varchar; static Type_handler_tiny_blob type_handler_tiny_blob; @@ -53,6 +52,10 @@ static Type_handler_enum type_handler_enum; static Type_handler_set type_handler_set; +Type_handler_null type_handler_null; +Type_handler_row type_handler_row; + + /** This method is used by: - Item_user_var_as_out_param::field_type() @@ -99,18 +102,17 @@ Type_handler_string_result::type_handler_adjusted_to_max_octet_length( const Type_handler * -Type_handler_hybrid_field_type::get_handler_by_result_type(Item_result type) - const +Type_handler::get_handler_by_cmp_type(Item_result type) { switch (type) { case REAL_RESULT: return &type_handler_double; case INT_RESULT: return &type_handler_longlong; case DECIMAL_RESULT: return &type_handler_newdecimal; case STRING_RESULT: return &type_handler_long_blob; - case TIME_RESULT: - case ROW_RESULT: - DBUG_ASSERT(0); + case TIME_RESULT: return &type_handler_datetime; + case ROW_RESULT: return &type_handler_row; } + DBUG_ASSERT(0); return &type_handler_string; } @@ -684,3 +686,39 @@ int Type_handler_int_result::Item_save_in_field(Item *item, Field *field, { return item->save_int_in_field(field, no_conversions); } + + +/***********************************************************************/ + +bool Type_handler_row::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_row(); +} + +bool Type_handler_int_result::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_int(); +} + +bool Type_handler_real_result::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_real(); +} + +bool Type_handler_decimal_result::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_decimal(); +} + +bool Type_handler_string_result::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_string(); +} + +bool Type_handler_temporal_result::set_comparator_func(Arg_comparator *cmp) const +{ + return cmp->set_cmp_func_temporal(); +} + + +/*************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index 0147ee5639b..f34be07bde0 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -27,6 +27,7 @@ class Field; class Item; class Type_std_attributes; class Sort_param; +class Arg_comparator; struct TABLE; struct SORT_FIELD_ATTR; @@ -221,6 +222,16 @@ public: static const Type_handler *string_type_handler(uint max_octet_length); static const Type_handler *get_handler_by_field_type(enum_field_types type); static const Type_handler *get_handler_by_real_type(enum_field_types type); + static const Type_handler *get_handler_by_cmp_type(Item_result type); + static const Type_handler *get_handler_by_result_type(Item_result type) + { + /* + As result_type() returns STRING_RESULT for temporal Items, + type should never be equal to TIME_RESULT here. + */ + DBUG_ASSERT(type != TIME_RESULT); + return get_handler_by_cmp_type(type); + } virtual enum_field_types field_type() const= 0; virtual enum_field_types real_field_type() const { return field_type(); } virtual Item_result result_type() const= 0; @@ -275,6 +286,59 @@ public: virtual int Item_save_in_field(Item *item, Field *field, bool no_conversions) const= 0; + virtual bool set_comparator_func(Arg_comparator *cmp) const= 0; +}; + + +/* + Special handler for ROW +*/ +class Type_handler_row: public Type_handler +{ +public: + virtual ~Type_handler_row() {} + enum_field_types field_type() const + { + DBUG_ASSERT(0); + return MYSQL_TYPE_NULL; + }; + Item_result result_type() const + { + return ROW_RESULT; + } + Item_result cmp_type() const + { + return ROW_RESULT; + } + Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const + { + DBUG_ASSERT(0); + return NULL; + } + Field *make_conversion_table_field(TABLE *TABLE, + uint metadata, + const Field *target) const + { + DBUG_ASSERT(0); + return NULL; + } + void make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const + { + DBUG_ASSERT(0); + } + void sortlength(THD *thd, const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const + { + DBUG_ASSERT(0); + } + int Item_save_in_field(Item *item, Field *field, bool no_conversions) const + { + DBUG_ASSERT(0); + return 1; + } + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -292,6 +356,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -308,6 +373,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -324,6 +390,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -338,6 +405,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -356,6 +424,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -704,7 +773,6 @@ public: class Type_handler_hybrid_field_type { const Type_handler *m_type_handler; - const Type_handler *get_handler_by_result_type(Item_result type) const; public: Type_handler_hybrid_field_type(); Type_handler_hybrid_field_type(const Type_handler *handler) @@ -730,13 +798,13 @@ public: } const Type_handler *set_handler_by_result_type(Item_result type) { - return (m_type_handler= get_handler_by_result_type(type)); + return (m_type_handler= Type_handler::get_handler_by_result_type(type)); } const Type_handler *set_handler_by_result_type(Item_result type, uint max_octet_length, CHARSET_INFO *cs) { - m_type_handler= get_handler_by_result_type(type); + m_type_handler= Type_handler::get_handler_by_result_type(type); return m_type_handler= m_type_handler->type_handler_adjusted_to_max_octet_length(max_octet_length, cs); @@ -766,4 +834,7 @@ public: }; +extern Type_handler_row type_handler_row; +extern Type_handler_null type_handler_null; + #endif /* SQL_TYPE_H_INCLUDED */ From 352ff9cc966b790f02128cc918281514cc245c26 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 25 Nov 2016 22:37:58 +0400 Subject: [PATCH 126/135] MDEV-11347 Move add_create_index_prepare(), add_key_to_list(), set_trigger_new_row(), set_local_variable(), set_system_variable(), create_item_for_sp_var() as methods to LEX Moving another banch of functions implemented in sql_yacc.yy as methods to LEX, to be able to reuse them between sql_yacc.yy and sql_yacc_ora.yy easier. The list of functions: - add_create_index_prepare() - add_key_to_list() - set_trigger_new_row() - set_local_variable() - set_system_variable() - create_item_for_sp_var() --- sql/sql_lex.h | 27 +++++++++++ sql/sql_yacc.yy | 118 +++++++++++++++++++----------------------------- 2 files changed, 73 insertions(+), 72 deletions(-) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 6e248594d4b..5591b591deb 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -41,6 +41,7 @@ class sp_head; class sp_name; class sp_instr; class sp_pcontext; +class sp_variable; class st_alter_tablespace; class partition_info; class Event_parse_data; @@ -3015,6 +3016,13 @@ public: int case_stmt_action_then(); bool add_select_to_union_list(bool is_union_distinct, bool is_top_level); bool setup_select_in_parentheses(); + bool set_trigger_new_row(LEX_STRING *name, Item *val); + bool set_system_variable(struct sys_var_with_base *tmp, + enum enum_var_type var_type, Item *val); + bool set_local_variable(sp_variable *spv, Item *val); + Item_splocal *create_item_for_sp_var(LEX_STRING name, sp_variable *spvar, + const char *start_in_q, + const char *end_in_q); // Check if "KEY IF NOT EXISTS name" used outside of ALTER context bool check_add_key(DDL_options_st ddl) @@ -3046,6 +3054,25 @@ public: alter_info.key_list.push_back(last_key); return false; } + bool add_create_index_prepare(Table_ident *table) + { + sql_command= SQLCOM_CREATE_INDEX; + if (!current_select->add_table_to_list(thd, table, NULL, + TL_OPTION_UPDATING, + TL_READ_NO_INSERT, + MDL_SHARED_UPGRADABLE)) + return true; + alter_info.reset(); + alter_info.flags= Alter_info::ALTER_ADD_INDEX; + option_list= NULL; + return false; + } + /* + Add an UNIQUE or PRIMARY key which is a part of a column definition: + CREATE TABLE t1 (a INT PRIMARY KEY); + */ + void add_key_to_list(LEX_STRING *field_name, + enum Key::Keytype type, bool check_exists); // Add a constraint as a part of CREATE TABLE or ALTER TABLE bool add_constraint(LEX_STRING *name, Virtual_column_info *constr, bool if_not_exists) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3703a027186..f519d458fdd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -398,7 +398,6 @@ find_sys_var_null_base(THD *thd, struct sys_var_with_base *tmp) Helper action for a SET statement. Used to push a system variable into the assignment list. - @param thd the current thread @param tmp the system variable with base name @param var_type the scope of the variable @param val the value being assigned to the variable @@ -406,16 +405,15 @@ find_sys_var_null_base(THD *thd, struct sys_var_with_base *tmp) @return TRUE if error, FALSE otherwise. */ -static bool -set_system_variable(THD *thd, struct sys_var_with_base *tmp, - enum enum_var_type var_type, Item *val) +bool +LEX::set_system_variable(struct sys_var_with_base *tmp, + enum enum_var_type var_type, Item *val) { set_var *var; - LEX *lex= thd->lex; /* No AUTOCOMMIT from a stored function or trigger. */ - if (lex->spcont && tmp->var == Sys_autocommit_ptr) - lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; + if (spcont && tmp->var == Sys_autocommit_ptr) + sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; if (val && val->type() == Item::FIELD_ITEM && ((Item_field*)val)->table_name) @@ -428,7 +426,7 @@ set_system_variable(THD *thd, struct sys_var_with_base *tmp, set_var(thd, var_type, tmp->var, &tmp->base_name, val))) return TRUE; - return lex->var_list.push_back(var, thd->mem_root); + return var_list.push_back(var, thd->mem_root); } @@ -436,18 +434,16 @@ set_system_variable(THD *thd, struct sys_var_with_base *tmp, Helper action for a SET statement. Used to push a SP local variable into the assignment list. - @param thd the current thread @param var_type the SP local variable @param val the value being assigned to the variable @return TRUE if error, FALSE otherwise. */ -static bool -set_local_variable(THD *thd, sp_variable *spv, Item *val) +bool +LEX::set_local_variable(sp_variable *spv, Item *val) { Item *it; - LEX *lex= thd->lex; sp_instr_set *sp_set; if (val) @@ -462,11 +458,11 @@ set_local_variable(THD *thd, sp_variable *spv, Item *val) } sp_set= new (thd->mem_root) - sp_instr_set(lex->sphead->instructions(), lex->spcont, - spv->offset, it, spv->sql_type(), - lex, TRUE); + sp_instr_set(sphead->instructions(), spcont, + spv->offset, it, spv->sql_type(), + this, true); - return (sp_set == NULL || lex->sphead->add_instr(sp_set)); + return (sp_set == NULL || sphead->add_instr(sp_set)); } @@ -474,17 +470,14 @@ set_local_variable(THD *thd, sp_variable *spv, Item *val) Helper action for a SET statement. Used to SET a field of NEW row. - @param thd the current thread @param name the field name @param val the value being assigned to the row @return TRUE if error, FALSE otherwise. */ -static bool -set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) +bool LEX::set_trigger_new_row(LEX_STRING *name, Item *val) { - LEX *lex= thd->lex; Item_trigger_field *trg_fld; sp_instr_set_trigger_field *sp_fld; @@ -492,12 +485,12 @@ set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) if (! val) val= new (thd->mem_root) Item_null(thd); - DBUG_ASSERT(lex->trg_chistics.action_time == TRG_ACTION_BEFORE && - (lex->trg_chistics.event == TRG_EVENT_INSERT || - lex->trg_chistics.event == TRG_EVENT_UPDATE)); + DBUG_ASSERT(trg_chistics.action_time == TRG_ACTION_BEFORE && + (trg_chistics.event == TRG_EVENT_INSERT || + trg_chistics.event == TRG_EVENT_UPDATE)); trg_fld= new (thd->mem_root) - Item_trigger_field(thd, lex->current_context(), + Item_trigger_field(thd, current_context(), Item_trigger_field::NEW_ROW, name->str, UPDATE_ACL, FALSE); @@ -505,9 +498,8 @@ set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) return TRUE; sp_fld= new (thd->mem_root) - sp_instr_set_trigger_field(lex->sphead->instructions(), - lex->spcont, trg_fld, val, - lex); + sp_instr_set_trigger_field(sphead->instructions(), + spcont, trg_fld, val, this); if (sp_fld == NULL) return TRUE; @@ -516,16 +508,15 @@ set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) Let us add this item to list of all Item_trigger_field objects in trigger. */ - lex->trg_table_fields.link_in_list(trg_fld, &trg_fld->next_trg_field); + trg_table_fields.link_in_list(trg_fld, &trg_fld->next_trg_field); - return lex->sphead->add_instr(sp_fld); + return sphead->add_instr(sp_fld); } /** Create an object to represent a SP variable in the Item-hierarchy. - @param thd The current thread. @param name The SP variable name. @param spvar The SP variable (optional). @param start_in_q Start position of the SP variable name in the query. @@ -537,18 +528,16 @@ set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) @return An Item_splocal object representing the SP variable, or NULL on error. */ -static Item_splocal* -create_item_for_sp_var(THD *thd, LEX_STRING name, sp_variable *spvar, - const char *start_in_q, const char *end_in_q) +Item_splocal* +LEX::create_item_for_sp_var(LEX_STRING name, sp_variable *spvar, + const char *start_in_q, const char *end_in_q) { Item_splocal *item; - LEX *lex= thd->lex; uint pos_in_q, len_in_q; - sp_pcontext *spc = lex->spcont; /* If necessary, look for the variable. */ - if (spc && !spvar) - spvar= spc->find_variable(name, false); + if (spcont && !spvar) + spvar= spcont->find_variable(name, false); if (!spvar) { @@ -556,10 +545,10 @@ create_item_for_sp_var(THD *thd, LEX_STRING name, sp_variable *spvar, return NULL; } - DBUG_ASSERT(spc && spvar); + DBUG_ASSERT(spcont && spvar); /* Position and length of the SP variable name in the query. */ - pos_in_q= start_in_q - lex->sphead->m_tmp_query; + pos_in_q= start_in_q - sphead->m_tmp_query; len_in_q= end_in_q - start_in_q; item= new (thd->mem_root) @@ -568,7 +557,7 @@ create_item_for_sp_var(THD *thd, LEX_STRING name, sp_variable *spvar, #ifndef DBUG_OFF if (item) - item->m_sp= lex->sphead; + item->m_sp= sphead; #endif return item; @@ -708,20 +697,6 @@ bool LEX::add_select_to_union_list(bool is_union_distinct, } -static bool add_create_index_prepare(LEX *lex, Table_ident *table) -{ - lex->sql_command= SQLCOM_CREATE_INDEX; - if (!lex->current_select->add_table_to_list(lex->thd, table, NULL, - TL_OPTION_UPDATING, - TL_READ_NO_INSERT, - MDL_SHARED_UPGRADABLE)) - return TRUE; - lex->alter_info.reset(); - lex->alter_info.flags= Alter_info::ALTER_ADD_INDEX; - lex->option_list= NULL; - return FALSE; -} - /** Create a separate LEX for each assignment if in SP. @@ -832,12 +807,11 @@ static bool sp_create_assignment_instr(THD *thd, bool no_lookahead) return false; } - -static void add_key_to_list(LEX *lex, LEX_STRING *field_name, - enum Key::Keytype type, bool check_exists) +void LEX::add_key_to_list(LEX_STRING *field_name, + enum Key::Keytype type, bool check_exists) { Key *key; - MEM_ROOT *mem_root= lex->thd->mem_root; + MEM_ROOT *mem_root= thd->mem_root; key= new (mem_root) Key(type, null_lex_str, HA_KEY_ALG_UNDEF, false, DDL_options(check_exists ? @@ -845,7 +819,7 @@ static void add_key_to_list(LEX *lex, LEX_STRING *field_name, DDL_options::OPT_NONE)); key->columns.push_back(new (mem_root) Key_part_spec(*field_name, 0), mem_root); - lex->alter_info.key_list.push_back(key, mem_root); + alter_info.key_list.push_back(key, mem_root); } void LEX::init_last_field(Column_definition *field, const char *field_name, @@ -2564,7 +2538,7 @@ create: opt_key_algorithm_clause ON table_ident { - if (add_create_index_prepare(Lex, $8)) + if (Lex->add_create_index_prepare($8)) MYSQL_YYABORT; if (Lex->add_create_index($2, $5, $6, $1 | $4)) MYSQL_YYABORT; @@ -2574,7 +2548,7 @@ create: | create_or_replace fulltext INDEX_SYM opt_if_not_exists ident ON table_ident { - if (add_create_index_prepare(Lex, $7)) + if (Lex->add_create_index_prepare($7)) MYSQL_YYABORT; if (Lex->add_create_index($2, $5, HA_KEY_ALG_UNDEF, $1 | $4)) MYSQL_YYABORT; @@ -2584,7 +2558,7 @@ create: | create_or_replace spatial INDEX_SYM opt_if_not_exists ident ON table_ident { - if (add_create_index_prepare(Lex, $7)) + if (Lex->add_create_index_prepare($7)) MYSQL_YYABORT; if (Lex->add_create_index($2, $5, HA_KEY_ALG_UNDEF, $1 | $4)) MYSQL_YYABORT; @@ -3550,9 +3524,9 @@ simple_target_specification: ident { Lex_input_stream *lip= &thd->m_parser_state->m_lip; - $$= create_item_for_sp_var(thd, $1, NULL, - lip->get_tok_start(), lip->get_ptr()); - + $$= thd->lex->create_item_for_sp_var($1, NULL, + lip->get_tok_start(), + lip->get_ptr()); if ($$ == NULL) MYSQL_YYABORT; } @@ -6148,9 +6122,9 @@ field_spec: $$->create_if_not_exists= Lex->check_exists; if ($$->flags & PRI_KEY_FLAG) - add_key_to_list(lex, &$1, Key::PRIMARY, Lex->check_exists); + lex->add_key_to_list(&$1, Key::PRIMARY, lex->check_exists); else if ($$->flags & UNIQUE_KEY_FLAG) - add_key_to_list(lex, &$1, Key::UNIQUE, Lex->check_exists); + lex->add_key_to_list(&$1, Key::UNIQUE, lex->check_exists); } ; @@ -15053,7 +15027,7 @@ option_value_following_option_type: if ($1.var && $1.var != trg_new_row_fake_var) { /* It is a system variable. */ - if (set_system_variable(thd, &$1, lex->option_type, $3)) + if (lex->set_system_variable(&$1, lex->option_type, $3)) MYSQL_YYABORT; } else @@ -15077,13 +15051,13 @@ option_value_no_option_type: if ($1.var == trg_new_row_fake_var) { /* We are in trigger and assigning value to field of new row */ - if (set_trigger_new_row(thd, &$1.base_name, $3)) + if (lex->set_trigger_new_row(&$1.base_name, $3)) MYSQL_YYABORT; } else if ($1.var) { /* It is a system variable. */ - if (set_system_variable(thd, &$1, lex->option_type, $3)) + if (lex->set_system_variable(&$1, lex->option_type, $3)) MYSQL_YYABORT; } else @@ -15092,7 +15066,7 @@ option_value_no_option_type: sp_variable *spv= spc->find_variable($1.base_name, false); /* It is a local variable. */ - if (set_local_variable(thd, spv, $3)) + if (lex->set_local_variable(spv, $3)) MYSQL_YYABORT; } } @@ -15116,7 +15090,7 @@ option_value_no_option_type: if (find_sys_var_null_base(thd, &tmp)) MYSQL_YYABORT; } - if (set_system_variable(thd, &tmp, $3, $6)) + if (Lex->set_system_variable(&tmp, $3, $6)) MYSQL_YYABORT; } | charset old_or_new_charset_name_or_default From 749bbb3d7b213b5044d97006259f013d70007d60 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 26 Nov 2016 21:19:48 +0400 Subject: [PATCH 127/135] MDEV-11357 Split Item_cache::get_cache() into virtual methods in Type_handler This patch: - Adds a new virtual method Type_handler::Item_get_cache - Splits moves Item_cache::get_cache() into the new method, every "case XXX_RESULT" to the corresponding Type_handler_xxx::Item_get_cache. - Adds Item::get_cache as a convenience wrapper, to make the caller code shorter. - Changes the last argument of Arg_comparator::cache_converted_constant() from Item_result to "const Type_handler *". - Removes subselect_engine::cmp_type, subselect_engine::res_type, subselect_engine::res_field_type and derives subselect_engine from Type_handler_hybrid_field_type instead. - Makes Type_handler_varchar public, as it's now needed as the default data type handler for subselect_engine. --- sql/item.cc | 41 +++-------------------------------------- sql/item.h | 6 ++++-- sql/item_cmpfunc.cc | 36 ++++++++++++++++++++---------------- sql/item_cmpfunc.h | 2 +- sql/item_subselect.cc | 24 +++++++++++++----------- sql/item_subselect.h | 13 ++++--------- sql/item_sum.cc | 4 ++-- sql/item_windowfunc.cc | 2 +- sql/opt_subselect.cc | 2 +- sql/sp_rcontext.cc | 2 +- sql/sql_class.cc | 2 +- sql/sql_type.cc | 41 ++++++++++++++++++++++++++++++++++++++++- sql/sql_type.h | 9 +++++++++ 13 files changed, 100 insertions(+), 84 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 64d6cb703bd..c597eec3a45 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6936,7 +6936,7 @@ Item* Item::cache_const_expr_transformer(THD *thd, uchar *arg) if (*(bool*)arg) { *((bool*)arg)= FALSE; - Item_cache *cache= Item_cache::get_cache(thd, this); + Item_cache *cache= get_cache(thd); if (!cache) return NULL; cache->setup(thd, this); @@ -7976,7 +7976,7 @@ Item_cache_wrapper::Item_cache_wrapper(THD *thd, Item *item_arg): name_length= item_arg->name_length; with_subselect= orig_item->with_subselect; - if ((expr_value= Item_cache::get_cache(thd, orig_item))) + if ((expr_value= orig_item->get_cache(thd))) expr_value->setup(thd, orig_item); fixed= 1; @@ -9281,41 +9281,6 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) return 0; } -Item_cache* Item_cache::get_cache(THD *thd, const Item *item) -{ - return get_cache(thd, item, item->cmp_type()); -} - - -/** - Get a cache item of given type. - - @param item value to be cached - @param type required type of cache - - @return cache item -*/ - -Item_cache* Item_cache::get_cache(THD *thd, const Item *item, - const Item_result type) -{ - MEM_ROOT *mem_root= thd->mem_root; - switch (type) { - case INT_RESULT: - return new (mem_root) Item_cache_int(thd, item->field_type()); - case REAL_RESULT: - return new (mem_root) Item_cache_real(thd); - case DECIMAL_RESULT: - return new (mem_root) Item_cache_decimal(thd); - case STRING_RESULT: - return new (mem_root) Item_cache_str(thd, item); - case ROW_RESULT: - return new (mem_root) Item_cache_row(thd); - case TIME_RESULT: - return new (mem_root) Item_cache_temporal(thd, item->field_type()); - } - return 0; // Impossible -} void Item_cache::store(Item *item) { @@ -9829,7 +9794,7 @@ bool Item_cache_row::setup(THD *thd, Item *item) { Item *el= item->element_index(i); Item_cache *tmp; - if (!(tmp= values[i]= Item_cache::get_cache(thd, el))) + if (!(tmp= values[i]= el->get_cache(thd))) return 1; tmp->setup(thd, el); } diff --git a/sql/item.h b/sql/item.h index 1c910d16247..0b60e20e0a0 100644 --- a/sql/item.h +++ b/sql/item.h @@ -721,6 +721,10 @@ public: { return Type_handler::string_type_handler(max_length)->field_type(); } + Item_cache* get_cache(THD *thd) const + { + return type_handler()->Item_get_cache(thd, this); + } virtual enum Type type() const =0; /* real_type() is the type of base item. This is same as type() for @@ -5207,8 +5211,6 @@ public: enum Item_result cmp_type () const { return Type_handler_hybrid_field_type::cmp_type(); } - static Item_cache* get_cache(THD *thd, const Item *item); - static Item_cache* get_cache(THD *thd, const Item* item, const Item_result type); virtual void keep_array() {} virtual void print(String *str, enum_query_type query_type); bool eq_def(const Field *field) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 381db9e4975..57c8220381f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -598,8 +598,8 @@ bool Arg_comparator::set_cmp_func_string() if (owner->agg_arg_charsets_for_comparison(&m_compare_collation, a, b)) return true; } - a= cache_converted_constant(thd, a, &a_cache, compare_type()); - b= cache_converted_constant(thd, b, &b_cache, compare_type()); + a= cache_converted_constant(thd, a, &a_cache, compare_type_handler()); + b= cache_converted_constant(thd, b, &b_cache, compare_type_handler()); return false; } @@ -646,8 +646,8 @@ bool Arg_comparator::set_cmp_func_int() if ((*a)->unsigned_flag ^ (*b)->unsigned_flag) func= &Arg_comparator::compare_e_int_diff_signedness; } - a= cache_converted_constant(thd, a, &a_cache, compare_type()); - b= cache_converted_constant(thd, b, &b_cache, compare_type()); + a= cache_converted_constant(thd, a, &a_cache, compare_type_handler()); + b= cache_converted_constant(thd, b, &b_cache, compare_type_handler()); return false; } @@ -664,8 +664,8 @@ bool Arg_comparator::set_cmp_func_real() else if (func == &Arg_comparator::compare_e_real) func= &Arg_comparator::compare_e_real_fixed; } - a= cache_converted_constant(thd, a, &a_cache, compare_type()); - b= cache_converted_constant(thd, b, &b_cache, compare_type()); + a= cache_converted_constant(thd, a, &a_cache, compare_type_handler()); + b= cache_converted_constant(thd, b, &b_cache, compare_type_handler()); return false; } @@ -674,8 +674,8 @@ bool Arg_comparator::set_cmp_func_decimal() { func= is_owner_equal_func() ? &Arg_comparator::compare_e_decimal : &Arg_comparator::compare_decimal; - a= cache_converted_constant(thd, a, &a_cache, compare_type()); - b= cache_converted_constant(thd, b, &b_cache, compare_type()); + a= cache_converted_constant(thd, a, &a_cache, compare_type_handler()); + b= cache_converted_constant(thd, b, &b_cache, compare_type_handler()); return false; } @@ -699,18 +699,22 @@ bool Arg_comparator::set_cmp_func_decimal() Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value, Item **cache_item, - Item_result type) + const Type_handler *handler) { + /* + get_datetime_value creates Item_cache internally when comparing + values for the first row. + Arg_comparator::cache_converted_constant() is never called for TIME_RESULT. + */ + DBUG_ASSERT(handler->cmp_type() != TIME_RESULT); /* Don't need cache if doing context analysis only. - Also, get_datetime_value creates Item_cache internally. - Unless fixed, we should not do it here. */ if (!thd_arg->lex->is_ps_or_view_context_analysis() && - (*value)->const_item() && type != (*value)->result_type() && - type != TIME_RESULT) + (*value)->const_item() && + handler->cmp_type() != (*value)->cmp_type()) { - Item_cache *cache= Item_cache::get_cache(thd_arg, *value, type); + Item_cache *cache= handler->Item_get_cache(thd_arg, *value); cache->setup(thd_arg, *value); *cache_item= cache; return cache_item; @@ -1273,7 +1277,7 @@ bool Item_in_optimizer::fix_left(THD *thd) args[0]= ((Item_in_subselect *)args[1])->left_expr; } if ((!(*ref0)->fixed && (*ref0)->fix_fields(thd, ref0)) || - (!cache && !(cache= Item_cache::get_cache(thd, *ref0)))) + (!cache && !(cache= (*ref0)->get_cache(thd)))) DBUG_RETURN(1); /* During fix_field() expression could be substituted. @@ -2696,7 +2700,7 @@ Item_func_nullif::fix_length_and_dec() */ m_cache= args[0]->cmp_type() == STRING_RESULT ? new (thd->mem_root) Item_cache_str_for_nullif(thd, args[0]) : - Item_cache::get_cache(thd, args[0]); + args[0]->get_cache(thd); m_cache->setup(thd, args[0]); m_cache->store(args[0]); m_cache->set_used_tables(args[0]->used_tables()); diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 49d26ce6f0a..ae685459a7f 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -118,7 +118,7 @@ public: int compare_e_time() { return compare_e_temporal(MYSQL_TYPE_TIME); } Item** cache_converted_constant(THD *thd, Item **value, Item **cache, - Item_result type); + const Type_handler *type); inline bool is_owner_equal_func() { return (owner->type() == Item::FUNC_ITEM && diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f7105086e55..2fe325dbe85 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1057,7 +1057,7 @@ void Item_maxmin_subselect::no_rows_in_result() */ if (parsing_place != SELECT_LIST || const_item()) return; - value= Item_cache::get_cache(thd, new (thd->mem_root) Item_null(thd)); + value= (new (thd->mem_root) Item_null(thd))->get_cache(thd); null_value= 0; was_values= 0; make_const(); @@ -1075,7 +1075,7 @@ void Item_singlerow_subselect::no_rows_in_result() */ if (parsing_place != SELECT_LIST || const_item()) return; - value= Item_cache::get_cache(thd, new (thd->mem_root) Item_null(thd)); + value= (new (thd->mem_root) Item_null(thd))->get_cache(thd); reset(); make_const(); } @@ -1165,12 +1165,17 @@ void Item_singlerow_subselect::store(uint i, Item *item) enum Item_result Item_singlerow_subselect::result_type() const { - return engine->type(); + return engine->result_type(); } enum Item_result Item_singlerow_subselect::cmp_type() const { - return engine->cmptype(); + return engine->cmp_type(); +} + +const Type_handler *Item_singlerow_subselect::type_handler() const +{ + return engine->type_handler(); } /* @@ -3635,24 +3640,21 @@ void subselect_engine::set_row(List &item_list, Item_cache **row) { Item *sel_item; List_iterator_fast li(item_list); - cmp_type= res_type= STRING_RESULT; - res_field_type= MYSQL_TYPE_VAR_STRING; + set_handler(&type_handler_varchar); for (uint i= 0; (sel_item= li++); i++) { item->max_length= sel_item->max_length; - res_type= sel_item->result_type(); - cmp_type= sel_item->cmp_type(); - res_field_type= sel_item->field_type(); + set_handler(sel_item->type_handler()); item->decimals= sel_item->decimals; item->unsigned_flag= sel_item->unsigned_flag; maybe_null= sel_item->maybe_null; - if (!(row[i]= Item_cache::get_cache(thd, sel_item, sel_item->cmp_type()))) + if (!(row[i]= sel_item->get_cache(thd))) return; row[i]->setup(thd, sel_item); //psergey-backport-timours: row[i]->store(sel_item); } if (item_list.elements > 1) - cmp_type= res_type= ROW_RESULT; + set_handler(&type_handler_row); } void subselect_single_select_engine::fix_length_and_dec(Item_cache **row) diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 823dbc6c281..74c03575272 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -301,6 +301,7 @@ public: enum Item_result result_type() const; enum Item_result cmp_type() const; enum_field_types field_type() const; + const Type_handler *type_handler() const; void fix_length_and_dec(); uint cols(); @@ -747,15 +748,13 @@ public: }; -class subselect_engine: public Sql_alloc +class subselect_engine: public Sql_alloc, + public Type_handler_hybrid_field_type { protected: select_result_interceptor *result; /* results storage class */ THD *thd; /* pointer to current THD */ Item_subselect *item; /* item, that use this engine */ - enum Item_result res_type; /* type of results */ - enum Item_result cmp_type; /* how to compare the results */ - enum_field_types res_field_type; /* column type of the results */ bool maybe_null; /* may be null (first item in select) */ public: @@ -766,12 +765,11 @@ public: subselect_engine(Item_subselect *si, select_result_interceptor *res): + Type_handler_hybrid_field_type(&type_handler_varchar), thd(NULL) { result= res; item= si; - cmp_type= res_type= STRING_RESULT; - res_field_type= MYSQL_TYPE_VAR_STRING; maybe_null= 0; } virtual ~subselect_engine() {}; // to satisfy compiler @@ -808,9 +806,6 @@ public: virtual int exec()= 0; virtual uint cols()= 0; /* return number of columns in select */ virtual uint8 uncacheable()= 0; /* query is uncacheable */ - enum Item_result type() { return res_type; } - enum Item_result cmptype() { return cmp_type; } - enum_field_types field_type() { return res_field_type; } virtual void exclude()= 0; virtual bool may_be_null() { return maybe_null; }; virtual table_map upper_select_const_tables()= 0; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3754bc1a954..9ffb056b2a2 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1185,14 +1185,14 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg) { - if (!(value= Item_cache::get_cache(thd, item, item->cmp_type()))) + if (!(value= item->get_cache(thd))) return; value->setup(thd, item); value->store(value_arg); /* Don't cache value, as it will change */ if (!item->const_item()) value->set_used_tables(RAND_TABLE_BIT); - if (!(arg_cache= Item_cache::get_cache(thd, item, item->cmp_type()))) + if (!(arg_cache= item->get_cache(thd))) return; arg_cache->setup(thd, item); /* Don't cache value, as it will change */ diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc index a13967eaaad..27eeeff6482 100644 --- a/sql/item_windowfunc.cc +++ b/sql/item_windowfunc.cc @@ -301,7 +301,7 @@ bool Item_sum_hybrid_simple::add() void Item_sum_hybrid_simple::setup_hybrid(THD *thd, Item *item) { - if (!(value= Item_cache::get_cache(thd, item, item->cmp_type()))) + if (!(value= item->get_cache(thd))) return; value->setup(thd, item); value->store(item); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index a9222cbca42..461a2107437 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5228,7 +5228,7 @@ int select_value_catcher::setup(List *items) List_iterator li(*items); for (uint i= 0; (sel_item= li++); i++) { - if (!(row[i]= Item_cache::get_cache(thd, sel_item))) + if (!(row[i]= sel_item->get_cache(thd))) return TRUE; row[i]->setup(thd, sel_item); } diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 6e724468966..8873b87d989 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -387,7 +387,7 @@ Item_cache *sp_rcontext::create_case_expr_holder(THD *thd, thd->set_n_backup_active_arena(thd->spcont->callers_arena, ¤t_arena); - holder= Item_cache::get_cache(thd, item); + holder= item->get_cache(thd); thd->restore_active_arena(thd->spcont->callers_arena, ¤t_arena); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1b6692d9d2c..6dbb8acdc65 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3336,7 +3336,7 @@ int select_max_min_finder_subselect::send_data(List &items) { if (!cache) { - cache= Item_cache::get_cache(thd, val_item); + cache= val_item->get_cache(thd); switch (val_item->result_type()) { case REAL_RESULT: op= &select_max_min_finder_subselect::cmp_real; diff --git a/sql/sql_type.cc b/sql/sql_type.cc index e78a3a60f51..f94e18d065a 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -40,7 +40,6 @@ static Type_handler_timestamp2 type_handler_timestamp2; static Type_handler_olddecimal type_handler_olddecimal; static Type_handler_newdecimal type_handler_newdecimal; static Type_handler_string type_handler_string; -static Type_handler_varchar type_handler_varchar; static Type_handler_tiny_blob type_handler_tiny_blob; static Type_handler_medium_blob type_handler_medium_blob; static Type_handler_long_blob type_handler_long_blob; @@ -54,6 +53,7 @@ static Type_handler_set type_handler_set; Type_handler_null type_handler_null; Type_handler_row type_handler_row; +Type_handler_varchar type_handler_varchar; /** @@ -722,3 +722,42 @@ bool Type_handler_temporal_result::set_comparator_func(Arg_comparator *cmp) cons /*************************************************************************/ + +Item_cache * +Type_handler_row::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_row(thd); +} + +Item_cache * +Type_handler_int_result::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_int(thd, item->field_type()); +} + +Item_cache * +Type_handler_real_result::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_real(thd); +} + +Item_cache * +Type_handler_decimal_result::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_decimal(thd); +} + +Item_cache * +Type_handler_string_result::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_str(thd, item); +} + +Item_cache * +Type_handler_temporal_result::Item_get_cache(THD *thd, const Item *item) const +{ + return new (thd->mem_root) Item_cache_temporal(thd, item->field_type()); +} + +/*************************************************************************/ + diff --git a/sql/sql_type.h b/sql/sql_type.h index f34be07bde0..87cd5c4c101 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -25,6 +25,7 @@ class Field; class Item; +class Item_cache; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -286,6 +287,7 @@ public: virtual int Item_save_in_field(Item *item, Field *field, bool no_conversions) const= 0; + virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const= 0; virtual bool set_comparator_func(Arg_comparator *cmp) const= 0; }; @@ -338,6 +340,7 @@ public: DBUG_ASSERT(0); return 1; } + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -356,6 +359,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -373,6 +377,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -390,6 +395,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -405,6 +411,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -424,6 +431,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; }; @@ -836,5 +844,6 @@ public: extern Type_handler_row type_handler_row; extern Type_handler_null type_handler_null; +extern Type_handler_varchar type_handler_varchar; #endif /* SQL_TYPE_H_INCLUDED */ From 9185f8d4a72e7e2001c29bf1502ce7dd4e782e98 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 28 Nov 2016 10:21:01 +0400 Subject: [PATCH 128/135] MDEV-11365 Split the data type and attribute related code in Item_sum_hybrid::fix_fields into Type_handler::Item_sum_hybrid_fix_length_and_dec() This patch: - Implements the task according to the description - Adds a new class Type_handler_numeric as a common parent for Type_handler_real_result, Type_handler_int_result, Type_handler_decimal_result, to share the common code between numeric data type handlers. - Removes the dedundant call for collation.set(item->collation) in Item_sum_hybrid::setup_hybrid(), because setup_hybrid() is called either after fix_length_and_dec() or afte ther constructor Item_sum_hybrid(THD *thd, Item_sum_hybrid *item), so the collation is already properly set in all cases. --- sql/item_sum.cc | 38 +++++-------------- sql/item_sum.h | 1 + sql/sql_type.cc | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ sql/sql_type.h | 32 ++++++++++++++-- 4 files changed, 138 insertions(+), 31 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9ffb056b2a2..879115d9b3b 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1126,36 +1126,11 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) if ((!item->fixed && item->fix_fields(thd, args)) || (item= args[0])->check_cols(1)) return TRUE; - Type_std_attributes::set(args[0]); with_subselect= args[0]->with_subselect; - Item *item2= item->real_item(); - if (item2->type() == Item::FIELD_ITEM) - set_handler_by_field_type(((Item_field*) item2)->field->type()); - else if (item->cmp_type() == TIME_RESULT) - set_handler_by_field_type(item2->field_type()); - else - set_handler_by_result_type(item2->result_type(), - max_length, collation.collation); - - switch (Item_sum_hybrid::result_type()) { - case INT_RESULT: - case DECIMAL_RESULT: - case STRING_RESULT: - break; - case REAL_RESULT: - max_length= float_length(decimals); - break; - case ROW_RESULT: - case TIME_RESULT: - DBUG_ASSERT(0); - }; - setup_hybrid(thd, args[0], NULL); - /* MIN/MAX can return NULL for empty set indepedent of the used column */ - maybe_null= 1; - result_field=0; - null_value=1; fix_length_and_dec(); + setup_hybrid(thd, args[0], NULL); + result_field=0; if (check_sum_func(thd, ref)) return TRUE; @@ -1166,6 +1141,14 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) } +void Item_sum_hybrid::fix_length_and_dec() +{ + DBUG_ASSERT(args[0]->field_type() == args[0]->real_item()->field_type()); + DBUG_ASSERT(args[0]->result_type() == args[0]->real_item()->result_type()); + (void) args[0]->type_handler()->Item_sum_hybrid_fix_length_and_dec(this); +} + + /** MIN/MAX function setup. @@ -1201,7 +1184,6 @@ void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg) cmp= new Arg_comparator(); if (cmp) cmp->set_cmp_func(this, (Item**)&arg_cache, (Item**)&value, FALSE); - collation.set(item->collation); } diff --git a/sql/item_sum.h b/sql/item_sum.h index 76cc983ad9e..59d75871354 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1006,6 +1006,7 @@ protected: cmp_sign(item->cmp_sign), was_values(item->was_values) { } bool fix_fields(THD *, Item **); + void fix_length_and_dec(); void setup_hybrid(THD *thd, Item *item, Item *value_arg); void clear(); double val_real(); diff --git a/sql/sql_type.cc b/sql/sql_type.cc index f94e18d065a..12fd73d4336 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -761,3 +761,101 @@ Type_handler_temporal_result::Item_get_cache(THD *thd, const Item *item) const /*************************************************************************/ +/** + MAX/MIN for the traditional numeric types preserve the exact data type + from Fields, but do not preserve the exact type from Items: + MAX(float_field) -> FLOAT + MAX(smallint_field) -> LONGLONG + MAX(COALESCE(float_field)) -> DOUBLE + MAX(COALESCE(smallint_field)) -> LONGLONG + QQ: Items should probably be fixed to preserve the exact type. +*/ +bool Type_handler_numeric:: + Item_sum_hybrid_fix_length_and_dec_numeric(Item_sum_hybrid *func, + const Type_handler *handler) + const +{ + Item *item= func->arguments()[0]; + Item *item2= item->real_item(); + func->Type_std_attributes::set(item); + /* MIN/MAX can return NULL for empty set indepedent of the used column */ + func->maybe_null= func->null_value= true; + if (item2->type() == Item::FIELD_ITEM) + func->set_handler_by_field_type(item2->field_type()); + else + func->set_handler(handler); + return false; +} + + +bool Type_handler_int_result:: + Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const +{ + return Item_sum_hybrid_fix_length_and_dec_numeric(func, + &type_handler_longlong); +} + + +bool Type_handler_real_result:: + Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const +{ + (void) Item_sum_hybrid_fix_length_and_dec_numeric(func, + &type_handler_double); + func->max_length= func->float_length(func->decimals); + return false; +} + + +bool Type_handler_decimal_result:: + Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const +{ + return Item_sum_hybrid_fix_length_and_dec_numeric(func, + &type_handler_newdecimal); +} + + +/** + MAX(str_field) converts ENUM/SET to CHAR, and preserve all other types + for Fields. + QQ: This works differently from UNION, which preserve the exact data + type for ENUM/SET if the joined ENUM/SET fields are equally defined. + Perhaps should be fixed. + MAX(str_item) chooses the best suitable string type. +*/ +bool Type_handler_string_result:: + Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const +{ + Item *item= func->arguments()[0]; + Item *item2= item->real_item(); + func->Type_std_attributes::set(item); + func->maybe_null= func->null_value= true; + if (item2->type() == Item::FIELD_ITEM) + { + // Fields: convert ENUM/SET to CHAR, preserve the type otherwise. + func->set_handler_by_field_type(item->field_type()); + } + else + { + // Items: choose VARCHAR/BLOB/MEDIUMBLOB/LONGBLOB, depending on length. + func->set_handler(type_handler_varchar. + type_handler_adjusted_to_max_octet_length(func->max_length, + func->collation.collation)); + } + return false; +} + + +/** + Traditional temporal types always preserve the type of the argument. +*/ +bool Type_handler_temporal_result:: + Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const +{ + Item *item= func->arguments()[0]; + func->Type_std_attributes::set(item); + func->maybe_null= func->null_value= true; + func->set_handler(item->type_handler()); + return false; +} + +/*************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index 87cd5c4c101..ef85f3d8d75 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -26,6 +26,7 @@ class Field; class Item; class Item_cache; +class Item_sum_hybrid; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -289,6 +290,7 @@ public: bool no_conversions) const= 0; virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const= 0; virtual bool set_comparator_func(Arg_comparator *cmp) const= 0; + virtual bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const= 0; }; @@ -342,12 +344,31 @@ public: } Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const + { + DBUG_ASSERT(0); + return true; + } +}; + + +/* + A common parent class for numeric data type handlers +*/ +class Type_handler_numeric: public Type_handler +{ +protected: + bool Item_sum_hybrid_fix_length_and_dec_numeric(Item_sum_hybrid *func, + const Type_handler *handler) + const; +public: + virtual ~Type_handler_numeric() { } }; /*** Abstract classes for every XXX_RESULT */ -class Type_handler_real_result: public Type_handler +class Type_handler_real_result: public Type_handler_numeric { public: Item_result result_type() const { return REAL_RESULT; } @@ -361,10 +382,11 @@ public: int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; }; -class Type_handler_decimal_result: public Type_handler +class Type_handler_decimal_result: public Type_handler_numeric { public: Item_result result_type() const { return DECIMAL_RESULT; } @@ -379,10 +401,11 @@ public: int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; }; -class Type_handler_int_result: public Type_handler +class Type_handler_int_result: public Type_handler_numeric { public: Item_result result_type() const { return INT_RESULT; } @@ -397,6 +420,7 @@ public: int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; }; @@ -413,6 +437,7 @@ public: SORT_FIELD_ATTR *attr) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; }; @@ -433,6 +458,7 @@ public: int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; + bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; }; From 69f80e5ecf8b2685a598e60320d4f0f05f492c22 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 1 Dec 2016 11:57:01 +0400 Subject: [PATCH 129/135] MDEV-11298 Split Item_func_hex::val_str_ascii() into virtual methods in Type_handler --- sql/item_strfunc.cc | 74 +++++++++++++++++++-------------------------- sql/item_strfunc.h | 20 ++++++++++-- sql/sql_string.cc | 61 ++++++++++++++++++++++++++++++++++--- sql/sql_string.h | 4 +++ sql/sql_type.cc | 41 +++++++++++++++++++++++++ sql/sql_type.h | 13 ++++++++ 6 files changed, 164 insertions(+), 49 deletions(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index b7efa60c520..81557787c36 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3634,53 +3634,41 @@ void Item_func_weight_string::print(String *str, enum_query_type query_type) } -String *Item_func_hex::val_str_ascii(String *str) +String *Item_func_hex::val_str_ascii_from_val_real(String *str) { - String *res; - DBUG_ASSERT(fixed == 1); - if (args[0]->result_type() != STRING_RESULT) - { - ulonglong dec; - char ans[65],*ptr; - /* Return hex of unsigned longlong value */ - if (args[0]->result_type() == REAL_RESULT || - args[0]->result_type() == DECIMAL_RESULT) - { - double val= args[0]->val_real(); - if ((val <= (double) LONGLONG_MIN) || - (val >= (double) (ulonglong) ULONGLONG_MAX)) - dec= ~(longlong) 0; - else - dec= (ulonglong) (val + (val > 0 ? 0.5 : -0.5)); - } - else - dec= (ulonglong) args[0]->val_int(); - - if ((null_value= args[0]->null_value)) - return 0; - - if (!(ptr= longlong2str(dec, ans, 16)) || - str->copy(ans,(uint32) (ptr - ans), - &my_charset_numeric)) - return make_empty_result(); // End of memory - return str; - } - - /* Convert given string to a hex string, character by character */ - res= args[0]->val_str(str); - if (!res || tmp_value.alloc(res->length()*2+1)) - { - null_value=1; + ulonglong dec; + double val= args[0]->val_real(); + if ((null_value= args[0]->null_value)) return 0; - } - null_value=0; - tmp_value.length(res->length()*2); - tmp_value.set_charset(&my_charset_latin1); - - octet2hex((char*) tmp_value.ptr(), res->ptr(), res->length()); - return &tmp_value; + if ((val <= (double) LONGLONG_MIN) || + (val >= (double) (ulonglong) ULONGLONG_MAX)) + dec= ~(longlong) 0; + else + dec= (ulonglong) (val + (val > 0 ? 0.5 : -0.5)); + return str->set_hex(dec) ? make_empty_result() : str; } + +String *Item_func_hex::val_str_ascii_from_val_str(String *str) +{ + DBUG_ASSERT(&tmp_value != str); + String *res= args[0]->val_str(&tmp_value); + DBUG_ASSERT(res != str); + if ((null_value= (res == NULL))) + return NULL; + return str->set_hex(res->ptr(), res->length()) ? make_empty_result() : str; +} + + +String *Item_func_hex::val_str_ascii_from_val_int(String *str) +{ + ulonglong dec= (ulonglong) args[0]->val_int(); + if ((null_value= args[0]->null_value)) + return 0; + return str->set_hex(dec) ? make_empty_result() : str; +} + + /** Convert given hex string to a binary string. */ String *Item_func_unhex::val_str(String *str) diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index be23f45c286..50258c84daa 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -913,17 +913,33 @@ public: class Item_func_hex :public Item_str_ascii_func { +protected: String tmp_value; + /* + Calling arg[0]->type_handler() can be expensive on every row. + It's a virtual method, and in case if args[0] is a complex Item, + its type_handler() can call more virtual methods. + So let's cache it during fix_length_and_dec(). + */ + const Type_handler *m_arg0_type_handler; public: Item_func_hex(THD *thd, Item *a): - Item_str_ascii_func(thd, a) {} + Item_str_ascii_func(thd, a), m_arg0_type_handler(NULL) {} const char *func_name() const { return "hex"; } - String *val_str_ascii(String *); + String *val_str_ascii_from_val_int(String *str); + String *val_str_ascii_from_val_real(String *str); + String *val_str_ascii_from_val_str(String *str); + String *val_str_ascii(String *str) + { + DBUG_ASSERT(fixed); + return m_arg0_type_handler->Item_func_hex_val_str_ascii(this, str); + } void fix_length_and_dec() { collation.set(default_charset()); decimals=0; fix_char_length(args[0]->max_length * 2); + m_arg0_type_handler= args[0]->type_handler(); } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 62473e082c3..b12f0332035 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -130,6 +130,61 @@ bool String::set_int(longlong num, bool unsigned_flag, CHARSET_INFO *cs) return FALSE; } + +// Convert a number into its HEX representation +bool String::set_hex(ulonglong num) +{ + char *n_end; + if (alloc(65) || !(n_end= longlong2str(num, Ptr, 16))) + return true; + length((uint32) (n_end - Ptr)); + set_charset(&my_charset_latin1); + return false; +} + + +/** + Append a hex representation of the byte "value" into "to". + Note: + "to" is incremented for the caller by two bytes. It's passed by reference! + So it resembles a macros, hence capital letters in the name. +*/ +static inline void APPEND_HEX(char *&to, uchar value) +{ + *to++= _dig_vec_upper[((uchar) value) >> 4]; + *to++= _dig_vec_upper[((uchar) value) & 0x0F]; +} + + +void String::qs_append_hex(const char *str, uint32 len) +{ + const char *str_end= str + len; + for (char *to= Ptr + str_length ; str < str_end; str++) + APPEND_HEX(to, (uchar) *str); + str_length+= len * 2; +} + + +// Convert a string to its HEX representation +bool String::set_hex(const char *str, uint32 len) +{ + /* + Safety: cut the source string if "len" is too large. + Note, alloc() can allocate some more space than requested, due to: + - ALIGN_SIZE + - one extra byte for a null terminator + So cut the source string to 0x7FFFFFF0 rather than 0x7FFFFFFE. + */ + set_if_smaller(len, 0x7FFFFFF0); + if (alloc(len * 2)) + return true; + length(0); + qs_append_hex(str, len); + set_charset(&my_charset_latin1); + return false; +} + + bool String::set_real(double num,uint decimals, CHARSET_INFO *cs) { char buff[FLOATING_POINT_BUFFER]; @@ -960,8 +1015,7 @@ my_copy_with_hex_escaping(CHARSET_INFO *cs, break; /* purecov: inspected */ *dst++= '\\'; *dst++= 'x'; - *dst++= _dig_vec_upper[((unsigned char) *src) >> 4]; - *dst++= _dig_vec_upper[((unsigned char) *src) & 15]; + APPEND_HEX(dst, (uchar) *src); src++; dstlen-= 4; } @@ -1146,8 +1200,7 @@ uint convert_to_printable(char *to, size_t to_len, break; *t++= '\\'; *t++= 'x'; - *t++= _dig_vec_upper[((unsigned char) *f) >> 4]; - *t++= _dig_vec_upper[((unsigned char) *f) & 0x0F]; + APPEND_HEX(t, *f); } if (t_end - t >= 3) // '...' dots= t; diff --git a/sql/sql_string.h b/sql/sql_string.h index 4b70675dca4..8062e2d465d 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -293,6 +293,9 @@ public: bool set(ulonglong num, CHARSET_INFO *cs) { return set_int((longlong)num, true, cs); } bool set_real(double num,uint decimals, CHARSET_INFO *cs); + bool set_hex(ulonglong num); + bool set_hex(const char *str, uint32 len); + /* Take over handling of buffer from some other object */ void reset(char *ptr_arg, uint32 length_arg, uint32 alloced_length_arg, CHARSET_INFO *cs) @@ -567,6 +570,7 @@ public: qs_append(str, (uint32)strlen(str)); } void qs_append(const char *str, uint32 len); + void qs_append_hex(const char *str, uint32 len); void qs_append(double d); void qs_append(double *d); inline void qs_append(const char c) diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 12fd73d4336..87465952272 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -859,3 +859,44 @@ bool Type_handler_temporal_result:: } /*************************************************************************/ + +String * +Type_handler_real_result::Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const +{ + return item->val_str_ascii_from_val_real(str); +} + + +String * +Type_handler_decimal_result::Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const +{ + return item->val_str_ascii_from_val_real(str); +} + + +String * +Type_handler_int_result::Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const +{ + return item->val_str_ascii_from_val_int(str); +} + + +String * +Type_handler_temporal_result::Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const +{ + return item->val_str_ascii_from_val_str(str); +} + + +String * +Type_handler_string_result::Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const +{ + return item->val_str_ascii_from_val_str(str); +} + +/*************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index ef85f3d8d75..92dee611acb 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -27,6 +27,7 @@ class Field; class Item; class Item_cache; class Item_sum_hybrid; +class Item_func_hex; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -291,6 +292,8 @@ public: virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const= 0; virtual bool set_comparator_func(Arg_comparator *cmp) const= 0; virtual bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const= 0; + virtual String *Item_func_hex_val_str_ascii(Item_func_hex *item, + String *str) const= 0; }; @@ -349,6 +352,11 @@ public: DBUG_ASSERT(0); return true; } + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const + { + DBUG_ASSERT(0); + return NULL; + } }; @@ -383,6 +391,7 @@ public: Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; }; @@ -402,6 +411,7 @@ public: Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; }; @@ -421,6 +431,7 @@ public: Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; }; @@ -438,6 +449,7 @@ public: Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; }; @@ -459,6 +471,7 @@ public: Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; + String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; }; From 6be678608f5ec1dc4e265bd953ac6baa34685769 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 5 Dec 2016 16:23:18 +0400 Subject: [PATCH 130/135] MDEV-11330 Split Item_func_hybrid_field_type::val_xxx() into methods in Type_handler --- sql/item_func.cc | 395 +++++++++++++++++++++-------------------------- sql/item_func.h | 93 ++++++++++- sql/sql_type.cc | 243 ++++++++++++++++++++++++++++- sql/sql_type.h | 113 ++++++++++++++ 4 files changed, 620 insertions(+), 224 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 01d4e81f835..716c47eec8b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -828,237 +828,196 @@ void Item_func_num1::fix_length_and_dec() } -String *Item_func_hybrid_field_type::val_str(String *str) +String *Item_func_hybrid_field_type::val_str_from_decimal_op(String *str) { - DBUG_ASSERT(fixed == 1); - switch (Item_func_hybrid_field_type::cmp_type()) { - case DECIMAL_RESULT: - { - my_decimal decimal_value, *val; - if (!(val= decimal_op_with_null_check(&decimal_value))) - return 0; // null is set - my_decimal_round(E_DEC_FATAL_ERROR, val, decimals, FALSE, val); - str->set_charset(collation.collation); - my_decimal2string(E_DEC_FATAL_ERROR, val, 0, 0, 0, str); - break; - } - case INT_RESULT: - { - longlong nr= int_op(); - if (null_value) - return 0; /* purecov: inspected */ - str->set_int(nr, unsigned_flag, collation.collation); - break; - } - case REAL_RESULT: - { - double nr= real_op(); - if (null_value) - return 0; /* purecov: inspected */ - str->set_real(nr, decimals, collation.collation); - break; - } - case TIME_RESULT: - { - MYSQL_TIME ltime; - if (date_op_with_null_check(<ime) || - (null_value= str->alloc(MAX_DATE_STRING_REP_LENGTH))) - return (String *) 0; - ltime.time_type= mysql_type_to_time_type(field_type()); - str->length(my_TIME_to_str(<ime, const_cast(str->ptr()), decimals)); - str->set_charset(&my_charset_bin); - DBUG_ASSERT(!null_value); - return str; - } - case STRING_RESULT: - return str_op_with_null_check(&str_value); - case ROW_RESULT: - DBUG_ASSERT(0); - } - DBUG_ASSERT(!null_value || (str == NULL)); + my_decimal decimal_value, *val; + if (!(val= decimal_op_with_null_check(&decimal_value))) + return 0; // null is set + DBUG_ASSERT(!null_value); + my_decimal_round(E_DEC_FATAL_ERROR, val, decimals, FALSE, val); + str->set_charset(collation.collation); + my_decimal2string(E_DEC_FATAL_ERROR, val, 0, 0, 0, str); return str; } - -double Item_func_hybrid_field_type::val_real() +double Item_func_hybrid_field_type::val_real_from_decimal_op() { - DBUG_ASSERT(fixed == 1); - switch (Item_func_hybrid_field_type::cmp_type()) { - case DECIMAL_RESULT: - { - my_decimal decimal_value, *val; - double result; - if (!(val= decimal_op_with_null_check(&decimal_value))) - return 0.0; // null is set - my_decimal2double(E_DEC_FATAL_ERROR, val, &result); - return result; - } - case INT_RESULT: - { - longlong result= int_op(); - return unsigned_flag ? (double) ((ulonglong) result) : (double) result; - } - case REAL_RESULT: - return real_op(); - case TIME_RESULT: - { - MYSQL_TIME ltime; - if (date_op_with_null_check(<ime)) - return 0; - ltime.time_type= mysql_type_to_time_type(field_type()); - return TIME_to_double(<ime); - } - case STRING_RESULT: - { - String *res= str_op_with_null_check(&str_value); - return res ? double_from_string_with_check(res) : 0.0; - } - case ROW_RESULT: - DBUG_ASSERT(0); - } - return 0.0; + my_decimal decimal_value, *val; + if (!(val= decimal_op_with_null_check(&decimal_value))) + return 0.0; // null is set + double result; + my_decimal2double(E_DEC_FATAL_ERROR, val, &result); + return result; } - -longlong Item_func_hybrid_field_type::val_int() +longlong Item_func_hybrid_field_type::val_int_from_decimal_op() { - DBUG_ASSERT(fixed == 1); - switch (Item_func_hybrid_field_type::cmp_type()) { - case DECIMAL_RESULT: - { - my_decimal decimal_value, *val; - if (!(val= decimal_op_with_null_check(&decimal_value))) - return 0; // null is set - longlong result; - my_decimal2int(E_DEC_FATAL_ERROR, val, unsigned_flag, &result); - return result; - } - case INT_RESULT: - return int_op(); - case REAL_RESULT: - return (longlong) rint(real_op()); - case TIME_RESULT: - { - MYSQL_TIME ltime; - if (date_op_with_null_check(<ime)) - return 0; - ltime.time_type= mysql_type_to_time_type(field_type()); - return TIME_to_ulonglong(<ime); - } - case STRING_RESULT: - { - String *res= str_op_with_null_check(&str_value); - return res ? longlong_from_string_with_check(res) : 0; - } - case ROW_RESULT: - DBUG_ASSERT(0); - } - return 0; + my_decimal decimal_value, *val; + if (!(val= decimal_op_with_null_check(&decimal_value))) + return 0; // null is set + longlong result; + my_decimal2int(E_DEC_FATAL_ERROR, val, unsigned_flag, &result); + return result; } - -my_decimal *Item_func_hybrid_field_type::val_decimal(my_decimal *decimal_value) +bool Item_func_hybrid_field_type::get_date_from_decimal_op(MYSQL_TIME *ltime, + ulonglong fuzzydate) { - my_decimal *val= decimal_value; - DBUG_ASSERT(fixed == 1); - switch (Item_func_hybrid_field_type::cmp_type()) { - case DECIMAL_RESULT: - val= decimal_op_with_null_check(decimal_value); - break; - case INT_RESULT: - { - longlong result= int_op(); - if (null_value) - return NULL; - int2my_decimal(E_DEC_FATAL_ERROR, result, unsigned_flag, decimal_value); - break; - } - case REAL_RESULT: - { - double result= (double)real_op(); - if (null_value) - return NULL; - double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value); - break; - } - case TIME_RESULT: - { - MYSQL_TIME ltime; - if (date_op_with_null_check(<ime)) - { - my_decimal_set_zero(decimal_value); - return 0; - } - ltime.time_type= mysql_type_to_time_type(field_type()); - return date2my_decimal(<ime, decimal_value); - } - case STRING_RESULT: - { - String *res= str_op_with_null_check(&str_value); - return res ? decimal_from_string_with_check(decimal_value, res) : 0; - } - case ROW_RESULT: - DBUG_ASSERT(0); - } - return val; -} - - -bool Item_func_hybrid_field_type::get_date(MYSQL_TIME *ltime, - ulonglong fuzzydate) -{ - DBUG_ASSERT(fixed == 1); - switch (Item_func_hybrid_field_type::cmp_type()) { - case DECIMAL_RESULT: - { - my_decimal value, *res; - if (!(res= decimal_op_with_null_check(&value)) || - decimal_to_datetime_with_warn(res, ltime, fuzzydate, - field_name_or_null())) - goto err; - break; - } - case INT_RESULT: - { - longlong value= int_op(); - bool neg= !unsigned_flag && value < 0; - if (null_value || int_to_datetime_with_warn(neg, neg ? -value : value, - ltime, fuzzydate, - field_name_or_null())) - goto err; - break; - } - case REAL_RESULT: - { - double value= real_op(); - if (null_value || double_to_datetime_with_warn(value, ltime, fuzzydate, - field_name_or_null())) - goto err; - break; - } - case TIME_RESULT: - return date_op(ltime, - fuzzydate | - (field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)); - case STRING_RESULT: - { - char buff[40]; - String tmp(buff,sizeof(buff), &my_charset_bin),*res; - if (!(res= str_op_with_null_check(&tmp)) || - str_to_datetime_with_warn(res->charset(), res->ptr(), res->length(), - ltime, fuzzydate)) - goto err; - break; - } - case ROW_RESULT: - DBUG_ASSERT(0); - } - + my_decimal value, *res; + if (!(res= decimal_op_with_null_check(&value)) || + decimal_to_datetime_with_warn(res, ltime, fuzzydate, + field_name_or_null())) + return make_zero_mysql_time(ltime, fuzzydate); return (null_value= 0); +} -err: - bzero(ltime, sizeof(*ltime)); - return null_value|= !(fuzzydate & TIME_FUZZY_DATES); + +String *Item_func_hybrid_field_type::val_str_from_int_op(String *str) +{ + longlong nr= int_op(); + if (null_value) + return 0; /* purecov: inspected */ + str->set_int(nr, unsigned_flag, collation.collation); + return str; +} + +double Item_func_hybrid_field_type::val_real_from_int_op() +{ + longlong result= int_op(); + return unsigned_flag ? (double) ((ulonglong) result) : (double) result; +} + +my_decimal * +Item_func_hybrid_field_type::val_decimal_from_int_op(my_decimal *dec) +{ + longlong result= int_op(); + if (null_value) + return NULL; + int2my_decimal(E_DEC_FATAL_ERROR, result, unsigned_flag, dec); + return dec; +} + +bool Item_func_hybrid_field_type::get_date_from_int_op(MYSQL_TIME *ltime, + ulonglong fuzzydate) +{ + longlong value= int_op(); + bool neg= !unsigned_flag && value < 0; + if (null_value || int_to_datetime_with_warn(neg, neg ? -value : value, + ltime, fuzzydate, + field_name_or_null())) + return make_zero_mysql_time(ltime, fuzzydate); + return (null_value= 0); +} + + +String *Item_func_hybrid_field_type::val_str_from_real_op(String *str) +{ + double nr= real_op(); + if (null_value) + return 0; /* purecov: inspected */ + str->set_real(nr, decimals, collation.collation); + return str; +} + +longlong Item_func_hybrid_field_type::val_int_from_real_op() +{ + return (longlong) rint(real_op()); +} + +my_decimal * +Item_func_hybrid_field_type::val_decimal_from_real_op(my_decimal *dec) +{ + double result= (double) real_op(); + if (null_value) + return NULL; + double2my_decimal(E_DEC_FATAL_ERROR, result, dec); + return dec; +} + +bool Item_func_hybrid_field_type::get_date_from_real_op(MYSQL_TIME *ltime, + ulonglong fuzzydate) +{ + double value= real_op(); + if (null_value || double_to_datetime_with_warn(value, ltime, fuzzydate, + field_name_or_null())) + return make_zero_mysql_time(ltime, fuzzydate); + return (null_value= 0); +} + + +String *Item_func_hybrid_field_type::val_str_from_date_op(String *str) +{ + MYSQL_TIME ltime; + if (date_op_with_null_check(<ime) || + (null_value= str->alloc(MAX_DATE_STRING_REP_LENGTH))) + return (String *) 0; + ltime.time_type= mysql_type_to_time_type(field_type()); + str->length(my_TIME_to_str(<ime, const_cast(str->ptr()), decimals)); + str->set_charset(&my_charset_bin); + DBUG_ASSERT(!null_value); + return str; +} + +double Item_func_hybrid_field_type::val_real_from_date_op() +{ + MYSQL_TIME ltime; + if (date_op_with_null_check(<ime)) + return 0; + ltime.time_type= mysql_type_to_time_type(field_type()); + return TIME_to_double(<ime); +} +longlong Item_func_hybrid_field_type::val_int_from_date_op() +{ + MYSQL_TIME ltime; + if (date_op_with_null_check(<ime)) + return 0; + ltime.time_type= mysql_type_to_time_type(field_type()); + return TIME_to_ulonglong(<ime); +} + +my_decimal * +Item_func_hybrid_field_type::val_decimal_from_date_op(my_decimal *dec) +{ + MYSQL_TIME ltime; + if (date_op_with_null_check(<ime)) + { + my_decimal_set_zero(dec); + return 0; + } + ltime.time_type= mysql_type_to_time_type(field_type()); + return date2my_decimal(<ime, dec); +} + + +double Item_func_hybrid_field_type::val_real_from_str_op() +{ + String *res= str_op_with_null_check(&str_value); + return res ? double_from_string_with_check(res) : 0.0; +} + +longlong Item_func_hybrid_field_type::val_int_from_str_op() +{ + String *res= str_op_with_null_check(&str_value); + return res ? longlong_from_string_with_check(res) : 0; +} + +my_decimal * +Item_func_hybrid_field_type::val_decimal_from_str_op(my_decimal *decimal_value) +{ + String *res= str_op_with_null_check(&str_value); + return res ? decimal_from_string_with_check(decimal_value, res) : 0; +} + +bool Item_func_hybrid_field_type::get_date_from_str_op(MYSQL_TIME *ltime, + ulonglong fuzzydate) +{ + StringBuffer<40> tmp; + String *res; + if (!(res= str_op_with_null_check(&tmp)) || + str_to_datetime_with_warn(res->charset(), res->ptr(), res->length(), + ltime, fuzzydate)) + return make_zero_mysql_time(ltime, fuzzydate); + return (null_value= 0); } diff --git a/sql/item_func.h b/sql/item_func.h index d30ab750e33..dbe23e372e3 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -451,6 +451,62 @@ class Item_func_hybrid_field_type: public Item_hybrid_func DBUG_ASSERT((res != NULL) ^ null_value); return res; } + bool make_zero_mysql_time(MYSQL_TIME *ltime, ulonglong fuzzydate) + { + bzero(ltime, sizeof(*ltime)); + return null_value|= !(fuzzydate & TIME_FUZZY_DATES); + } + +public: + // Value methods that involve no conversion + String *val_str_from_str_op(String *str) + { + return str_op_with_null_check(&str_value); + } + my_decimal *val_decimal_from_decimal_op(my_decimal *dec) + { + return decimal_op_with_null_check(dec); + } + longlong val_int_from_int_op() + { + return int_op(); + } + double val_real_from_real_op() + { + return real_op(); + } + bool get_date_from_date_op(MYSQL_TIME *ltime, ulonglong fuzzydate) + { + return date_op(ltime, + fuzzydate | + (field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)); + } + + // Value methods that involve conversion + String *val_str_from_decimal_op(String *str); + String *val_str_from_real_op(String *str); + String *val_str_from_int_op(String *str); + String *val_str_from_date_op(String *str); + + my_decimal *val_decimal_from_str_op(my_decimal *dec); + my_decimal *val_decimal_from_real_op(my_decimal *dec); + my_decimal *val_decimal_from_int_op(my_decimal *dec); + my_decimal *val_decimal_from_date_op(my_decimal *dec); + + longlong val_int_from_str_op(); + longlong val_int_from_real_op(); + longlong val_int_from_decimal_op(); + longlong val_int_from_date_op(); + + double val_real_from_str_op(); + double val_real_from_decimal_op(); + double val_real_from_date_op(); + double val_real_from_int_op(); + + bool get_date_from_str_op(MYSQL_TIME *ltime, ulonglong fuzzydate); + bool get_date_from_real_op(MYSQL_TIME *ltime, ulonglong fuzzydate); + bool get_date_from_decimal_op(MYSQL_TIME *ltime, ulonglong fuzzydate); + bool get_date_from_int_op(MYSQL_TIME *ltime, ulonglong fuzzydate); public: Item_func_hybrid_field_type(THD *thd): @@ -469,11 +525,38 @@ public: Item_hybrid_func(thd, list) { collation.set_numeric(); } - double val_real(); - longlong val_int(); - my_decimal *val_decimal(my_decimal *); - String *val_str(String*str); - bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); + double val_real() + { + DBUG_ASSERT(fixed); + return Item_func_hybrid_field_type::type_handler()-> + Item_func_hybrid_field_type_val_real(this); + } + longlong val_int() + { + DBUG_ASSERT(fixed); + return Item_func_hybrid_field_type::type_handler()-> + Item_func_hybrid_field_type_val_int(this); + } + my_decimal *val_decimal(my_decimal *dec) + { + DBUG_ASSERT(fixed); + return Item_func_hybrid_field_type::type_handler()-> + Item_func_hybrid_field_type_val_decimal(this, dec); + } + String *val_str(String*str) + { + DBUG_ASSERT(fixed); + String *res= Item_func_hybrid_field_type::type_handler()-> + Item_func_hybrid_field_type_val_str(this, str); + DBUG_ASSERT(null_value == (res == NULL)); + return res; + } + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) + { + DBUG_ASSERT(fixed); + return Item_func_hybrid_field_type::type_handler()-> + Item_func_hybrid_field_type_get_date(this, res, fuzzy_date); + } /** @brief Performs the operation that this functions implements when the diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 87465952272..00d4da5b268 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -899,4 +899,245 @@ Type_handler_string_result::Item_func_hex_val_str_ascii(Item_func_hex *item, return item->val_str_ascii_from_val_str(str); } -/*************************************************************************/ +/***************************************************************************/ + +String * +Type_handler_decimal_result::Item_func_hybrid_field_type_val_str( + Item_func_hybrid_field_type *item, + String *str) const +{ + return item->val_str_from_decimal_op(str); +} + + +double +Type_handler_decimal_result::Item_func_hybrid_field_type_val_real( + Item_func_hybrid_field_type *item) + const +{ + return item->val_real_from_decimal_op(); +} + + +longlong +Type_handler_decimal_result::Item_func_hybrid_field_type_val_int( + Item_func_hybrid_field_type *item) + const +{ + return item->val_int_from_decimal_op(); +} + + +my_decimal * +Type_handler_decimal_result::Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *item, + my_decimal *dec) const +{ + return item->val_decimal_from_decimal_op(dec); +} + + +bool +Type_handler_decimal_result::Item_func_hybrid_field_type_get_date( + Item_func_hybrid_field_type *item, + MYSQL_TIME *ltime, + ulonglong fuzzydate) const +{ + return item->get_date_from_decimal_op(ltime, fuzzydate); +} + + +/***************************************************************************/ + + +String * +Type_handler_int_result::Item_func_hybrid_field_type_val_str( + Item_func_hybrid_field_type *item, + String *str) const +{ + return item->val_str_from_int_op(str); +} + + +double +Type_handler_int_result::Item_func_hybrid_field_type_val_real( + Item_func_hybrid_field_type *item) + const +{ + return item->val_real_from_int_op(); +} + + +longlong +Type_handler_int_result::Item_func_hybrid_field_type_val_int( + Item_func_hybrid_field_type *item) + const +{ + return item->val_int_from_int_op(); +} + + +my_decimal * +Type_handler_int_result::Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *item, + my_decimal *dec) const +{ + return item->val_decimal_from_int_op(dec); +} + + +bool +Type_handler_int_result::Item_func_hybrid_field_type_get_date( + Item_func_hybrid_field_type *item, + MYSQL_TIME *ltime, + ulonglong fuzzydate) const +{ + return item->get_date_from_int_op(ltime, fuzzydate); +} + + + +/***************************************************************************/ + +String * +Type_handler_real_result::Item_func_hybrid_field_type_val_str( + Item_func_hybrid_field_type *item, + String *str) const +{ + return item->val_str_from_real_op(str); +} + + +double +Type_handler_real_result::Item_func_hybrid_field_type_val_real( + Item_func_hybrid_field_type *item) + const +{ + return item->val_real_from_real_op(); +} + + +longlong +Type_handler_real_result::Item_func_hybrid_field_type_val_int( + Item_func_hybrid_field_type *item) + const +{ + return item->val_int_from_real_op(); +} + + +my_decimal * +Type_handler_real_result::Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *item, + my_decimal *dec) const +{ + return item->val_decimal_from_real_op(dec); +} + + +bool +Type_handler_real_result::Item_func_hybrid_field_type_get_date( + Item_func_hybrid_field_type *item, + MYSQL_TIME *ltime, + ulonglong fuzzydate) const +{ + return item->get_date_from_real_op(ltime, fuzzydate); +} + + +/***************************************************************************/ + +String * +Type_handler_temporal_result::Item_func_hybrid_field_type_val_str( + Item_func_hybrid_field_type *item, + String *str) const +{ + return item->val_str_from_date_op(str); +} + + +double +Type_handler_temporal_result::Item_func_hybrid_field_type_val_real( + Item_func_hybrid_field_type *item) + const +{ + return item->val_real_from_date_op(); +} + + +longlong +Type_handler_temporal_result::Item_func_hybrid_field_type_val_int( + Item_func_hybrid_field_type *item) + const +{ + return item->val_int_from_date_op(); +} + + +my_decimal * +Type_handler_temporal_result::Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *item, + my_decimal *dec) const +{ + return item->val_decimal_from_date_op(dec); +} + + +bool +Type_handler_temporal_result::Item_func_hybrid_field_type_get_date( + Item_func_hybrid_field_type *item, + MYSQL_TIME *ltime, + ulonglong fuzzydate) const +{ + return item->get_date_from_date_op(ltime, fuzzydate); +} + + +/***************************************************************************/ + +String * +Type_handler_string_result::Item_func_hybrid_field_type_val_str( + Item_func_hybrid_field_type *item, + String *str) const +{ + return item->val_str_from_str_op(str); +} + + +double +Type_handler_string_result::Item_func_hybrid_field_type_val_real( + Item_func_hybrid_field_type *item) + const +{ + return item->val_real_from_str_op(); +} + + +longlong +Type_handler_string_result::Item_func_hybrid_field_type_val_int( + Item_func_hybrid_field_type *item) + const +{ + return item->val_int_from_str_op(); +} + + +my_decimal * +Type_handler_string_result::Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *item, + my_decimal *dec) const +{ + return item->val_decimal_from_str_op(dec); +} + + +bool +Type_handler_string_result::Item_func_hybrid_field_type_get_date( + Item_func_hybrid_field_type *item, + MYSQL_TIME *ltime, + ulonglong fuzzydate) const +{ + return item->get_date_from_str_op(ltime, fuzzydate); +} + +/***************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index 92dee611acb..ab04a4dd211 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -28,6 +28,7 @@ class Item; class Item_cache; class Item_sum_hybrid; class Item_func_hex; +class Item_func_hybrid_field_type; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -294,6 +295,25 @@ public: virtual bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const= 0; virtual String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const= 0; + + virtual + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const= 0; + virtual + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const= 0; + virtual + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const= 0; + virtual + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const= 0; + virtual + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const= 0; + }; @@ -357,6 +377,39 @@ public: DBUG_ASSERT(0); return NULL; } + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const + { + DBUG_ASSERT(0); + return NULL; + } + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const + { + DBUG_ASSERT(0); + return 0.0; + } + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const + { + DBUG_ASSERT(0); + return 0; + } + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const + { + DBUG_ASSERT(0); + return NULL; + } + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const + { + DBUG_ASSERT(0); + return true; + } + }; @@ -392,6 +445,18 @@ public: bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const; + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const; + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const; + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const; + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const; }; @@ -412,6 +477,18 @@ public: bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const; + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const; + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const; + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const; + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const; }; @@ -432,6 +509,18 @@ public: bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const; + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const; + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const; + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const; + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const; }; @@ -450,6 +539,18 @@ public: bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const; + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const; + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const; + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const; + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const; }; @@ -472,6 +573,18 @@ public: bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) const; + String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, + String *) const; + double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) + const; + longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) + const; + my_decimal *Item_func_hybrid_field_type_val_decimal( + Item_func_hybrid_field_type *, + my_decimal *) const; + bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, + MYSQL_TIME *, + ulonglong fuzzydate) const; }; From 1c1d8fe9e455b4c1b69b13966b4d213538c6b7db Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 5 Dec 2016 18:40:04 +0400 Subject: [PATCH 131/135] Moving LEX::set_last_field_type() to Column_definition::set_attributes() This is an extraction from the patch for MDEV-10577, which is not directly related to %TYPE implementation. This patch does the following: - Moves LEX::set_last_field_type() to Column_definition::set_attributes() - Adds initialization of Column_definition members length, decimals, charset, on_update into the constructor. - Column_definition::set_attributes() now does not set length and decimal to 0 any more, as they are not initialized in the constructor. - Move Column_definition::prepare_interval_field() from field.h to field.cc, as it's too huge. --- sql/field.cc | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ sql/field.h | 43 +++++---------------------- sql/sql_lex.h | 1 - sql/sql_yacc.yy | 21 ++----------- 4 files changed, 89 insertions(+), 55 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 6fa6838e063..480fcfb9287 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -9801,6 +9801,84 @@ err: } +bool Column_definition::prepare_interval_field(MEM_ROOT *mem_root, + bool reuse_interval_list_values) +{ + DBUG_ENTER("Column_definition::prepare_interval_field"); + DBUG_ASSERT(sql_type == MYSQL_TYPE_ENUM || sql_type == MYSQL_TYPE_SET); + /* + Interval values are either in "interval" or in "interval_list", + but not in both at the same time, and are not empty at the same time. + - Values are in "interval_list" when we're coming from the parser + in CREATE TABLE or in CREATE {FUNCTION|PROCEDURE}. + - Values are in "interval" when we're in ALTER TABLE. + + In a corner case with an empty set like SET(''): + - after the parser we have interval_list.elements==1 + - in ALTER TABLE we have a non-NULL interval with interval->count==1, + with interval->type_names[0]=="" and interval->type_lengths[0]==0. + So the assert is still valid for this corner case. + + ENUM and SET with no values at all (e.g. ENUM(), SET()) are not possible, + as the parser requires at least one element, so for a ENUM or SET field it + should never happen that both internal_list.elements and interval are 0. + */ + DBUG_ASSERT((interval == NULL) == (interval_list.elements > 0)); + + /* + Create typelib from interval_list, and if necessary + convert strings from client character set to the + column character set. + */ + if (interval_list.elements && + create_interval_from_interval_list(mem_root, + reuse_interval_list_values)) + DBUG_RETURN(true); + + if (!reuse_interval_list_values) + { + /* + We're initializing from an existing table or view Field_enum + (e.g. for a %TYPE variable) rather than from the parser. + The constructor Column_definition(THD*,Field*,Field*) has already + copied the TYPELIB pointer from the original Field_enum. + Now we need to make a permanent copy of that TYPELIB, + as the original field can be freed before the end of the life + cycle of "this". + */ + DBUG_ASSERT(interval); + if (!(interval= copy_typelib(mem_root, interval))) + DBUG_RETURN(true); + } + prepare_interval_field_calc_length(); + DBUG_RETURN(false); +} + + +void Column_definition::set_attributes(const Lex_field_type_st &type, + CHARSET_INFO *cs) +{ + DBUG_ASSERT(sql_type == MYSQL_TYPE_NULL); + DBUG_ASSERT(charset == &my_charset_bin || charset == NULL); + DBUG_ASSERT(length == 0); + DBUG_ASSERT(decimals == 0); + + sql_type= type.field_type(); + charset= cs; + + if (type.length()) + { + int err; + length= my_strtoll10(type.length(), NULL, &err); + if (err) + length= ~0ULL; // safety + } + + if (type.dec()) + decimals= (uint) atoi(type.dec()); +} + + /** Convert create_field::length from number of characters to number of bytes. */ @@ -10540,6 +10618,7 @@ Field *make_field(TABLE_SHARE *share, Column_definition::Column_definition(THD *thd, Field *old_field, Field *orig_field) { + on_update= NULL; field_name= old_field->field_name; length= old_field->field_length; flags= old_field->flags; diff --git a/sql/field.h b/sql/field.h index 76cdfe63319..7410288fa48 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3800,9 +3800,10 @@ public: Column_definition(): comment(null_lex_str), - on_update(0), sql_type(MYSQL_TYPE_NULL), + on_update(NULL), sql_type(MYSQL_TYPE_NULL), length(0), decimals(0), flags(0), pack_length(0), key_length(0), unireg_check(Field::NONE), - interval(0), srid(0), geom_type(Field::GEOM_GEOMETRY), + interval(0), charset(&my_charset_bin), + srid(0), geom_type(Field::GEOM_GEOMETRY), option_list(NULL), vcol_info(0), default_value(0), check_constraint(0) { @@ -3810,7 +3811,9 @@ public: } Column_definition(THD *thd, Field *field, Field *orig_field); + void set_attributes(const Lex_field_type_st &type, CHARSET_INFO *cs); void create_length_to_internal_length(void); + /** Prepare a SET/ENUM field. Create "interval" from "interval_list" if needed, and adjust "length". @@ -3823,39 +3826,10 @@ public: is not needed */ bool prepare_interval_field(MEM_ROOT *mem_root, - bool reuse_interval_list_values) + bool reuse_interval_list_values); + + void prepare_interval_field_calc_length() { - DBUG_ENTER("Column_definition::prepare_interval_field"); - DBUG_ASSERT(sql_type == MYSQL_TYPE_ENUM || sql_type == MYSQL_TYPE_SET); - /* - Interval values are either in "interval" or in "interval_list", - but not in both at the same time, and are not empty at the same time. - - Values are in "interval_list" when we're coming from the parser - in CREATE TABLE or in CREATE {FUNCTION|PROCEDURE}. - - Values are in "interval" when we're in ALTER TABLE. - - In a corner case with an empty set like SET(''): - - after the parser we have interval_list.elements==1 - - in ALTER TABLE we have a non-NULL interval with interval->count==1, - with interval->type_names[0]=="" and interval->type_lengths[0]==0. - So the assert is still valid for this corner case. - - ENUM and SET with no values at all (e.g. ENUM(), SET()) are not possible, - as the parser requires at least one element, so for a ENUM or SET field it - should never happen that both internal_list.elements and interval are 0. - */ - DBUG_ASSERT((interval == NULL) == (interval_list.elements > 0)); - - /* - Create typelib from interval_list, and if necessary - convert strings from client character set to the - column character set. - */ - if (interval_list.elements && - create_interval_from_interval_list(mem_root, - reuse_interval_list_values)) - DBUG_RETURN(true); - uint32 field_length, dummy; if (sql_type == MYSQL_TYPE_SET) { @@ -3868,7 +3842,6 @@ public: length= field_length; } set_if_smaller(length, MAX_FIELD_WIDTH - 1); - DBUG_RETURN(false); } bool prepare_blob_field(THD *thd); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 5591b591deb..edcbf1cb51b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2995,7 +2995,6 @@ public: void restore_set_statement_var(); void init_last_field(Column_definition *field, const char *name, CHARSET_INFO *cs); - void set_last_field_type(const Lex_field_type_st &type); bool set_bincmp(CHARSET_INFO *cs, bool bin); bool get_dynamic_sql_string(LEX_CSTRING *dst, String *buffer); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f519d458fdd..f826dbb8dd5 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -833,23 +833,6 @@ void LEX::init_last_field(Column_definition *field, const char *field_name, charset= cs; } -void LEX::set_last_field_type(const Lex_field_type_st &type) -{ - last_field->sql_type= type.field_type(); - last_field->charset= charset; - - if (type.length()) - { - int err; - last_field->length= my_strtoll10(type.length(), NULL, &err); - if (err) - last_field->length= ~0ULL; // safety - } - else - last_field->length= 0; - - last_field->decimals= type.dec() ? (uint)atoi(type.dec()) : 0; -} bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) { @@ -6109,7 +6092,7 @@ field_spec: lex->init_last_field(f, $1.str, NULL); $$= f; } - field_type { Lex->set_last_field_type($3); } + field_type { Lex->last_field->set_attributes($3, Lex->charset); } field_def { LEX *lex=Lex; @@ -6615,7 +6598,7 @@ type_with_opt_collate: if (!(Lex->charset= merge_charset_and_collation(Lex->charset, $2))) MYSQL_YYABORT; } - Lex->set_last_field_type($1); + Lex->last_field->set_attributes($1, Lex->charset); } ; From cfda0a71a74ecffd87e3fe0847faa5ba975d8261 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 6 Dec 2016 23:20:39 +0400 Subject: [PATCH 132/135] MDEV-11485 Split Item_func_between::val_int() into virtual methods in Type_handler - Removes "Item_result Item_func_opt_neg::m_compare_type" and introduces "Type_handler_hybrid_field_type Item_func_opt_neg::m_comparator" instead. - Removes Item_func_between::compare_as_dates, because the new member m_comparator now contains the precise information about the data type that is used for comparison, which is important for TIME vs DATETIME. - Adds a new method: Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler*), as a better replacement for item_cmp_type(), which additionally can handle TIME vs DATE/DATETIME/TIMESTAMP correctly. Additionally, it correctly handles TIMESTAMP which fixes the problem reported in MDEV-11482. The old compare_as_dates/find_date_time_item() based code didn't handle comparison between TIME and TIMESTAMP correctly and erroneously used TIME comparison instead of DATETIME comparison. - Adds a new method: Type_handler_hybrid_field_type::aggregate_for_comparison(Item **, uint nitems), as a better replacement for agg_cmp_type(), which can handle TIME. - Splits Item_func_between::val_int() into pieces val_int_cmp_xxx(), one new method per XXX_RESULT. - Adds a new virtual method Type_handler::Item_func_between_val_int() whose implementations use Item_func_between::val_int_cmp_xxx(). - Makes type_handler_longlong and type_handler_newdecimal public, as they are now needed in item_cmpfunc.cc. Note: This patch does not change Item_func_in to use the new aggregation methods, so it still uses collect_cmp_type()/item_cmp_type() based aggregation. Item_func_in will be changed in a separate patch and item_cmp_type() will be removed. --- mysql-test/r/type_timestamp.result | 12 ++ mysql-test/t/type_timestamp.test | 11 ++ sql/item_cmpfunc.cc | 307 ++++++++++++++--------------- sql/item_cmpfunc.h | 26 ++- sql/sql_type.cc | 93 ++++++++- sql/sql_type.h | 17 ++ 6 files changed, 296 insertions(+), 170 deletions(-) diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index c5e41a237fc..881b57ac1d7 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -980,5 +980,17 @@ Warnings: Warning 1441 Datetime function: datetime field overflow DROP TABLE t1; # +# MDEV-11482 Incorrect result for (time_expr BETWEEN timestamp_exp1 AND timestamp_expr2) +# +SET @@sql_mode=DEFAULT; +SET @@timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30'); +CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP); +INSERT INTO t1 VALUES ('2001-01-01 00:00:00','2001-01-01 23:59:59'); +SELECT * FROM t1 WHERE TIME'10:20:30' BETWEEN a and b; +a b +2001-01-01 00:00:00 2001-01-01 23:59:59 +DROP TABLE t1; +SET @@timestamp=DEFAULT; +# # End of 10.3 tests # diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 2dad92b6b90..7f32f7a1d65 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -576,6 +576,17 @@ EXPLAIN SELECT * FROM t1 WHERE a >= DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTE EXPLAIN SELECT * FROM t1 WHERE a >= COALESCE(DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR)); DROP TABLE t1; +--echo # +--echo # MDEV-11482 Incorrect result for (time_expr BETWEEN timestamp_exp1 AND timestamp_expr2) +--echo # +SET @@sql_mode=DEFAULT; +SET @@timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30'); +CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP); +INSERT INTO t1 VALUES ('2001-01-01 00:00:00','2001-01-01 23:59:59'); +SELECT * FROM t1 WHERE TIME'10:20:30' BETWEEN a and b; +DROP TABLE t1; +SET @@timestamp=DEFAULT; + --echo # --echo # End of 10.3 tests --echo # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 57c8220381f..0b392213f3e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -118,14 +118,15 @@ static int cmp_row_type(Item* item1, Item* item2) 0 otherwise */ -static int agg_cmp_type(Item_result *type, Item **items, uint nitems) +bool Type_handler_hybrid_field_type::aggregate_for_comparison(Item **items, + uint nitems) { uint unsigned_count= items[0]->unsigned_flag; - type[0]= items[0]->cmp_type(); + set_handler(items[0]->type_handler()); for (uint i= 1 ; i < nitems ; i++) { unsigned_count+= items[i]->unsigned_flag; - type[0]= item_cmp_type(type[0], items[i]); + aggregate_for_comparison(items[i]->type_handler()); /* When aggregating types of two row expressions we have to check that they have the same cardinality and that each component @@ -133,15 +134,16 @@ static int agg_cmp_type(Item_result *type, Item **items, uint nitems) the signature of the corresponding component of the second row expression. */ - if (type[0] == ROW_RESULT && cmp_row_type(items[0], items[i])) - return 1; // error found: invalid usage of rows + if (cmp_type() == ROW_RESULT && cmp_row_type(items[0], items[i])) + return true; // error found: invalid usage of rows } /** If all arguments are of INT type but have different unsigned_flag values, switch to DECIMAL_RESULT. */ - if (type[0] == INT_RESULT && unsigned_count != nitems && unsigned_count != 0) - type[0]= DECIMAL_RESULT; + if (cmp_type() == INT_RESULT && + unsigned_count != nitems && unsigned_count != 0) + set_handler(&type_handler_newdecimal); return 0; } @@ -2069,7 +2071,6 @@ void Item_func_between::fix_length_and_dec() { THD *thd= current_thd; max_length= 1; - compare_as_dates= 0; /* As some compare functions are generated after sql_yacc, @@ -2077,24 +2078,13 @@ void Item_func_between::fix_length_and_dec() */ if (!args[0] || !args[1] || !args[2]) return; - if (agg_cmp_type(&m_compare_type, args, 3)) + if (m_comparator.aggregate_for_comparison(args, 3)) return; - if (m_compare_type == STRING_RESULT && + if (m_comparator.cmp_type() == STRING_RESULT && agg_arg_charsets_for_comparison(cmp_collation, args, 3)) return; - /* - When comparing as date/time, we need to convert non-temporal values - (e.g. strings) to MYSQL_TIME. get_datetime_value() does it - automatically when one of the operands is a date/time. But here we - may need to compare two strings as dates (str1 BETWEEN str2 AND date). - For this to work, we need to know what date/time type we compare - strings as. - */ - if (m_compare_type == TIME_RESULT) - compare_as_dates= find_date_time_item(args, 3, 0); - /* See the comment about the similar block in Item_bool_func2 */ if (args[0]->real_item()->type() == FIELD_ITEM && !thd->lex->is_ps_or_view_context_analysis()) @@ -2106,145 +2096,143 @@ void Item_func_between::fix_length_and_dec() const bool cvt_arg1= convert_const_to_int(thd, field_item, &args[1]); const bool cvt_arg2= convert_const_to_int(thd, field_item, &args[2]); if (cvt_arg1 && cvt_arg2) - m_compare_type= INT_RESULT; // Works for all types. + { + // Works for all types + m_comparator.set_handler(&type_handler_longlong); + } } } } -longlong Item_func_between::val_int() +longlong Item_func_between::val_int_cmp_temporal() { - DBUG_ASSERT(fixed == 1); + THD *thd= current_thd; + longlong value, a, b; + Item *cache, **ptr; + bool value_is_null, a_is_null, b_is_null; - switch (m_compare_type) { - case TIME_RESULT: - { - THD *thd= current_thd; - longlong value, a, b; - Item *cache, **ptr; - bool value_is_null, a_is_null, b_is_null; + ptr= &args[0]; + enum_field_types f_type= m_comparator.field_type(); + value= get_datetime_value(thd, &ptr, &cache, f_type, &value_is_null); + if (ptr != &args[0]) + thd->change_item_tree(&args[0], *ptr); - ptr= &args[0]; - enum_field_types f_type= field_type_for_temporal_comparison(compare_as_dates); - value= get_datetime_value(thd, &ptr, &cache, f_type, &value_is_null); - if (ptr != &args[0]) - thd->change_item_tree(&args[0], *ptr); - - if ((null_value= value_is_null)) - return 0; - - ptr= &args[1]; - a= get_datetime_value(thd, &ptr, &cache, f_type, &a_is_null); - if (ptr != &args[1]) - thd->change_item_tree(&args[1], *ptr); - - ptr= &args[2]; - b= get_datetime_value(thd, &ptr, &cache, f_type, &b_is_null); - if (ptr != &args[2]) - thd->change_item_tree(&args[2], *ptr); - - if (!a_is_null && !b_is_null) - return (longlong) ((value >= a && value <= b) != negated); - if (a_is_null && b_is_null) - null_value=1; - else if (a_is_null) - null_value= value <= b; // not null if false range. - else - null_value= value >= a; - break; - } - - case STRING_RESULT: - { - String *value,*a,*b; - value=args[0]->val_str(&value0); - if ((null_value=args[0]->null_value)) - return 0; - a=args[1]->val_str(&value1); - b=args[2]->val_str(&value2); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((sortcmp(value,a,cmp_collation.collation) >= 0 && - sortcmp(value,b,cmp_collation.collation) <= 0) != - negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - // Set to not null if false range. - null_value= sortcmp(value,b,cmp_collation.collation) <= 0; - } - else - { - // Set to not null if false range. - null_value= sortcmp(value,a,cmp_collation.collation) >= 0; - } - break; - } - case INT_RESULT: - { - longlong value=args[0]->val_int(), a, b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a=args[1]->val_int(); - b=args[2]->val_int(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } - case DECIMAL_RESULT: - { - my_decimal dec_buf, *dec= args[0]->val_decimal(&dec_buf), - a_buf, *a_dec, b_buf, *b_dec; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a_dec= args[1]->val_decimal(&a_buf); - b_dec= args[2]->val_decimal(&b_buf); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((my_decimal_cmp(dec, a_dec) >= 0 && - my_decimal_cmp(dec, b_dec) <= 0) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - null_value= (my_decimal_cmp(dec, b_dec) <= 0); - else - null_value= (my_decimal_cmp(dec, a_dec) >= 0); - break; - } - case REAL_RESULT: - { - double value= args[0]->val_real(),a,b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a= args[1]->val_real(); - b= args[2]->val_real(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } - case ROW_RESULT: - DBUG_ASSERT(0); - null_value= 1; + if ((null_value= value_is_null)) return 0; + + ptr= &args[1]; + a= get_datetime_value(thd, &ptr, &cache, f_type, &a_is_null); + if (ptr != &args[1]) + thd->change_item_tree(&args[1], *ptr); + + ptr= &args[2]; + b= get_datetime_value(thd, &ptr, &cache, f_type, &b_is_null); + if (ptr != &args[2]) + thd->change_item_tree(&args[2], *ptr); + + if (!a_is_null && !b_is_null) + return (longlong) ((value >= a && value <= b) != negated); + if (a_is_null && b_is_null) + null_value= true; + else if (a_is_null) + null_value= value <= b; // not null if false range. + else + null_value= value >= a; + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_string() +{ + String *value,*a,*b; + value=args[0]->val_str(&value0); + if ((null_value=args[0]->null_value)) + return 0; + a= args[1]->val_str(&value1); + b= args[2]->val_str(&value2); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((sortcmp(value,a,cmp_collation.collation) >= 0 && + sortcmp(value,b,cmp_collation.collation) <= 0) != + negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + { + // Set to not null if false range. + null_value= sortcmp(value,b,cmp_collation.collation) <= 0; + } + else + { + // Set to not null if false range. + null_value= sortcmp(value,a,cmp_collation.collation) >= 0; + } + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_int() +{ + longlong value= args[0]->val_int(), a, b; + if ((null_value= args[0]->null_value)) + return 0; /* purecov: inspected */ + a= args[1]->val_int(); + b= args[2]->val_int(); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((value >= a && value <= b) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + { + null_value= value <= b; // not null if false range. + } + else + { + null_value= value >= a; + } + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_decimal() +{ + my_decimal dec_buf, *dec= args[0]->val_decimal(&dec_buf), + a_buf, *a_dec, b_buf, *b_dec; + if ((null_value=args[0]->null_value)) + return 0; /* purecov: inspected */ + a_dec= args[1]->val_decimal(&a_buf); + b_dec= args[2]->val_decimal(&b_buf); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((my_decimal_cmp(dec, a_dec) >= 0 && + my_decimal_cmp(dec, b_dec) <= 0) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + null_value= (my_decimal_cmp(dec, b_dec) <= 0); + else + null_value= (my_decimal_cmp(dec, a_dec) >= 0); + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_real() +{ + double value= args[0]->val_real(),a,b; + if ((null_value=args[0]->null_value)) + return 0; /* purecov: inspected */ + a= args[1]->val_real(); + b= args[2]->val_real(); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((value >= a && value <= b) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + { + null_value= value <= b; // not null if false range. + } + else + { + null_value= value >= a; } return (longlong) (!null_value && negated); } @@ -4119,7 +4107,7 @@ void Item_func_in::fix_length_and_dec() Item *date_arg= 0; uint found_types= 0; uint type_cnt= 0, i; - m_compare_type= STRING_RESULT; + m_comparator.set_handler(&type_handler_varchar); left_cmp_type= args[0]->cmp_type(); if (!(found_types= collect_cmp_types(args, arg_count, true))) return; @@ -4137,7 +4125,7 @@ void Item_func_in::fix_length_and_dec() if (found_types & (1U << i)) { (type_cnt)++; - m_compare_type= (Item_result) i; + m_comparator.set_handler_by_cmp_type((Item_result) i); } } @@ -4161,7 +4149,7 @@ void Item_func_in::fix_length_and_dec() 4. Neither left expression nor contain any NULL value */ - if (m_compare_type == ROW_RESULT && + if (m_comparator.cmp_type() == ROW_RESULT && ((!is_top_level_item() || negated) && // 3 (list_contains_null() || args[0]->maybe_null))) // 4 bisection_possible= false; @@ -4169,12 +4157,12 @@ void Item_func_in::fix_length_and_dec() if (type_cnt == 1) { - if (m_compare_type == STRING_RESULT && + if (m_comparator.cmp_type() == STRING_RESULT && agg_arg_charsets_for_comparison(cmp_collation, args, arg_count)) return; arg_types_compatible= TRUE; - if (m_compare_type == ROW_RESULT) + if (m_comparator.cmp_type() == ROW_RESULT) { uint cols= args[0]->cols(); cmp_item_row *cmp= 0; @@ -4221,7 +4209,8 @@ void Item_func_in::fix_length_and_dec() See the comment about the similar block in Item_bool_func2 */ if (args[0]->real_item()->type() == FIELD_ITEM && - !thd->lex->is_view_context_analysis() && m_compare_type != INT_RESULT) + !thd->lex->is_view_context_analysis() && + m_comparator.cmp_type() != INT_RESULT) { Item_field *field_item= (Item_field*) (args[0]->real_item()); if (field_item->field_type() == MYSQL_TYPE_LONGLONG || @@ -4234,10 +4223,10 @@ void Item_func_in::fix_length_and_dec() all_converted= FALSE; } if (all_converted) - m_compare_type= INT_RESULT; + m_comparator.set_handler(&type_handler_longlong); } } - switch (m_compare_type) { + switch (m_comparator.cmp_type()) { case STRING_RESULT: array=new (thd->mem_root) in_string(thd, arg_count - 1, (qsort2_cmp) srtcmp_in, diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index ae685459a7f..316b9336ac6 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -834,10 +834,10 @@ class Item_func_opt_neg :public Item_bool_func { protected: /* - The result type that will be used for comparison. - cmp_type() of all arguments are collected to here. + The data type handler that will be used for comparison. + Data type handlers of all arguments are mixed to here. */ - Item_result m_compare_type; + Type_handler_hybrid_field_type m_comparator; /* The collation that will be used for comparison in case when m_compare_type is STRING_RESULT. @@ -872,11 +872,13 @@ protected: Field *field, Item *value); public: String value0,value1,value2; - /* TRUE <=> arguments will be compared as dates. */ - Item *compare_as_dates; Item_func_between(THD *thd, Item *a, Item *b, Item *c): - Item_func_opt_neg(thd, a, b, c), compare_as_dates(FALSE) { } - longlong val_int(); + Item_func_opt_neg(thd, a, b, c) { } + longlong val_int() + { + DBUG_ASSERT(fixed); + return m_comparator.type_handler()->Item_func_between_val_int(this); + } enum Functype functype() const { return BETWEEN; } const char *func_name() const { return "between"; } enum precedence precedence() const { return BETWEEN_PRECEDENCE; } @@ -893,13 +895,19 @@ public: { Item_args::propagate_equal_fields(thd, Context(ANY_SUBST, - m_compare_type, + m_comparator.cmp_type(), compare_collation()), cond); return this; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } + + longlong val_int_cmp_string(); + longlong val_int_cmp_temporal(); + longlong val_int_cmp_int(); + longlong val_int_cmp_real(); + longlong val_int_cmp_decimal(); }; @@ -1664,7 +1672,7 @@ public: will be replaced to a zero-filled Item_string. Such a change would require rebuilding of cmp_items. */ - Context cmpctx(ANY_SUBST, m_compare_type, + Context cmpctx(ANY_SUBST, m_comparator.cmp_type(), Item_func_in::compare_collation()); for (uint i= 0; i < arg_count; i++) { diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 00d4da5b268..9538f020a19 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -23,7 +23,6 @@ static Type_handler_tiny type_handler_tiny; static Type_handler_short type_handler_short; static Type_handler_long type_handler_long; -static Type_handler_longlong type_handler_longlong; static Type_handler_int24 type_handler_int24; static Type_handler_year type_handler_year; static Type_handler_bit type_handler_bit; @@ -38,7 +37,6 @@ static Type_handler_datetime2 type_handler_datetime2; static Type_handler_timestamp type_handler_timestamp; static Type_handler_timestamp2 type_handler_timestamp2; static Type_handler_olddecimal type_handler_olddecimal; -static Type_handler_newdecimal type_handler_newdecimal; static Type_handler_string type_handler_string; static Type_handler_tiny_blob type_handler_tiny_blob; static Type_handler_medium_blob type_handler_medium_blob; @@ -54,6 +52,8 @@ static Type_handler_set type_handler_set; Type_handler_null type_handler_null; Type_handler_row type_handler_row; Type_handler_varchar type_handler_varchar; +Type_handler_longlong type_handler_longlong; +Type_handler_newdecimal type_handler_newdecimal; /** @@ -123,6 +123,55 @@ Type_handler_hybrid_field_type::Type_handler_hybrid_field_type() } +/* + Collect built-in data type handlers for comparison. + This method is very similar to item_cmp_type() defined in item.cc. + Now they coexist. Later item_cmp_type() will be removed. + In addition to item_cmp_type(), this method correctly aggregates + TIME with DATETIME/TIMESTAMP/DATE, so no additional find_date_time_item() + is needed after this call. +*/ +void +Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h) +{ + Item_result a= cmp_type(); + Item_result b= h->cmp_type(); + if (a == STRING_RESULT && b == STRING_RESULT) + m_type_handler= &type_handler_long_blob; + else if (a == INT_RESULT && b == INT_RESULT) + m_type_handler= &type_handler_longlong; + else if (a == ROW_RESULT || b == ROW_RESULT) + m_type_handler= &type_handler_row; + else if (a == TIME_RESULT || b == TIME_RESULT) + { + if ((a == TIME_RESULT) + (b == TIME_RESULT) == 1) + { + /* + We're here if there's only one temporal data type: + either m_type_handler or h. + */ + if (b == TIME_RESULT) + m_type_handler= h; // Temporal types bit non-temporal types + } + else + { + /* + We're here if both m_type_handler and h are temporal data types. + */ + if (field_type() != MYSQL_TYPE_TIME || h->field_type() != MYSQL_TYPE_TIME) + m_type_handler= &type_handler_datetime; // DATETIME bits TIME + } + } + else if ((a == INT_RESULT || a == DECIMAL_RESULT) && + (b == INT_RESULT || b == DECIMAL_RESULT)) + { + m_type_handler= &type_handler_newdecimal; + } + else + m_type_handler= &type_handler_double; +} + + const Type_handler * Type_handler::get_handler_by_field_type(enum_field_types type) { @@ -1141,3 +1190,43 @@ Type_handler_string_result::Item_func_hybrid_field_type_get_date( } /***************************************************************************/ + +longlong Type_handler_row:: + Item_func_between_val_int(Item_func_between *func) const +{ + DBUG_ASSERT(0); + func->null_value= true; + return 0; +} + +longlong Type_handler_string_result:: + Item_func_between_val_int(Item_func_between *func) const +{ + return func->val_int_cmp_string(); +} + +longlong Type_handler_temporal_result:: + Item_func_between_val_int(Item_func_between *func) const +{ + return func->val_int_cmp_temporal(); +} + +longlong Type_handler_int_result:: + Item_func_between_val_int(Item_func_between *func) const +{ + return func->val_int_cmp_int(); +} + +longlong Type_handler_real_result:: + Item_func_between_val_int(Item_func_between *func) const +{ + return func->val_int_cmp_real(); +} + +longlong Type_handler_decimal_result:: + Item_func_between_val_int(Item_func_between *func) const +{ + return func->val_int_cmp_decimal(); +} + +/***************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index ab04a4dd211..9086e60dc0f 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -29,6 +29,7 @@ class Item_cache; class Item_sum_hybrid; class Item_func_hex; class Item_func_hybrid_field_type; +class Item_func_between; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -314,6 +315,8 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const= 0; + virtual longlong + Item_func_between_val_int(Item_func_between *func) const= 0; }; @@ -410,6 +413,7 @@ public: return true; } + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -457,6 +461,7 @@ public: bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, MYSQL_TIME *, ulonglong fuzzydate) const; + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -489,6 +494,7 @@ public: bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, MYSQL_TIME *, ulonglong fuzzydate) const; + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -521,6 +527,7 @@ public: bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, MYSQL_TIME *, ulonglong fuzzydate) const; + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -551,6 +558,7 @@ public: bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, MYSQL_TIME *, ulonglong fuzzydate) const; + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -585,6 +593,7 @@ public: bool Item_func_hybrid_field_type_get_date(Item_func_hybrid_field_type *, MYSQL_TIME *, ulonglong fuzzydate) const; + longlong Item_func_between_val_int(Item_func_between *func) const; }; @@ -960,6 +969,10 @@ public: { return (m_type_handler= Type_handler::get_handler_by_result_type(type)); } + const Type_handler *set_handler_by_cmp_type(Item_result type) + { + return (m_type_handler= Type_handler::get_handler_by_cmp_type(type)); + } const Type_handler *set_handler_by_result_type(Item_result type, uint max_octet_length, CHARSET_INFO *cs) @@ -977,6 +990,8 @@ public: { return (m_type_handler= Type_handler::get_handler_by_real_type(type)); } + void aggregate_for_comparison(const Type_handler *other); + bool aggregate_for_comparison(Item **items, uint nitems); }; @@ -997,5 +1012,7 @@ public: extern Type_handler_row type_handler_row; extern Type_handler_null type_handler_null; extern Type_handler_varchar type_handler_varchar; +extern Type_handler_longlong type_handler_longlong; +extern Type_handler_newdecimal type_handler_newdecimal; #endif /* SQL_TYPE_H_INCLUDED */ From 8b930b8f6866cc5143562bbc32f91af95b9ee7e1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 7 Dec 2016 10:00:46 +0400 Subject: [PATCH 133/135] Addressing Sanja's comments about for the MDEV-11485 patch --- sql/sql_type.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 9538f020a19..1e6ed4dd3b5 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -123,7 +123,7 @@ Type_handler_hybrid_field_type::Type_handler_hybrid_field_type() } -/* +/** Collect built-in data type handlers for comparison. This method is very similar to item_cmp_type() defined in item.cc. Now they coexist. Later item_cmp_type() will be removed. @@ -131,6 +131,7 @@ Type_handler_hybrid_field_type::Type_handler_hybrid_field_type() TIME with DATETIME/TIMESTAMP/DATE, so no additional find_date_time_item() is needed after this call. */ + void Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h) { From 93bc72836ea9f0c6267b3c7c8ff496015742e6a6 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 10 Dec 2016 22:25:17 +0400 Subject: [PATCH 134/135] MDEV-11503 Introduce Type_handler::make_in_vector() and Item_func_in_fix_comparator_compatible_types() This patch implements the task according to the description: 1. The old code from Item_func_in::fix_length_and_dec() was decomposed into smaller methods: - all_items_are_consts() - compatible_types_scalar_bisection_possible() - compatible_types_row_bisection_possible() - fix_in_vector() - fix_for_scalar_comparison_using_bisection() - fix_for_scalar_comparison_using_cmp_items() - fix_for_row_comparison_using_bisection() - fix_for_row_comparison_using_cmp_items() The data type dependend pieces where moved as methods to Type_handler. 2. Splits in_datetime into separate: - in_datetime, for DATETIME and DATE, - in_time, for TIME to make the code more symmetric across data types. Additionally: - Adds a test func_debug.test to see which calculation strategy (bisect or no bisect) is chosen to handle IN with various arguments. - Adds a new helper method (to avoid duplicate code): cmp_item_rows::prepare_comparators() - Changes the propotype for cmp_item_row::alloc_comparators(), to avoid duplicate code, and to use less current_thd. - Changes "friend" sections in cmp_item_row and in_row from an exact Item_func_in method to the entire class Item_func_in, as their internals are now needed in multiple Item_func_in methods. - Added more comments (e.g. on bisection, on the problem reported in MDEV-11511) --- mysql-test/r/func_debug.result | 828 +++++++++++++++++++++++++++++++++ mysql-test/t/func_debug.test | 370 +++++++++++++++ sql/item_cmpfunc.cc | 385 +++++++-------- sql/item_cmpfunc.h | 98 +++- sql/sql_type.cc | 142 +++++- sql/sql_type.h | 30 ++ 6 files changed, 1657 insertions(+), 196 deletions(-) create mode 100644 mysql-test/r/func_debug.result create mode 100644 mysql-test/t/func_debug.test diff --git a/mysql-test/r/func_debug.result b/mysql-test/r/func_debug.result new file mode 100644 index 00000000000..662c7cdade8 --- /dev/null +++ b/mysql-test/r/func_debug.result @@ -0,0 +1,828 @@ +SET SESSION debug_dbug="+d,Item_func_in"; +# Constant predicant, compatible types, bisect +SELECT 1 IN (1,2); +1 IN (1,2) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 IN (1,2,NULL); +1 IN (1,2,NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 NOT IN (1,2); +1 NOT IN (1,2) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 NOT IN (1,2,NULL); +1 NOT IN (1,2,NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1.0 IN (1.0,2.0); +1.0 IN (1.0,2.0) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1.0 IN (1.0,2.0,NULL); +1.0 IN (1.0,2.0,NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1.0 NOT IN (1.0,2.0); +1.0 NOT IN (1.0,2.0) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1.0 NOT IN (1.0,2.0,NULL); +1.0 NOT IN (1.0,2.0,NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1e0 IN (1e0,2e0); +1e0 IN (1e0,2e0) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1e0 IN (1e0,2e0,NULL); +1e0 IN (1e0,2e0,NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1e0 NOT IN (1e0,2e0); +1e0 NOT IN (1e0,2e0) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1e0 NOT IN (1e0,2e0,NULL); +1e0 NOT IN (1e0,2e0,NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 'a' IN ('a','b'); +'a' IN ('a','b') +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 'a' IN ('a','b',NULL); +'a' IN ('a','b',NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 'a' NOT IN ('a','b'); +'a' NOT IN ('a','b') +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 'a' NOT IN ('a','b',NULL); +'a' NOT IN ('a','b',NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30'); +TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30') +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL); +TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30'); +TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30') +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL); +TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIME'10:20:30' IN ('10:20:30','10:20:30'); +TIME'10:20:30' IN ('10:20:30','10:20:30') +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIME'10:20:30' IN ('10:20:30','10:20:30',NULL); +TIME'10:20:30' IN ('10:20:30','10:20:30',NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIME'10:20:30' NOT IN ('10:20:30','10:20:30'); +TIME'10:20:30' NOT IN ('10:20:30','10:20:30') +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT TIME'10:20:30' NOT IN ('10:20:30','10:20:30',NULL); +TIME'10:20:30' NOT IN ('10:20:30','10:20:30',NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT DATE'2001-01-01' IN ('2001-01-01','2001-02-02'); +DATE'2001-01-01' IN ('2001-01-01','2001-02-02') +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT DATE'2001-01-01' IN ('2001-01-01','2001-02-02',NULL); +DATE'2001-01-01' IN ('2001-01-01','2001-02-02',NULL) +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02'); +DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02') +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02',NULL); +DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02',NULL) +0 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +# Column predicant, compatible types, bisect +CREATE TABLE t1 (a INT); +SELECT a IN (1,2,3) FROM t1; +a IN (1,2,3) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN (1,2,3,NULL) FROM t1; +a IN (1,2,3,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1,2,3) FROM t1; +a NOT IN (1,2,3) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1,2,3,NULL) FROM t1; +a NOT IN (1,2,3,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE); +SELECT a IN (1e0,2,3.0) FROM t1; +a IN (1e0,2,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN (1e0,2,3.0,NULL) FROM t1; +a IN (1e0,2,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1e0,2,3.0) FROM t1; +a NOT IN (1e0,2,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1e0,2,3.0,NULL) FROM t1; +a NOT IN (1e0,2,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(10,1)); +SELECT a IN (1,2.0,3.0) FROM t1; +a IN (1,2.0,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN (1,2.0,3.0,NULL) FROM t1; +a IN (1,2.0,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1,2.0,3.0) FROM t1; +a NOT IN (1,2.0,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN (1,2.0,3.0,NULL) FROM t1; +a NOT IN (1,2.0,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)); +SELECT a IN ('a','b','c') FROM t1; +a IN ('a','b','c') +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN ('a','b','c',NULL) FROM t1; +a IN ('a','b','c',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('a','b','c') FROM t1; +a NOT IN ('a','b','c') +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('a','b','c',NULL) FROM t1; +a NOT IN ('a','b','c',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a DATE); +SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) FROM t1; +a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) FROM t1; +a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) FROM t1; +a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) FROM t1; +a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a TIME); +SELECT a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) FROM t1; +a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) FROM t1; +a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) FROM t1; +a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) FROM t1; +a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME); +SELECT a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) FROM t1; +a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) FROM t1; +a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) FROM t1; +a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) FROM t1; +a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +# Constant predicant, compatible types, no bisect +# Bisect is not used because of non-constant expressions in the list +CREATE TABLE t1 (a INT); +SELECT 1 IN (a,1,2,3) FROM t1; +1 IN (a,1,2,3) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 IN (a,1,2,3,NULL) FROM t1; +1 IN (a,1,2,3,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1,2,3) FROM t1; +1 NOT IN (a,1,2,3) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1,2,3,NULL) FROM t1; +1 NOT IN (a,1,2,3,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE); +SELECT 1 IN (a,1e0,2e0,3e0) FROM t1; +1 IN (a,1e0,2e0,3e0) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 IN (a,1e0,2e0,3e0,NULL) FROM t1; +1 IN (a,1e0,2e0,3e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1e0,2e0,3e0) FROM t1; +1 NOT IN (a,1e0,2e0,3e0) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1e0,2e0,3e0,NULL) FROM t1; +1 NOT IN (a,1e0,2e0,3e0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(10,1)); +SELECT 1 IN (a,1.0,2.0,3.0) FROM t1; +1 IN (a,1.0,2.0,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 IN (a,1.0,2.0,3.0,NULL) FROM t1; +1 IN (a,1.0,2.0,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1.0,2.0,3.0) FROM t1; +1 NOT IN (a,1.0,2.0,3.0) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 NOT IN (a,1.0,2.0,3.0,NULL) FROM t1; +1 NOT IN (a,1.0,2.0,3.0,NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)); +SELECT 'a' IN (a,'b','c') FROM t1; +'a' IN (a,'b','c') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 'a' IN (a,'b','c',NULL) FROM t1; +'a' IN (a,'b','c',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 'a' NOT IN (a,'b','c') FROM t1; +'a' NOT IN (a,'b','c') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 'a' NOT IN (a,'b','c',NULL) FROM t1; +'a' NOT IN (a,'b','c',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DATE); +SELECT DATE'2001-01-01' IN (a,'2001-01-01') FROM t1; +DATE'2001-01-01' IN (a,'2001-01-01') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT DATE'2001-01-01' IN (a,'2001-01-01',NULL) FROM t1; +DATE'2001-01-01' IN (a,'2001-01-01',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT DATE'2001-01-01' NOT IN (a,'2001-01-01') FROM t1; +DATE'2001-01-01' NOT IN (a,'2001-01-01') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT DATE'2001-01-01' NOT IN (a,'2001-01-01',NULL) FROM t1; +DATE'2001-01-01' NOT IN (a,'2001-01-01',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a TIME); +SELECT TIME'10:20:30' IN (a,'10:20:30') FROM t1; +TIME'10:20:30' IN (a,'10:20:30') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIME'10:20:30' IN (a,'10:20:30',NULL) FROM t1; +TIME'10:20:30' IN (a,'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIME'10:20:30' NOT IN (a,'10:20:30') FROM t1; +TIME'10:20:30' NOT IN (a,'10:20:30') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIME'10:20:30' NOT IN (a,'10:20:30',NULL) FROM t1; +TIME'10:20:30' NOT IN (a,'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME); +SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30') +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +# Constant predicant, incompatible types, no bisect +SELECT 1 IN (1,2e0); +1 IN (1,2e0) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1 IN (1,2e0,NULL); +1 IN (1,2e0,NULL) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1 NOT IN (1,2e0); +1 NOT IN (1,2e0) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1 NOT IN (1,2e0,NULL); +1 NOT IN (1,2e0,NULL) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1.0 IN (1.0,2e0); +1.0 IN (1.0,2e0) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1.0 IN (1.0,2e0,NULL); +1.0 IN (1.0,2e0,NULL) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1.0 NOT IN (1.0,2e0); +1.0 NOT IN (1.0,2e0) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1.0 NOT IN (1.0,2e0,NULL); +1.0 NOT IN (1.0,2e0,NULL) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1e0 IN (1.0,TIME'10:20:30'); +1e0 IN (1.0,TIME'10:20:30') +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1e0 IN (1.0,TIME'10:20:30',NULL); +1e0 IN (1.0,TIME'10:20:30',NULL) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1e0 NOT IN (1.0,TIME'10:20:30'); +1e0 NOT IN (1.0,TIME'10:20:30') +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 1e0 NOT IN (1.0,TIME'10:20:30',NULL); +1e0 NOT IN (1.0,TIME'10:20:30',NULL) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 'a' IN ('a',2); +'a' IN ('a',2) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 'a' IN ('a',2,NULL); +'a' IN ('a',2,NULL) +1 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 'a' NOT IN ('a',2); +'a' NOT IN ('a',2) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT 'a' NOT IN ('a',2,NULL); +'a' NOT IN ('a',2,NULL) +0 +Warnings: +Warning 1105 types_compatible=no bisect=no +# Column predicant, incompatible types, no bisect +CREATE TABLE t1 (a INT); +SELECT a IN (1,1e0) FROM t1; +a IN (1,1e0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,1e0,NULL) FROM t1; +a IN (1,1e0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1e0) FROM t1; +a NOT IN (1,1e0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1e0,NULL) FROM t1; +a NOT IN (1,1e0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,1.0) FROM t1; +a IN (1,1.0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,1.0,NULL) FROM t1; +a IN (1,1.0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1.0) FROM t1; +a NOT IN (1,1.0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1.0,NULL) FROM t1; +a NOT IN (1,1.0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,'1') FROM t1; +a IN (1,'1') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,'1',NULL) FROM t1; +a IN (1,'1',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,'1') FROM t1; +a NOT IN (1,'1') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,'1',NULL) FROM t1; +a NOT IN (1,'1',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIME'10:20:30') FROM t1; +a IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +a IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +a NOT IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; +a NOT IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(10,0)); +SELECT a IN (1,1e0) FROM t1; +a IN (1,1e0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,1e0,NULL) FROM t1; +a IN (1,1e0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1e0) FROM t1; +a NOT IN (1,1e0) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,1e0,NULL) FROM t1; +a NOT IN (1,1e0,NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,'1') FROM t1; +a IN (1,'1') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,'1',NULL) FROM t1; +a IN (1,'1',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,'1') FROM t1; +a NOT IN (1,'1') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,'1',NULL) FROM t1; +a NOT IN (1,'1',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIME'10:20:30') FROM t1; +a IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +a IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +a NOT IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; +a NOT IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE); +SELECT a IN (1,TIME'10:20:30') FROM t1; +a IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +a IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +a NOT IN (1,TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; +a NOT IN (1,TIME'10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,DATE'2001-01-01') FROM t1; +a IN (1,DATE'2001-01-01') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,DATE'2001-01-01',NULL) FROM t1; +a IN (1,DATE'2001-01-01',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,DATE'2001-01-01') FROM t1; +a NOT IN (1,DATE'2001-01-01') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,DATE'2001-01-01',NULL) FROM t1; +a NOT IN (1,DATE'2001-01-01',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +a IN (1,TIMESTAMP'2001-01-01 10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +a IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) +Warnings: +Warning 1105 types_compatible=no bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)); +SELECT a IN ('a',1) FROM t1; +a IN ('a',1) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a IN ('a',TIME'10:20:30') FROM t1; +a IN ('a',TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN ('a',1) FROM t1; +a NOT IN ('a',1) +Warnings: +Warning 1105 types_compatible=no bisect=no +SELECT a NOT IN ('a',TIME'10:20:30') FROM t1; +a NOT IN ('a',TIME'10:20:30') +Warnings: +Warning 1105 types_compatible=no bisect=no +DROP TABLE t1; +# Not top level, negated: cond3 is false +CREATE TABLE t1 (a INT); +SELECT ROW(a,a) NOT IN ((1,1),(2,NULL)) FROM t1; +ROW(a,a) NOT IN ((1,1),(2,NULL)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,a) NOT IN ((1,1),(2,2)) FROM t1; +ROW(a,a) NOT IN ((1,1),(2,2)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT); +SELECT ROW(a,a) NOT IN ((1,1),(2,NULL)) FROM t1; +ROW(a,a) NOT IN ((1,1),(2,NULL)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,a) NOT IN ((1,1),(2,2)) FROM t1; +ROW(a,a) NOT IN ((1,1),(2,2)) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT); +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) FROM t1; +ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) FROM t1; +ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +# Not top level, not negated: cond3 is false +CREATE TABLE t1 (a INT); +SELECT ROW(a,a) IN ((1,1),(2,NULL)) FROM t1; +ROW(a,a) IN ((1,1),(2,NULL)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,a) IN ((1,1),(2,2)) FROM t1; +ROW(a,a) IN ((1,1),(2,2)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,a) IN ((1,1),(2,NULL)) FROM t1; +ROW(a,a) IN ((1,1),(2,NULL)) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,a) IN ((1,1),(2,2)) FROM t1; +ROW(a,a) IN ((1,1),(2,2)) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT); +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) FROM t1; +ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) FROM t1; +ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +# Top level, negated: cond3 is false +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,NULL)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,NULL)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=no +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +# Top level, not negated: cond3 is true +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,NULL)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,2)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,NULL)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,2)); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))); +1 +Warnings: +Warning 1105 types_compatible=yes bisect=yes +DROP TABLE t1; +SET SESSION debug_dbug="-d,Item_func_in"; diff --git a/mysql-test/t/func_debug.test b/mysql-test/t/func_debug.test new file mode 100644 index 00000000000..10eec49b5ab --- /dev/null +++ b/mysql-test/t/func_debug.test @@ -0,0 +1,370 @@ +--source include/have_debug.inc + +SET SESSION debug_dbug="+d,Item_func_in"; + +--echo # Constant predicant, compatible types, bisect +SELECT 1 IN (1,2); +SELECT 1 IN (1,2,NULL); +SELECT 1 NOT IN (1,2); +SELECT 1 NOT IN (1,2,NULL); + +SELECT 1.0 IN (1.0,2.0); +SELECT 1.0 IN (1.0,2.0,NULL); +SELECT 1.0 NOT IN (1.0,2.0); +SELECT 1.0 NOT IN (1.0,2.0,NULL); + +SELECT 1e0 IN (1e0,2e0); +SELECT 1e0 IN (1e0,2e0,NULL); +SELECT 1e0 NOT IN (1e0,2e0); +SELECT 1e0 NOT IN (1e0,2e0,NULL); + +SELECT 'a' IN ('a','b'); +SELECT 'a' IN ('a','b',NULL); +SELECT 'a' NOT IN ('a','b'); +SELECT 'a' NOT IN ('a','b',NULL); + +SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30'); +SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL); +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30'); +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL); + +SELECT TIME'10:20:30' IN ('10:20:30','10:20:30'); +SELECT TIME'10:20:30' IN ('10:20:30','10:20:30',NULL); +SELECT TIME'10:20:30' NOT IN ('10:20:30','10:20:30'); +SELECT TIME'10:20:30' NOT IN ('10:20:30','10:20:30',NULL); + +SELECT DATE'2001-01-01' IN ('2001-01-01','2001-02-02'); +SELECT DATE'2001-01-01' IN ('2001-01-01','2001-02-02',NULL); +SELECT DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02'); +SELECT DATE'2001-01-01' NOT IN ('2001-01-01','2001-02-02',NULL); + + +--echo # Column predicant, compatible types, bisect + +CREATE TABLE t1 (a INT); +SELECT a IN (1,2,3) FROM t1; +SELECT a IN (1,2,3,NULL) FROM t1; +SELECT a NOT IN (1,2,3) FROM t1; +SELECT a NOT IN (1,2,3,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE); +SELECT a IN (1e0,2,3.0) FROM t1; +SELECT a IN (1e0,2,3.0,NULL) FROM t1; +SELECT a NOT IN (1e0,2,3.0) FROM t1; +SELECT a NOT IN (1e0,2,3.0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(10,1)); +SELECT a IN (1,2.0,3.0) FROM t1; +SELECT a IN (1,2.0,3.0,NULL) FROM t1; +SELECT a NOT IN (1,2.0,3.0) FROM t1; +SELECT a NOT IN (1,2.0,3.0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10)); +SELECT a IN ('a','b','c') FROM t1; +SELECT a IN ('a','b','c',NULL) FROM t1; +SELECT a NOT IN ('a','b','c') FROM t1; +SELECT a NOT IN ('a','b','c',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE); +SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) FROM t1; +SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) FROM t1; +SELECT a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) FROM t1; +SELECT a NOT IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME); +SELECT a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) FROM t1; +SELECT a IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) FROM t1; +SELECT a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0) FROM t1; +SELECT a NOT IN ('10:20:30',TIME'10:20:30',102030,102030.0,102030e0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME); +SELECT a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) FROM t1; +SELECT a IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) FROM t1; +SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0) FROM t1; +SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) FROM t1; +DROP TABLE t1; + +--echo # Constant predicant, compatible types, no bisect +--echo # Bisect is not used because of non-constant expressions in the list +CREATE TABLE t1 (a INT); +SELECT 1 IN (a,1,2,3) FROM t1; +SELECT 1 IN (a,1,2,3,NULL) FROM t1; +SELECT 1 NOT IN (a,1,2,3) FROM t1; +SELECT 1 NOT IN (a,1,2,3,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE); +SELECT 1 IN (a,1e0,2e0,3e0) FROM t1; +SELECT 1 IN (a,1e0,2e0,3e0,NULL) FROM t1; +SELECT 1 NOT IN (a,1e0,2e0,3e0) FROM t1; +SELECT 1 NOT IN (a,1e0,2e0,3e0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(10,1)); +SELECT 1 IN (a,1.0,2.0,3.0) FROM t1; +SELECT 1 IN (a,1.0,2.0,3.0,NULL) FROM t1; +SELECT 1 NOT IN (a,1.0,2.0,3.0) FROM t1; +SELECT 1 NOT IN (a,1.0,2.0,3.0,NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10)); +SELECT 'a' IN (a,'b','c') FROM t1; +SELECT 'a' IN (a,'b','c',NULL) FROM t1; +SELECT 'a' NOT IN (a,'b','c') FROM t1; +SELECT 'a' NOT IN (a,'b','c',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE); +SELECT DATE'2001-01-01' IN (a,'2001-01-01') FROM t1; +SELECT DATE'2001-01-01' IN (a,'2001-01-01',NULL) FROM t1; +SELECT DATE'2001-01-01' NOT IN (a,'2001-01-01') FROM t1; +SELECT DATE'2001-01-01' NOT IN (a,'2001-01-01',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME); +SELECT TIME'10:20:30' IN (a,'10:20:30') FROM t1; +SELECT TIME'10:20:30' IN (a,'10:20:30',NULL) FROM t1; +SELECT TIME'10:20:30' NOT IN (a,'10:20:30') FROM t1; +SELECT TIME'10:20:30' NOT IN (a,'10:20:30',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME); +SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +DROP TABLE t1; + + +--echo # Constant predicant, incompatible types, no bisect +SELECT 1 IN (1,2e0); +SELECT 1 IN (1,2e0,NULL); +SELECT 1 NOT IN (1,2e0); +SELECT 1 NOT IN (1,2e0,NULL); + +SELECT 1.0 IN (1.0,2e0); +SELECT 1.0 IN (1.0,2e0,NULL); +SELECT 1.0 NOT IN (1.0,2e0); +SELECT 1.0 NOT IN (1.0,2e0,NULL); + +SELECT 1e0 IN (1.0,TIME'10:20:30'); +SELECT 1e0 IN (1.0,TIME'10:20:30',NULL); +SELECT 1e0 NOT IN (1.0,TIME'10:20:30'); +SELECT 1e0 NOT IN (1.0,TIME'10:20:30',NULL); + +SELECT 'a' IN ('a',2); +SELECT 'a' IN ('a',2,NULL); +SELECT 'a' NOT IN ('a',2); +SELECT 'a' NOT IN ('a',2,NULL); + +--echo # Column predicant, incompatible types, no bisect +CREATE TABLE t1 (a INT); +SELECT a IN (1,1e0) FROM t1; +SELECT a IN (1,1e0,NULL) FROM t1; +SELECT a NOT IN (1,1e0) FROM t1; +SELECT a NOT IN (1,1e0,NULL) FROM t1; + +SELECT a IN (1,1.0) FROM t1; +SELECT a IN (1,1.0,NULL) FROM t1; +SELECT a NOT IN (1,1.0) FROM t1; +SELECT a NOT IN (1,1.0,NULL) FROM t1; + +SELECT a IN (1,'1') FROM t1; +SELECT a IN (1,'1',NULL) FROM t1; +SELECT a NOT IN (1,'1') FROM t1; +SELECT a NOT IN (1,'1',NULL) FROM t1; + +SELECT a IN (1,TIME'10:20:30') FROM t1; +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(10,0)); +SELECT a IN (1,1e0) FROM t1; +SELECT a IN (1,1e0,NULL) FROM t1; +SELECT a NOT IN (1,1e0) FROM t1; +SELECT a NOT IN (1,1e0,NULL) FROM t1; + +SELECT a IN (1,'1') FROM t1; +SELECT a IN (1,'1',NULL) FROM t1; +SELECT a NOT IN (1,'1') FROM t1; +SELECT a NOT IN (1,'1',NULL) FROM t1; + +SELECT a IN (1,TIME'10:20:30') FROM t1; +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE); +SELECT a IN (1,TIME'10:20:30') FROM t1; +SELECT a IN (1,TIME'10:20:30',NULL) FROM t1; +SELECT a NOT IN (1,TIME'10:20:30') FROM t1; +SELECT a NOT IN (1,TIME'10:20:30',NULL) FROM t1; + +SELECT a IN (1,DATE'2001-01-01') FROM t1; +SELECT a IN (1,DATE'2001-01-01',NULL) FROM t1; +SELECT a NOT IN (1,DATE'2001-01-01') FROM t1; +SELECT a NOT IN (1,DATE'2001-01-01',NULL) FROM t1; + +SELECT a IN (1,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +SELECT a IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +SELECT a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30') FROM t1; +SELECT a NOT IN (1,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10)); +SELECT a IN ('a',1) FROM t1; +SELECT a IN ('a',TIME'10:20:30') FROM t1; +SELECT a NOT IN ('a',1) FROM t1; +SELECT a NOT IN ('a',TIME'10:20:30') FROM t1; +DROP TABLE t1; + +# +# ROW tests +# +# ROW has additional conditions when bisect is possible (see item_cmpfunc.h): +# +# ((is_top_level_item && not_negated) || // 3 +# (arg0_can_not_be_null && list_does_not_have_nulls) // 4 + +# Testing all combinations of the condition components +# +# tli - is_top_level_item +# nneg - not_negated +# a0nnul - arg0_can_not_be_null +# lnnul - list_does_not_have_nulls +# cond3 - condition 3 is true? +# cond4 - condition 4 is true? +# bisect - bisect is possible (cond3 orded with cond4) + +# Note: +# - using an expression in SELECT list makes top_level_item() to be false +# - using an expression in WHERE clause makes top_leve_item() to be true + +--echo # Not top level, negated: cond3 is false + +# tli nneg a0nnul lnnul cond3 cond4 bisect +# --- --- ------ ----- ----- ----- ------ +# 0 0 0 0 0 0 0 +# 0 0 0 1 0 0 0 +# 0 0 1 0 0 0 0 +# 0 0 1 1 0 1 1 + +# ROW with scalar elements +CREATE TABLE t1 (a INT); +SELECT ROW(a,a) NOT IN ((1,1),(2,NULL)) FROM t1; +SELECT ROW(a,a) NOT IN ((1,1),(2,2)) FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT); +SELECT ROW(a,a) NOT IN ((1,1),(2,NULL)) FROM t1; +SELECT ROW(a,a) NOT IN ((1,1),(2,2)) FROM t1; +DROP TABLE t1; + +# ROW with a nested ROW +CREATE TABLE t1 (a INT); +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +SELECT ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))) FROM t1; +DROP TABLE t1; + +--echo # Not top level, not negated: cond3 is false + +# tli nneg a0nnul lnnul cond3 cond4 bisect +# --- --- ------ ----- ----- ----- ------ +# 0 1 0 0 0 0 0 +# 0 1 0 1 0 0 0 +# 0 1 1 0 0 0 0 +# 0 1 1 1 0 1 1 + +# ROW with scalar elements +CREATE TABLE t1 (a INT); +SELECT ROW(a,a) IN ((1,1),(2,NULL)) FROM t1; +SELECT ROW(a,a) IN ((1,1),(2,2)) FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,a) IN ((1,1),(2,NULL)) FROM t1; +SELECT ROW(a,a) IN ((1,1),(2,2)) FROM t1; +DROP TABLE t1; + +# ROW with a nested ROW +CREATE TABLE t1 (a INT); +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))) FROM t1; +SELECT ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))) FROM t1; +DROP TABLE t1; + + +--echo # Top level, negated: cond3 is false + +# tli nneg a0nnul lnnul cond3 cond4 bisect +# --- --- ------ ----- ----- ----- ------ +# 1 0 0 0 0 0 0 +# 1 0 0 1 0 0 0 +# 1 0 1 0 0 0 0 +# 1 0 1 1 0 1 1 + +# ROW with scalar elements +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,NULL)); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2)); +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,NULL)); +SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2)); +DROP TABLE t1; + +# ROW with a nested ROW +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))); +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,NULL))); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) NOT IN ((1,(1,1)),(2,(2,2))); +DROP TABLE t1; + +--echo # Top level, not negated: cond3 is true + +# tli nneg a0nnul lnnul cond3 cond4 bisect +# --- --- ------ ----- ----- ----- ------ +# 1 1 0 0 1 0 1 +# 1 1 0 1 1 1 1 +# 1 1 1 0 1 0 1 +# 1 1 1 1 1 1 1 + +# ROW with scalar elements +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,NULL)); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,2)); +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,NULL)); +SELECT 1 FROM t1 WHERE ROW(a,a) IN ((1,1),(2,2)); +DROP TABLE t1; + +# ROW with a nested ROW +CREATE TABLE t1 (a INT); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))); +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,NULL))); +SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,2))); +DROP TABLE t1; + + +SET SESSION debug_dbug="-d,Item_func_in"; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 0b392213f3e..da76f26dc03 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3704,16 +3704,22 @@ void in_datetime::set(uint pos,Item *item) { struct packed_longlong *buff= &((packed_longlong*) base)[pos]; - buff->val= item->val_temporal_packed(warn_item); + buff->val= item->val_datetime_packed(); buff->unsigned_flag= 1L; } -uchar *in_datetime::get_value(Item *item) +void in_time::set(uint pos,Item *item) +{ + struct packed_longlong *buff= &((packed_longlong*) base)[pos]; + + buff->val= item->val_time_packed(); + buff->unsigned_flag= 1L; +} + +uchar *in_temporal::get_value_internal(Item *item, enum_field_types f_type) { bool is_null; Item **tmp_item= lval_cache ? &lval_cache : &item; - enum_field_types f_type= - tmp_item[0]->field_type_for_temporal_comparison(warn_item); tmp.val= get_datetime_value(thd, &tmp_item, &lval_cache, f_type, &is_null); if (item->null_value) return 0; @@ -3721,7 +3727,7 @@ uchar *in_datetime::get_value(Item *item) return (uchar*) &tmp; } -Item *in_datetime::create_item(THD *thd) +Item *in_temporal::create_item(THD *thd) { return new (thd->mem_root) Item_datetime(thd); } @@ -3841,19 +3847,22 @@ cmp_item_row::~cmp_item_row() } -void cmp_item_row::alloc_comparators() +bool cmp_item_row::alloc_comparators(THD *thd, uint cols) { - if (!comparators) - comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n); + if (comparators) + { + DBUG_ASSERT(cols == n); + return false; + } + return + !(comparators= (cmp_item **) thd->calloc(sizeof(cmp_item *) * (n= cols))); } void cmp_item_row::store_value(Item *item) { DBUG_ENTER("cmp_item_row::store_value"); - n= item->cols(); - alloc_comparators(); - if (comparators) + if (!alloc_comparators(current_thd, item->cols())) { item->bring_value(); item->null_value= 0; @@ -3861,6 +3870,20 @@ void cmp_item_row::store_value(Item *item) { if (!comparators[i]) { + /** + Comparators for the row elements that have temporal data types + are installed at initialization time by prepare_comparators(). + Here we install comparators for the other data types. + There is a bug in the below code. See MDEV-11511. + When performing: + (predicant0,predicant1) IN ((value00,value01),(value10,value11)) + It uses only the data type and the collation of the predicant + elements only. It should be fixed to aggregate the data type and + the collation for all elements at the N-th positions of the + predicate and all values: + - predicate0, value00, value01 + - predicate1, value10, value11 + */ DBUG_ASSERT(item->element_index(i)->cmp_type() != TIME_RESULT); if (!(comparators[i]= cmp_item::get_comparator(item->element_index(i)->result_type(), 0, @@ -4091,208 +4114,202 @@ void Item_func_in::fix_after_pullout(st_select_lex *new_parent, Item **ref) eval_not_null_tables(NULL); } -static int srtcmp_in(CHARSET_INFO *cs, const String *x,const String *y) -{ - return cs->coll->strnncollsp(cs, - (uchar *) x->ptr(),x->length(), - (uchar *) y->ptr(),y->length()); -} void Item_func_in::fix_length_and_dec() { - Item **arg, **arg_end; - bool const_itm= 1; THD *thd= current_thd; - /* TRUE <=> arguments values will be compared as DATETIMEs. */ - Item *date_arg= 0; uint found_types= 0; uint type_cnt= 0, i; m_comparator.set_handler(&type_handler_varchar); left_cmp_type= args[0]->cmp_type(); + max_length= 1; if (!(found_types= collect_cmp_types(args, arg_count, true))) return; - for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++) - { - if (!arg[0]->const_item()) - { - const_itm= 0; - break; - } - } for (i= 0; i <= (uint)TIME_RESULT; i++) { if (found_types & (1U << i)) { (type_cnt)++; - m_comparator.set_handler_by_cmp_type((Item_result) i); - } - } - - /* - First conditions for bisection to be possible: - 1. All types are similar, and - 2. All expressions in are const - */ - bool bisection_possible= - type_cnt == 1 && // 1 - const_itm; // 2 - if (bisection_possible) - { - /* - In the presence of NULLs, the correct result of evaluating this item - must be UNKNOWN or FALSE. To achieve that: - - If type is scalar, we can use bisection and the "have_null" boolean. - - If type is ROW, we will need to scan all of when - searching, so bisection is impossible. Unless: - 3. UNKNOWN and FALSE are equivalent results - 4. Neither left expression nor contain any NULL value - */ - - if (m_comparator.cmp_type() == ROW_RESULT && - ((!is_top_level_item() || negated) && // 3 - (list_contains_null() || args[0]->maybe_null))) // 4 - bisection_possible= false; - } - - if (type_cnt == 1) - { - if (m_comparator.cmp_type() == STRING_RESULT && - agg_arg_charsets_for_comparison(cmp_collation, args, arg_count)) - return; - arg_types_compatible= TRUE; - - if (m_comparator.cmp_type() == ROW_RESULT) - { - uint cols= args[0]->cols(); - cmp_item_row *cmp= 0; - - if (bisection_possible) + if ((Item_result) i == TIME_RESULT) { - array= new (thd->mem_root) in_row(thd, arg_count-1, 0); - cmp= &((in_row*)array)->tmp; + Item *date_arg= find_date_time_item(args, arg_count, 0); + m_comparator.set_handler(date_arg ? date_arg->type_handler() : + &type_handler_datetime); } else - { - if (!(cmp= new (thd->mem_root) cmp_item_row)) - return; - cmp_items[ROW_RESULT]= cmp; - } - cmp->n= cols; - cmp->alloc_comparators(); - - for (uint col= 0; col < cols; col++) - { - date_arg= find_date_time_item(args, arg_count, col); - if (date_arg) - { - cmp_item **cmp= 0; - if (array) - cmp= ((in_row*)array)->tmp.comparators + col; - else - cmp= ((cmp_item_row*)cmp_items[ROW_RESULT])->comparators + col; - *cmp= new (thd->mem_root) cmp_item_datetime(date_arg); - } - } + m_comparator.set_handler_by_cmp_type((Item_result) i); } } - if (bisection_possible) + if (type_cnt == 1) // Bisection condition #1 { - /* - IN must compare INT columns and constants as int values (the same - way as equality does). - So we must check here if the column on the left and all the constant - values on the right can be compared as integers and adjust the - comparison type accordingly. - - See the comment about the similar block in Item_bool_func2 - */ - if (args[0]->real_item()->type() == FIELD_ITEM && - !thd->lex->is_view_context_analysis() && - m_comparator.cmp_type() != INT_RESULT) - { - Item_field *field_item= (Item_field*) (args[0]->real_item()); - if (field_item->field_type() == MYSQL_TYPE_LONGLONG || - field_item->field_type() == MYSQL_TYPE_YEAR) - { - bool all_converted= TRUE; - for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) - { - if (!convert_const_to_int(thd, field_item, &arg[0])) - all_converted= FALSE; - } - if (all_converted) - m_comparator.set_handler(&type_handler_longlong); - } - } - switch (m_comparator.cmp_type()) { - case STRING_RESULT: - array=new (thd->mem_root) in_string(thd, arg_count - 1, - (qsort2_cmp) srtcmp_in, - cmp_collation.collation); - break; - case INT_RESULT: - array= new (thd->mem_root) in_longlong(thd, arg_count - 1); - break; - case REAL_RESULT: - array= new (thd->mem_root) in_double(thd, arg_count - 1); - break; - case ROW_RESULT: - /* - The row comparator was created at the beginning but only DATETIME - items comparators were initialized. Call store_value() to setup - others. - */ - ((in_row*)array)->tmp.store_value(args[0]); - break; - case DECIMAL_RESULT: - array= new (thd->mem_root) in_decimal(thd, arg_count - 1); - break; - case TIME_RESULT: - date_arg= find_date_time_item(args, arg_count, 0); - array= new (thd->mem_root) in_datetime(thd, date_arg, arg_count - 1); - break; - } - if (!array || thd->is_fatal_error) // OOM - return; - uint j=0; - for (uint i=1 ; i < arg_count ; i++) - { - array->set(j,args[i]); - if (!args[i]->null_value) - j++; // include this cell in the array. - else - { - /* - We don't put NULL values in array, to avoid erronous matches in - bisection. - */ - have_null= 1; - } - } - if ((array->used_count= j)) - array->sort(); + arg_types_compatible= true; + m_comparator.type_handler()-> + Item_func_in_fix_comparator_compatible_types(thd, this); } else { - if (found_types & (1U << TIME_RESULT)) - date_arg= find_date_time_item(args, arg_count, 0); - if (found_types & (1U << STRING_RESULT) && - agg_arg_charsets_for_comparison(cmp_collation, args, arg_count)) - return; - for (i= 0; i <= (uint) TIME_RESULT; i++) + DBUG_ASSERT(m_comparator.cmp_type() != ROW_RESULT); + fix_for_scalar_comparison_using_cmp_items(found_types); + } + + DBUG_EXECUTE_IF("Item_func_in", + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_UNKNOWN_ERROR, "types_compatible=%s bisect=%s", + arg_types_compatible ? "yes" : "no", + array != NULL ? "yes" : "no");); +} + + +/** + Populate Item_func_in::array with constant not-NULL arguments and sort them. +*/ +void Item_func_in::fix_in_vector() +{ + DBUG_ASSERT(array); + uint j=0; + for (uint i=1 ; i < arg_count ; i++) + { + array->set(j,args[i]); + if (!args[i]->null_value) + j++; // include this cell in the array. + else { - if (found_types & (1U << i) && !cmp_items[i]) - { - if (!cmp_items[i] && !(cmp_items[i]= - cmp_item::get_comparator((Item_result)i, date_arg, - cmp_collation.collation))) - return; - } + /* + We don't put NULL values in array, to avoid erronous matches in + bisection. + */ + have_null= 1; } } - max_length= 1; + if ((array->used_count= j)) + array->sort(); +} + + +/** + Convert all items in to INT. + + IN must compare INT columns and constants as int values (the same + way as equality does). + So we must check here if the column on the left and all the constant + values on the right can be compared as integers and adjust the + comparison type accordingly. + + See the comment about the similar block in Item_bool_func2 +*/ +bool Item_func_in::value_list_convert_const_to_int(THD *thd) +{ + if (args[0]->real_item()->type() == FIELD_ITEM && + !thd->lex->is_view_context_analysis()) + { + Item_field *field_item= (Item_field*) (args[0]->real_item()); + if (field_item->field_type() == MYSQL_TYPE_LONGLONG || + field_item->field_type() == MYSQL_TYPE_YEAR) + { + bool all_converted= TRUE; + Item **arg, **arg_end; + for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) + { + if (!convert_const_to_int(thd, field_item, &arg[0])) + all_converted= FALSE; + } + if (all_converted) + m_comparator.set_handler(&type_handler_longlong); + } + } + return thd->is_fatal_error; // Catch errrors in convert_const_to_int +} + + +/** + Historically this code installs comparators at initialization time + for temporal ROW elements only. All other comparators are installed later, + during the first store_value(). This causes the bug MDEV-11511. + See also comments in cmp_item_row::store_value(). +*/ +bool cmp_item_row::prepare_comparators(THD *thd, Item **args, uint arg_count) +{ + for (uint col= 0; col < n; col++) + { + Item *date_arg= find_date_time_item(args, arg_count, col); + if (date_arg) + { + if (!(comparators[col]= new (thd->mem_root) cmp_item_datetime(date_arg))) + return true; + } + } + return false; +} + + +bool Item_func_in::fix_for_row_comparison_using_bisection(THD *thd) +{ + uint cols= args[0]->cols(); + if (!(array= new (thd->mem_root) in_row(thd, arg_count-1, 0))) + return true; + cmp_item_row *cmp= &((in_row*)array)->tmp; + if (cmp->alloc_comparators(thd, cols) || + cmp->prepare_comparators(thd, args, arg_count)) + return true; + /* + Only DATETIME items comparators were initialized. + Call store_value() to setup others. + */ + cmp->store_value(args[0]); + if (thd->is_fatal_error) // OOM + return true; + fix_in_vector(); + return false; +} + + +/** + This method is called for scalar data types when bisection is not possible, + for example: + - Some of args[1..arg_count] are not constants. + - args[1..arg_count] are constants, but pairs {args[0],args[1..arg_count]} + are compared by different data types, e.g.: + WHERE decimal_expr IN (1, 1e0) + The pair {args[0],args[1]} is compared by type_handler_decimal. + The pair {args[0],args[2]} is compared by type_handler_double. +*/ +bool Item_func_in::fix_for_scalar_comparison_using_cmp_items(uint found_types) +{ + Item *date_arg; + if (found_types & (1U << TIME_RESULT)) + date_arg= find_date_time_item(args, arg_count, 0); + if (found_types & (1U << STRING_RESULT) && + agg_arg_charsets_for_comparison(cmp_collation, args, arg_count)) + return true; + for (uint i= 0; i <= (uint) TIME_RESULT; i++) + { + if (found_types & (1U << i) && !cmp_items[i]) + { + if (!cmp_items[i] && !(cmp_items[i]= + cmp_item::get_comparator((Item_result)i, date_arg, + cmp_collation.collation))) + return true; + } + } + return false; +} + + +/** + This method is called for the ROW data type when bisection is not possible. +*/ +bool Item_func_in::fix_for_row_comparison_using_cmp_items(THD *thd) +{ + uint cols= args[0]->cols(); + cmp_item_row *cmp_row; + if (!(cmp_row= new (thd->mem_root) cmp_item_row) || + cmp_row->alloc_comparators(thd, cols) || + cmp_row->prepare_comparators(thd, args, arg_count)) + return true; + cmp_items[ROW_RESULT]= cmp_row; + return false; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 316b9336ac6..9749dabb88b 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1264,20 +1264,18 @@ public: If the left item is a constant one then its value is cached in the lval_cache variable. */ -class in_datetime :public in_longlong +class in_temporal :public in_longlong { +protected: + uchar *get_value_internal(Item *item, enum_field_types f_type); public: THD *thd; - /* An item used to issue warnings. */ - Item *warn_item; /* Cache for the left item. */ Item *lval_cache; - in_datetime(THD *thd, Item *warn_item_arg, uint elements) - :in_longlong(thd, elements), thd(current_thd), warn_item(warn_item_arg), + in_temporal(THD *thd, uint elements) + :in_longlong(thd, elements), thd(current_thd), lval_cache(0) {}; - void set(uint pos,Item *item); - uchar *get_value(Item *item); Item *create_item(THD *thd); void value_to_item(uint pos, Item *item) { @@ -1289,6 +1287,30 @@ public: }; +class in_datetime :public in_temporal +{ +public: + in_datetime(THD *thd, uint elements) + :in_temporal(thd, elements) + {} + void set(uint pos,Item *item); + uchar *get_value(Item *item) + { return get_value_internal(item, MYSQL_TYPE_DATETIME); } +}; + + +class in_time :public in_temporal +{ +public: + in_time(THD *thd, uint elements) + :in_temporal(thd, elements) + {} + void set(uint pos,Item *item); + uchar *get_value(Item *item) + { return get_value_internal(item, MYSQL_TYPE_TIME); } +}; + + class in_double :public in_vector { double tmp; @@ -1602,12 +1624,24 @@ public: The current implementation distinguishes 2 cases: 1) all items in are constants and have the same - result type. This case is handled by in_vector class. + result type. This case is handled by in_vector class, + implementing fast bisection search. 2) otherwise Item_func_in employs several cmp_item objects to perform comparisons of in_expr and an item from . One cmp_item object for each result type. Different result types are collected in the fix_length_and_dec() member function by means of collect_cmp_types() function. + + Bisection is possible when: + 1. All types are similar + 2. All expressions in are const + In the presence of NULLs, the correct result of evaluating this item + must be UNKNOWN or FALSE. To achieve that: + - If type is scalar, we can use bisection and the "have_null" boolean. + - If type is ROW, we will need to scan all of when + searching, so bisection is impossible. Unless: + 3. UNKNOWN and FALSE are equivalent results + 4. Neither left expression nor contain any NULL value */ class Item_func_in :public Item_func_opt_neg { @@ -1617,6 +1651,15 @@ class Item_func_in :public Item_func_opt_neg IN ( (-5, (12,NULL)), ... ). */ bool list_contains_null(); + bool all_items_are_consts(Item **items, uint nitems) const + { + for (uint i= 0; i < nitems; i++) + { + if (!items[i]->const_item()) + return false; + } + return true; + } protected: SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Field *field, Item *value); @@ -1648,6 +1691,38 @@ public: longlong val_int(); bool fix_fields(THD *, Item **); void fix_length_and_dec(); + bool compatible_types_scalar_bisection_possible() + { + DBUG_ASSERT(m_comparator.cmp_type() != ROW_RESULT); + return all_items_are_consts(args + 1, arg_count - 1); // Bisection #2 + } + bool compatible_types_row_bisection_possible() + { + DBUG_ASSERT(m_comparator.cmp_type() == ROW_RESULT); + return all_items_are_consts(args + 1, arg_count - 1) && // Bisection #2 + ((is_top_level_item() && !negated) || // Bisection #3 + (!list_contains_null() && !args[0]->maybe_null)); // Bisection #4 + + } + bool agg_all_arg_charsets_for_comparison() + { + return agg_arg_charsets_for_comparison(cmp_collation, args, arg_count); + } + void fix_in_vector(); + bool value_list_convert_const_to_int(THD *thd); + bool fix_for_scalar_comparison_using_bisection(THD *thd) + { + array= m_comparator.type_handler()->make_in_vector(thd, this, arg_count - 1); + if (!array) // OOM + return true; + fix_in_vector(); + return false; + } + bool fix_for_scalar_comparison_using_cmp_items(uint found_types); + + bool fix_for_row_comparison_using_cmp_items(THD *thd); + bool fix_for_row_comparison_using_bisection(THD *thd); + void cleanup() { uint i; @@ -1711,12 +1786,13 @@ public: cmp_item_row(): comparators(0), n(0) {} ~cmp_item_row(); void store_value(Item *item); - inline void alloc_comparators(); + bool alloc_comparators(THD *thd, uint n); + bool prepare_comparators(THD *, Item **args, uint arg_count); int cmp(Item *arg); int compare(cmp_item *arg); cmp_item *make_same(); void store_value_by_template(THD *thd, cmp_item *tmpl, Item *); - friend void Item_func_in::fix_length_and_dec(); + friend class Item_func_in; }; @@ -1728,7 +1804,7 @@ public: ~in_row(); void set(uint pos,Item *item); uchar *get_value(Item *item); - friend void Item_func_in::fix_length_and_dec(); + friend class Item_func_in; Item_result result_type() { return ROW_RESULT; } }; diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 1e6ed4dd3b5..fc34c7cca95 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -32,7 +32,6 @@ static Type_handler_time type_handler_time; static Type_handler_time2 type_handler_time2; static Type_handler_date type_handler_date; static Type_handler_newdate type_handler_newdate; -static Type_handler_datetime type_handler_datetime; static Type_handler_datetime2 type_handler_datetime2; static Type_handler_timestamp type_handler_timestamp; static Type_handler_timestamp2 type_handler_timestamp2; @@ -54,6 +53,7 @@ Type_handler_row type_handler_row; Type_handler_varchar type_handler_varchar; Type_handler_longlong type_handler_longlong; Type_handler_newdecimal type_handler_newdecimal; +Type_handler_datetime type_handler_datetime; /** @@ -1231,3 +1231,143 @@ longlong Type_handler_decimal_result:: } /***************************************************************************/ + +static int srtcmp_in(CHARSET_INFO *cs, const String *x,const String *y) +{ + return cs->coll->strnncollsp(cs, + (uchar *) x->ptr(),x->length(), + (uchar *) y->ptr(),y->length()); +} + +in_vector *Type_handler_string_result::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_string(thd, nargs, (qsort2_cmp) srtcmp_in, + func->compare_collation()); + +} + + +in_vector *Type_handler_int_result::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_longlong(thd, nargs); +} + + +in_vector *Type_handler_real_result::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_double(thd, nargs); +} + + +in_vector *Type_handler_decimal_result::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_decimal(thd, nargs); +} + + +in_vector *Type_handler_time_common::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_time(thd, nargs); +} + + +in_vector * +Type_handler_temporal_with_date::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_datetime(thd, nargs); +} + + +in_vector *Type_handler_row::make_in_vector(THD *thd, + const Item_func_in *func, + uint nargs) const +{ + return new (thd->mem_root) in_row(thd, nargs, 0); +} + +/***************************************************************************/ + +bool Type_handler_string_result:: + Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + if (func->agg_all_arg_charsets_for_comparison()) + return true; + if (func->compatible_types_scalar_bisection_possible()) + { + return func->value_list_convert_const_to_int(thd) || + func->fix_for_scalar_comparison_using_bisection(thd); + } + return + func->fix_for_scalar_comparison_using_cmp_items(1U << (uint) STRING_RESULT); +} + + +bool Type_handler_int_result:: + Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + /* + Does not need to call value_list_convert_const_to_int() + as already handled by int handler. + */ + return func->compatible_types_scalar_bisection_possible() ? + func->fix_for_scalar_comparison_using_bisection(thd) : + func->fix_for_scalar_comparison_using_cmp_items(1U << (uint) INT_RESULT); +} + + +bool Type_handler_real_result:: + Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + return func->compatible_types_scalar_bisection_possible() ? + (func->value_list_convert_const_to_int(thd) || + func->fix_for_scalar_comparison_using_bisection(thd)) : + func->fix_for_scalar_comparison_using_cmp_items(1U << (uint) REAL_RESULT); +} + + +bool Type_handler_decimal_result:: + Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + return func->compatible_types_scalar_bisection_possible() ? + (func->value_list_convert_const_to_int(thd) || + func->fix_for_scalar_comparison_using_bisection(thd)) : + func->fix_for_scalar_comparison_using_cmp_items(1U << (uint) DECIMAL_RESULT); +} + + +bool Type_handler_temporal_result:: + Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + return func->compatible_types_scalar_bisection_possible() ? + (func->value_list_convert_const_to_int(thd) || + func->fix_for_scalar_comparison_using_bisection(thd)) : + func->fix_for_scalar_comparison_using_cmp_items(1U << (uint) TIME_RESULT); +} + + +bool Type_handler_row::Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *func) const +{ + return func->compatible_types_row_bisection_possible() ? + func->fix_for_row_comparison_using_bisection(thd) : + func->fix_for_row_comparison_using_cmp_items(thd); +} + +/***************************************************************************/ diff --git a/sql/sql_type.h b/sql/sql_type.h index 9086e60dc0f..6a694dfe661 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -30,6 +30,8 @@ class Item_sum_hybrid; class Item_func_hex; class Item_func_hybrid_field_type; class Item_func_between; +class Item_func_in; +class in_vector; class Type_std_attributes; class Sort_param; class Arg_comparator; @@ -317,6 +319,13 @@ public: virtual longlong Item_func_between_val_int(Item_func_between *func) const= 0; + + virtual in_vector * + make_in_vector(THD *thd, const Item_func_in *func, uint nargs) const= 0; + + virtual bool + Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *) + const= 0; }; @@ -414,6 +423,9 @@ public: } longlong Item_func_between_val_int(Item_func_between *func) const; + in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; }; @@ -462,6 +474,10 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const; longlong Item_func_between_val_int(Item_func_between *func) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; + }; @@ -495,6 +511,9 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const; longlong Item_func_between_val_int(Item_func_between *func) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; }; @@ -528,6 +547,9 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const; longlong Item_func_between_val_int(Item_func_between *func) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; }; @@ -559,6 +581,8 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const; longlong Item_func_between_val_int(Item_func_between *func) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; }; @@ -594,6 +618,9 @@ public: MYSQL_TIME *, ulonglong fuzzydate) const; longlong Item_func_between_val_int(Item_func_between *func) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; + bool Item_func_in_fix_comparator_compatible_types(THD *thd, + Item_func_in *) const; }; @@ -714,6 +741,7 @@ public: virtual ~Type_handler_time_common() { } enum_field_types field_type() const { return MYSQL_TYPE_TIME; } int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; }; @@ -741,6 +769,7 @@ class Type_handler_temporal_with_date: public Type_handler_temporal_result public: virtual ~Type_handler_temporal_with_date() {} int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; + in_vector *make_in_vector(THD *, const Item_func_in *, uint nargs) const; }; @@ -1014,5 +1043,6 @@ extern Type_handler_null type_handler_null; extern Type_handler_varchar type_handler_varchar; extern Type_handler_longlong type_handler_longlong; extern Type_handler_newdecimal type_handler_newdecimal; +extern Type_handler_datetime type_handler_datetime; #endif /* SQL_TYPE_H_INCLUDED */ From 7d0a8832d86b81d62ea6d69d84d3c9101216bad4 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 17 Dec 2016 21:10:59 +0400 Subject: [PATCH 135/135] MDEV-11558 Split Item_type_holder::display_length into virtual methods in Type_handler --- sql/item.cc | 64 +++---------------------------------------------- sql/item.h | 31 ++++++++++++++++++++++-- sql/sql_type.cc | 31 ++++++++++++++++++++++++ sql/sql_type.h | 22 +++++++++++++++++ 4 files changed, 85 insertions(+), 63 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index c597eec3a45..68dc86083ff 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -10085,12 +10085,12 @@ bool Item_type_holder::join_types(THD *thd, Item *item) if (collation.collation != &my_charset_bin) { max_length= MY_MAX(old_max_chars * collation.collation->mbmaxlen, - display_length(item) / + item->max_display_length() / item->collation.collation->mbmaxlen * collation.collation->mbmaxlen); } else - set_if_bigger(max_length, display_length(item)); + set_if_bigger(max_length, item->max_display_length()); break; } case REAL_RESULT: @@ -10127,7 +10127,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) break; } default: - max_length= MY_MAX(max_length, display_length(item)); + max_length= MY_MAX(max_length, item->max_display_length()); }; maybe_null|= item->maybe_null; get_full_info(item); @@ -10139,64 +10139,6 @@ bool Item_type_holder::join_types(THD *thd, Item *item) DBUG_RETURN(FALSE); } -/** - Calculate lenth for merging result for given Item type. - - @param item Item for length detection - - @return - length -*/ - -uint32 Item_type_holder::display_length(Item *item) -{ - if (item->type() == Item::FIELD_ITEM) - return ((Item_field *)item)->max_disp_length(); - - switch (item->field_type()) - { - case MYSQL_TYPE_DECIMAL: - case MYSQL_TYPE_TIMESTAMP: - case MYSQL_TYPE_DATE: - case MYSQL_TYPE_TIME: - case MYSQL_TYPE_DATETIME: - case MYSQL_TYPE_YEAR: - case MYSQL_TYPE_NEWDATE: - case MYSQL_TYPE_VARCHAR: - case MYSQL_TYPE_BIT: - case MYSQL_TYPE_NEWDECIMAL: - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - case MYSQL_TYPE_GEOMETRY: - return item->max_length; - case MYSQL_TYPE_TINY: - return 4; - case MYSQL_TYPE_SHORT: - return 6; - case MYSQL_TYPE_LONG: - return MY_INT32_NUM_DECIMAL_DIGITS; - case MYSQL_TYPE_FLOAT: - return 25; - case MYSQL_TYPE_DOUBLE: - return 53; - case MYSQL_TYPE_NULL: - return 0; - case MYSQL_TYPE_LONGLONG: - return 20; - case MYSQL_TYPE_INT24: - return 8; - default: - DBUG_ASSERT(0); // we should never go there - return 0; - } -} - /** Make temporary table field according collected information about type diff --git a/sql/item.h b/sql/item.h index 0b60e20e0a0..cf915f74a5e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -721,6 +721,34 @@ public: { return Type_handler::string_type_handler(max_length)->field_type(); } + /* + Calculate the maximum length of an expression. + This method is used in data type aggregation for UNION, e.g.: + SELECT 'b' UNION SELECT COALESCE(double_10_3_field) FROM t1; + + The result is usually equal to max_length, except for some numeric types. + In case of the INT, FLOAT, DOUBLE data types Item::max_length and + Item::decimals are ignored, so the returned value depends only on the + data type itself. E.g. for an expression of the DOUBLE(10,3) data type, + the result is always 53 (length 10 and precision 3 do not matter). + + max_length is ignored for these numeric data types because the length limit + means only "expected maximum length", it is not a hard limit, so it does + not impose any data truncation. E.g. a column of the type INT(4) can + normally store big values up to 2147483647 without truncation. When we're + aggregating such column for UNION it's important to create a long enough + result column, not to lose any data. + + For detailed behaviour of various data types see implementations of + the corresponding Type_handler_xxx::max_display_length(). + + Note, Item_field::max_display_length() overrides this to get + max_display_length() from the underlying field. + */ + virtual uint32 max_display_length() const + { + return type_handler()->max_display_length(this); + } Item_cache* get_cache(THD *thd) const { return type_handler()->Item_get_cache(thd, this); @@ -2459,7 +2487,7 @@ public: Item_equal *find_item_equal(COND_EQUAL *cond_equal); Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *); Item *replace_equal_field(THD *thd, uchar *arg); - inline uint32 max_disp_length() { return field->max_display_length(); } + uint32 max_display_length() const { return field->max_display_length(); } Item_field *field_for_view_update() { return this; } int fix_outer_field(THD *thd, Field **field, Item **reference); virtual Item *update_value_transformer(THD *thd, uchar *select_arg); @@ -5545,7 +5573,6 @@ public: String *val_str(String*); bool join_types(THD *thd, Item *); Field *make_field_by_type(TABLE *table); - static uint32 display_length(Item *item); static enum_field_types get_real_type(Item *); Field::geometry_type get_geometry_type() const { return geometry_type; }; Item* get_copy(THD *thd, MEM_ROOT *mem_root) { return 0; } diff --git a/sql/sql_type.cc b/sql/sql_type.cc index fc34c7cca95..cc87c8e14e4 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -695,6 +695,37 @@ Field *Type_handler_set::make_conversion_table_field(TABLE *table, /*************************************************************************/ +uint32 Type_handler_decimal_result::max_display_length(const Item *item) const +{ + return item->max_length; +} + + +uint32 Type_handler_temporal_result::max_display_length(const Item *item) const +{ + return item->max_length; +} + + +uint32 Type_handler_string_result::max_display_length(const Item *item) const +{ + return item->max_length; +} + + +uint32 Type_handler_year::max_display_length(const Item *item) const +{ + return item->max_length; +} + + +uint32 Type_handler_bit::max_display_length(const Item *item) const +{ + return item->max_length; +} + +/*************************************************************************/ + int Type_handler_time_common::Item_save_in_field(Item *item, Field *field, bool no_conversions) const { diff --git a/sql/sql_type.h b/sql/sql_type.h index 6a694dfe661..d9bc0eb94a2 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -291,6 +291,7 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const= 0; + virtual uint32 max_display_length(const Item *item) const= 0; virtual int Item_save_in_field(Item *item, Field *field, bool no_conversions) const= 0; virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const= 0; @@ -372,6 +373,11 @@ public: { DBUG_ASSERT(0); } + uint32 max_display_length(const Item *item) const + { + DBUG_ASSERT(0); + return 0; + } int Item_save_in_field(Item *item, Field *field, bool no_conversions) const { DBUG_ASSERT(0); @@ -493,6 +499,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + uint32 max_display_length(const Item *item) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; @@ -564,6 +571,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + uint32 max_display_length(const Item *item) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const; @@ -600,6 +608,7 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + uint32 max_display_length(const Item *item) const; int Item_save_in_field(Item *item, Field *field, bool no_conversions) const; Item_cache *Item_get_cache(THD *thd, const Item *item) const; bool set_comparator_func(Arg_comparator *cmp) const; @@ -649,6 +658,7 @@ class Type_handler_tiny: public Type_handler_int_result public: virtual ~Type_handler_tiny() {} enum_field_types field_type() const { return MYSQL_TYPE_TINY; } + uint32 max_display_length(const Item *item) const { return 4; } Field *make_conversion_table_field(TABLE *TABLE, uint metadata, const Field *target) const; }; @@ -659,6 +669,7 @@ class Type_handler_short: public Type_handler_int_result public: virtual ~Type_handler_short() {} enum_field_types field_type() const { return MYSQL_TYPE_SHORT; } + uint32 max_display_length(const Item *item) const { return 6; } Field *make_conversion_table_field(TABLE *TABLE, uint metadata, const Field *target) const; }; @@ -669,6 +680,10 @@ class Type_handler_long: public Type_handler_int_result public: virtual ~Type_handler_long() {} enum_field_types field_type() const { return MYSQL_TYPE_LONG; } + uint32 max_display_length(const Item *item) const + { + return MY_INT32_NUM_DECIMAL_DIGITS; + } Field *make_conversion_table_field(TABLE *TABLE, uint metadata, const Field *target) const; }; @@ -679,6 +694,7 @@ class Type_handler_longlong: public Type_handler_int_result public: virtual ~Type_handler_longlong() {} enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } + uint32 max_display_length(const Item *item) const { return 20; } Field *make_conversion_table_field(TABLE *TABLE, uint metadata, const Field *target) const; }; @@ -689,6 +705,7 @@ class Type_handler_int24: public Type_handler_int_result public: virtual ~Type_handler_int24() {} enum_field_types field_type() const { return MYSQL_TYPE_INT24; } + uint32 max_display_length(const Item *item) const { return 8; } Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; @@ -699,6 +716,7 @@ class Type_handler_year: public Type_handler_int_result public: virtual ~Type_handler_year() {} enum_field_types field_type() const { return MYSQL_TYPE_YEAR; } + uint32 max_display_length(const Item *item) const; Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; @@ -709,6 +727,7 @@ class Type_handler_bit: public Type_handler_int_result public: virtual ~Type_handler_bit() {} enum_field_types field_type() const { return MYSQL_TYPE_BIT; } + uint32 max_display_length(const Item *item) const; Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; @@ -719,6 +738,7 @@ class Type_handler_float: public Type_handler_real_result public: virtual ~Type_handler_float() {} enum_field_types field_type() const { return MYSQL_TYPE_FLOAT; } + uint32 max_display_length(const Item *item) const { return 25; } Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; @@ -730,6 +750,7 @@ class Type_handler_double: public Type_handler_real_result public: virtual ~Type_handler_double() {} enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } + uint32 max_display_length(const Item *item) const { return 53; } Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; }; @@ -860,6 +881,7 @@ class Type_handler_null: public Type_handler_string_result public: virtual ~Type_handler_null() {} enum_field_types field_type() const { return MYSQL_TYPE_NULL; } + uint32 max_display_length(const Item *item) const { return 0; } Field *make_conversion_table_field(TABLE *, uint metadata, const Field *target) const; };