diff --git a/.travis.yml b/.travis.yml index 273491ccc7c..0671841f622 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,25 @@ cache: - apt - ccache +env: + matrix: + - GCC_VERSION=5 + - GCC_VERSION=6 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 + - gcc-6 + - g++-6 - bison - chrpath - cmake @@ -27,9 +43,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,8 +58,14 @@ 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 + - 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; 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 diff --git a/include/json_lib.h b/include/json_lib.h index aabf97ad073..ce7f27317bc 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. */ @@ -93,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; @@ -162,8 +172,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, @@ -285,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 @@ -302,6 +326,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/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/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/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/include/myisamchk.h b/include/myisamchk.h index 64724de1789..643241d84e5 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 @@ -66,6 +58,7 @@ typedef enum MI_STATS_METHOD_IGNORE_NULLS } enum_handler_stats_method; +struct st_myisam_info; typedef struct st_handler_check_param { @@ -122,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/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/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/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations index 49ae741b269..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] @@ -43,3 +47,21 @@ 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-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/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/r/alter_table.result b/mysql-test/r/alter_table.result index f3e41e1b246..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 9f653a17ce8..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) AS (cast("a" as char(10) binary) + 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 f3c1fda1eee..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/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/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 8ab38bf1f35..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.result b/mysql-test/r/create.result index 801a500345e..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)) PERSISTENT, - `cl` char(32) AS (COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1 , 'blue' as char), 2, 'ttt'), i as char)) 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 (convert(cast(n as char), char)) 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/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 e7c40b5ed91..7fefa5754c3 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 @@ -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`) = '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..173fcccb873 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` not 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 36dc23f33be..8902a30934f 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 @@ -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 5ed8e9e8868..ddd2ecdbd95 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 @@ -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` not 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` not 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..e559689fdd0 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` not like 'a ' DROP TABLE t1; # # End of MDEV-8694 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_tis620.result b/mysql-test/r/ctype_tis620.result index fd934600689..3dbccf9ccb0 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` not 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` 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 cade3e4cd75..3d93d7f201e 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` not 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` not 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_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/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 9902a91a2bf..0ac76e91c21 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 @@ -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` not 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` not 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 49a6a331f26..ce6b34fa731 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 @@ -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` not 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` not 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. @@ -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 1d64f847995..fb203cd3141 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(); INSERT IGNORE INTO t1 VALUES(); @@ -998,7 +1003,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(); DROP TABLE t1; @@ -1009,7 +1014,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(); DROP TABLE t1; @@ -1020,21 +1025,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 ( @@ -1044,8 +1049,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); @@ -1062,8 +1067,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: @@ -1080,7 +1085,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); @@ -1109,7 +1114,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; @@ -1121,9 +1126,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; @@ -1135,8 +1140,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); @@ -1150,8 +1155,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; @@ -1163,9 +1168,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; @@ -1177,10 +1182,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; @@ -1191,7 +1196,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; @@ -1200,8 +1205,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; @@ -1216,7 +1221,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; @@ -1229,7 +1234,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; @@ -1241,7 +1246,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; @@ -1255,7 +1260,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; @@ -1267,7 +1272,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; @@ -1279,8 +1284,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; @@ -1291,7 +1296,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; @@ -1330,7 +1335,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; @@ -1343,7 +1348,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; @@ -1356,7 +1361,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; @@ -1370,8 +1375,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; @@ -1384,7 +1389,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; @@ -1396,7 +1401,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; @@ -1409,7 +1414,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; @@ -1423,8 +1428,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; @@ -1437,7 +1442,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; @@ -1450,7 +1455,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; @@ -1464,7 +1469,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; @@ -1478,8 +1483,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; @@ -1491,9 +1496,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; @@ -1506,7 +1511,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; @@ -1518,8 +1523,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; @@ -1532,7 +1537,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; @@ -1544,7 +1549,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; @@ -1556,7 +1561,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; @@ -1572,7 +1577,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; @@ -1585,7 +1590,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; @@ -1597,7 +1602,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; @@ -1609,7 +1614,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; @@ -1621,7 +1626,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; @@ -1633,7 +1638,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; @@ -1645,7 +1650,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; @@ -1657,7 +1662,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; @@ -1669,7 +1674,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; @@ -1681,7 +1686,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; @@ -1693,7 +1698,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; @@ -1705,7 +1710,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; @@ -1717,7 +1722,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; @@ -1729,7 +1734,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; @@ -1741,7 +1746,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; @@ -1753,7 +1758,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; @@ -1765,7 +1770,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; @@ -1777,7 +1782,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; @@ -1789,7 +1794,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; @@ -1801,7 +1806,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; @@ -1813,7 +1818,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; @@ -1825,7 +1830,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; @@ -1837,7 +1842,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; @@ -1850,7 +1855,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; @@ -1863,7 +1868,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; @@ -1876,7 +1881,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; @@ -1892,7 +1897,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; @@ -1905,7 +1910,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); @@ -1920,7 +1925,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); @@ -1935,7 +1940,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); @@ -1950,7 +1955,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); @@ -1964,13 +1969,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; @@ -1982,7 +1987,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; @@ -1994,9 +1999,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); @@ -2011,8 +2016,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; @@ -2025,18 +2030,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; @@ -2049,7 +2054,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; @@ -2062,7 +2067,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; @@ -2075,8 +2080,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); @@ -2091,7 +2096,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; @@ -2106,7 +2111,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; @@ -2120,8 +2125,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: @@ -2135,7 +2140,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: @@ -2150,7 +2155,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; @@ -2167,9 +2172,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; @@ -2184,7 +2189,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; @@ -2197,7 +2202,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; @@ -2210,7 +2215,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; @@ -2223,7 +2228,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; @@ -2236,7 +2241,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; @@ -2249,8 +2254,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; @@ -2265,7 +2270,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; @@ -2277,8 +2282,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; @@ -2290,9 +2295,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; @@ -2304,7 +2309,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; @@ -2317,7 +2322,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; @@ -2330,7 +2335,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; @@ -2342,7 +2347,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; @@ -2354,7 +2359,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; @@ -2366,7 +2371,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; @@ -2378,7 +2383,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; @@ -2390,7 +2395,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; @@ -2402,8 +2407,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; @@ -2415,8 +2420,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; @@ -2428,7 +2433,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; @@ -2440,7 +2445,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; @@ -2453,7 +2458,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; @@ -2468,7 +2473,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; @@ -2480,7 +2485,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; @@ -2492,7 +2497,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; @@ -2504,7 +2509,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; @@ -2516,7 +2521,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; @@ -2529,7 +2534,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; @@ -2543,7 +2548,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; @@ -2557,7 +2562,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; @@ -2584,7 +2589,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: @@ -2603,7 +2608,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; @@ -2618,7 +2623,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; @@ -2633,8 +2638,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; @@ -2648,8 +2653,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; @@ -2663,8 +2668,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 (`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; @@ -2678,8 +2683,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 (`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; @@ -2697,13 +2702,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; @@ -2718,7 +2723,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; @@ -2732,7 +2737,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; @@ -2746,7 +2751,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; @@ -2761,7 +2766,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; @@ -2776,7 +2781,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; @@ -2791,7 +2796,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; @@ -2805,7 +2810,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; @@ -2820,7 +2825,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; @@ -2837,9 +2842,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; @@ -2853,7 +2858,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; @@ -2867,7 +2872,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; @@ -2889,7 +2894,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; @@ -2901,8 +2906,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; @@ -2921,8 +2926,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; @@ -2937,8 +2942,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; @@ -2950,8 +2955,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; @@ -2963,8 +2968,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; @@ -2976,8 +2981,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; @@ -2989,7 +2994,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; @@ -3005,8 +3010,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; @@ -3038,7 +3043,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, @@ -3048,9 +3053,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)); @@ -3059,8 +3064,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; @@ -3221,3 +3226,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/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..7c672c12f03 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", @@ -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/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 5b3ab44c19f..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, @@ -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 # @@ -1900,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/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 9ef7f13487f..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 @@ -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_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_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..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 @@ -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_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_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_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_json.result b/mysql-test/r/func_json.result index ac604b9e09c..a704274a112 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() [] @@ -72,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 @@ -87,6 +93,65 @@ 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('', '', '$') +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 +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('[{"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 @@ -114,6 +179,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" @@ -138,6 +206,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]} @@ -219,6 +290,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] @@ -237,6 +310,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"} @@ -264,6 +339,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') @@ -286,6 +366,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" }'), @@ -322,9 +405,14 @@ 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 +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/r/func_like.result b/mysql-test/r/func_like.result index 9c8e9727d16..0a309bcfab6 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 @@ -254,3 +254,38 @@ 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; +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/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 f6a04c6fb79..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; @@ -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_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 f4b1a39294c..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',@@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(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..0f822456724 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; @@ -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 0f52e793843..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`))) +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`))) +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`))) +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 @@ -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/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 d10cfec6003..ed0d8f540a0 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 # @@ -1840,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; @@ -1853,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; @@ -1865,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; @@ -1877,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; @@ -1889,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; @@ -1902,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; @@ -1914,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; @@ -1926,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; @@ -1939,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; @@ -1951,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; @@ -1963,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; @@ -1975,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; @@ -1987,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; @@ -1999,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; @@ -2011,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; @@ -2023,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; @@ -2036,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; @@ -2048,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; @@ -2060,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; @@ -2072,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; @@ -2084,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; @@ -2096,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; @@ -2108,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; @@ -2120,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; @@ -2132,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; @@ -2144,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; @@ -2157,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; @@ -2170,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; @@ -2183,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..2d6d9f3b632 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; @@ -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 @@ -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/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/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/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/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/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/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/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/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..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) 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/r/mysqldump.result b/mysql-test/r/mysqldump.result index 04612e02b7f..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 */; @@ -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 */; @@ -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 */; @@ -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/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 29243beefa9..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 @@ -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) @@ -260,14 +260,14 @@ 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 -/*!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_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/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_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/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/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/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..823b7601668 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` 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 (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` 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 (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` 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 @@ -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..378fd2d1c6d 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` 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 (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` 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 (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` 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 @@ -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/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/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/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/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/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/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/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..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; @@ -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/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/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/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_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_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 298d0223c69..0df6b2b04c3 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_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_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_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_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 577ae5a34f0..881b57ac1d7 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 @@ -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_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/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 dc9806bb7d1..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; # @@ -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/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 6c2a331d66b..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 @@ -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/r/view.result b/mysql-test/r/view.result index 34b899b3f00..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` < 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) ); 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 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; @@ -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.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} 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/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_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/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; 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 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/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/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/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/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/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/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/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/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..88091ce42a4 --- /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_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_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_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_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_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_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_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (last_insert_id()) virtual); + +--echo # MASTER_POS_WAIT() +-- 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_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_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (row_count()) virtual); + +--echo # SLEEP() +-- 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_GENERATED_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int generated always as (p1()) virtual); +-- 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_GENERATED_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (avg(a)) virtual); + +--echo # BIT_AND() +-- 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_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_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (count(distinct a)) virtual); + +--echo # COUNT() +-- 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_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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (max(a)) virtual); + +--echo # MIN() +-- 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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (std(a)) virtual); + +--echo # STDDEV_POP() +-- 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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (stddev_samp(a)) virtual); + +--echo # STDDEV() +-- 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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (sum(a)) virtual); + +--echo # VAR_POP() +-- 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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int, b int generated always as (var_samp(a)) virtual); + +--echo # VARIANCE() +-- error ER_GENERATED_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_GENERATED_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_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_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..bd84ace62ec --- /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_GENERATED_COLUMN +alter table t1 add constraint foreign key fk(c) references t2(a) on delete set null; +--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_GENERATED_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_GENERATED_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_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; + +--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_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_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_GENERATED_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) +{ +# 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; +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_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_GENERATED_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..4b3431eea2e --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc @@ -0,0 +1,610 @@ +################################################################################ +# 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; +CHECK TABLE 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..7f888ef54a5 --- /dev/null +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -0,0 +1,767 @@ +################################################################################ +# 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; + let $skip_foreign_key_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 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 ER_WRONG_ARGUMENTS + alter table t1 add spatial index (b); + drop table t1; +} + +--echo # FOREIGN KEY + +--echo # Rejected FK options. +--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_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_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_GENERATED_COLUMN +alter table t1 add foreign key (b) references t2(a) on update set null; +--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_GENERATED_COLUMN +alter table t1 add foreign key (b) references t2(a) on delete set null; +drop table t1; + +if(!$skip_foreign_key_check) +{ +--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); +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..f32487d20a1 --- /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_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_GENERATED_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..2b85a2c205a --- /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_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_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/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/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/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..fb6fd544204 --- /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 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 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_blackhole.result b/mysql-test/suite/gcol/r/gcol_blackhole.result new file mode 100644 index 00000000000..3ee4f4e91a4 --- /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 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 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_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..ff7100817f5 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -0,0 +1,577 @@ +# 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, +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; +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: +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, +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; +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, +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; +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: +Note 1265 Data truncated for column 'gcol_time_key' at row 1 +EXPLAIN SELECT +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 . gcol_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . gcol_int_key = p2 . pk ) +) +AND gp1 . col_varchar_nokey = 'b' +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 . 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 . gcol_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . gcol_int_key = p2 . pk ) +) +AND gp1 . col_varchar_nokey = 'b' +HAVING g1 > 6; +g1 +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, +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)) 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, +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'); +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 +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 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 +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, +col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, +col_blob_nokey BLOB, +col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, +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, +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: 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 +# (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 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 +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 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 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 +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); +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:00 +00:00:01 +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#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 21000: Operand should contain 1 column(s) +DROP TABLE t; +CREATE TABLE t(b BLOB, c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL); +ERROR 21000: Operand should contain 1 column(s) +# +# 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` <> 0 or `b` <> 0) VIRTUAL +) 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; +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=MyISAM 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=""; +CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; +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)); +Warnings: +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 +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..37be09b221f --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -0,0 +1,696 @@ +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: 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: 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) 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` ( + `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) 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 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'; +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' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL GENERATED +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) 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 GENERATED +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) 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 STORED GENERATED +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) 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); +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) GENERATED ALWAYS 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 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 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 generated 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) 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 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) 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 STORED GENERATED +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) 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 GENERATED +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) 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 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); +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#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) 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 +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) 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; +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 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 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; +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 +# +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: 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: 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 +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( +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 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 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; +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 generated columns +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; +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 +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#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) GENERATED ALWAYS 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) GENERATED ALWAYS 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, +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: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; +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 +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_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result new file mode 100644 index 00000000000..f6d0830ee3d --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -0,0 +1,696 @@ +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) 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` ( + `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) 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 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'; +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' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +describe t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b int(11) YES NULL VIRTUAL GENERATED +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) 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 GENERATED +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) 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 STORED GENERATED +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) 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); +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) GENERATED ALWAYS 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 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 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 generated 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) 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 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) 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 STORED GENERATED +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) 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 GENERATED +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) 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 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); +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#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) 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 +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) 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; +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 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 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; +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 +# +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 +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( +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 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 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; +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 generated columns +ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) VIRTUAL; +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 +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#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) GENERATED ALWAYS 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) GENERATED ALWAYS 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, +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: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; +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 +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..192016ba8df --- /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 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 +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 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 +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 generated 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 generated 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..b30eb709c47 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result @@ -0,0 +1,678 @@ +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 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 +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 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 +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 generated 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 generated 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#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 +# +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; +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), +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; +# 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(), (), (); +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; +# +# 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); +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; +# +# 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; +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..80605b8b0b2 --- /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) 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 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) 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 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); +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) 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 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) 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 STORED GENERATED +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 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 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 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 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 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 generated 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..a331b1d2154 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -0,0 +1,850 @@ +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) virtual unique); +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, + 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 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) 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 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) 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 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) 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 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); +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) virtual, index (b)); +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, + 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 GENERATED +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 +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `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 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) 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 STORED GENERATED +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; +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 +# 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, +foreign key (b) references t2(a) on update set null); +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 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 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 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 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 generated 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; +# +# 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 GENERATED +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: +# - 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#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 +# +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..b7ce08b6376 --- /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 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 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_merge.result b/mysql-test/suite/gcol/r/gcol_merge.result new file mode 100644 index 00000000000..bffe62655a1 --- /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 generated 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..d0a00b6221e --- /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 generated columns +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 +) 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 generated columns +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 +) 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, + `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) GENERATED ALWAYS 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..1ed96d0345b --- /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 generated columns +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 +) 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 generated columns +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 +) 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (dayofyear(`b`)) STORED, + `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) GENERATED ALWAYS 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..3fe40d1eccd --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_rollback.result @@ -0,0 +1,87 @@ +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); +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 +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); +SELECT * FROM t; +a b c +9 9 10 +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 +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 +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); +SELECT * FROM t; +a b c d +9 10 19 29 +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 new file mode 100644 index 00000000000..24daadb0d5b --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_select_innodb.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 = '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 +Warnings: +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 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..d5e4bdabb38 --- /dev/null +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -0,0 +1,1606 @@ +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; +# +# 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, +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; +# +# 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 +# +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 +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 range idx2 idx2 5 NULL # Using index condition +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) +); +# 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); +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,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 +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 +# +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 +( +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,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 +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 +# +# 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 +( +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,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 +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 +# +# 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). +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,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 +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,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 +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..25e07e450d9 --- /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) GENERATED ALWAYS 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 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); +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 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); +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 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); +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 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); +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 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); +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) 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); +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) 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); +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 GENERATED ALWAYS 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 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); +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) GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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 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); +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) 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); +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 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); +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 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); +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 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); +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 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); +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 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); +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 GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# % +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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (conv(`a`,10,8)) 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 GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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 GENERATED ALWAYS 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) 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); +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) 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); +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) GENERATED ALWAYS 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 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; +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 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); +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 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); +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 GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (conv(`a`,10,2)) 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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; +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS AS (substr(`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) 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); +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) 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); +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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (substr(`a`,2,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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS AS (weight_string(`a`,0,4,65)) 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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS AS (`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 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; +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 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; +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 GENERATED ALWAYS AS (`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) 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; +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 GENERATED ALWAYS AS (`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 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; +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) 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; +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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS 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 GENERATED ALWAYS 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) 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; +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) GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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 GENERATED ALWAYS 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) 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); +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) 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; +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) 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; +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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS 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) GENERATED ALWAYS 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 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; +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 GENERATED ALWAYS AS (`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 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; +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) 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; +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) GENERATED ALWAYS 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 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; +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 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; +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 GENERATED ALWAYS AS (cast(`a` as datetime)) 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 GENERATED ALWAYS AS (`a` + interval 1 minute) 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (week(`a`,3)) 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (yearweek(`a`,0)) 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 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); +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 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); +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) GENERATED ALWAYS 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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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; +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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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..03be01c3229 --- /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) GENERATED ALWAYS 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 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); +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 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); +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 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); +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 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); +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 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); +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) 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); +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) 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); +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 GENERATED ALWAYS 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 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); +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) GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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 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); +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) 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); +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 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); +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 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); +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 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); +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 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); +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 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); +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 GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# % +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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (conv(`a`,10,8)) 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 GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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 GENERATED ALWAYS 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) 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); +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) 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); +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) GENERATED ALWAYS 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 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; +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 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); +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 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); +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 GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (conv(`a`,10,2)) 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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; +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS AS (substr(`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) 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); +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) 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); +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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (substr(`a`,2,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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS AS (weight_string(`a`,0,4,65)) 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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) 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); +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS AS (`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 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; +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 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; +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 GENERATED ALWAYS AS (`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) 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; +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 GENERATED ALWAYS AS (`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 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; +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) 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; +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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS 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 GENERATED ALWAYS 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) 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; +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) GENERATED ALWAYS 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 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); +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 GENERATED ALWAYS 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 GENERATED ALWAYS 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) 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); +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) 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; +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) 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; +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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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 GENERATED ALWAYS 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) GENERATED ALWAYS 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 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; +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 GENERATED ALWAYS AS (`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 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; +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) 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; +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) GENERATED ALWAYS 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 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; +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 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; +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 GENERATED ALWAYS AS (cast(`a` as datetime)) 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 GENERATED ALWAYS AS (`a` + interval 1 minute) 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (week(`a`,3)) 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (yearweek(`a`,0)) 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 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); +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 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); +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) GENERATED ALWAYS 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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) 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; +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) 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; +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +# 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS 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/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..9b55af7af0e --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result @@ -0,0 +1,1564 @@ +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 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 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 +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) 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 +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) 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`) +) 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 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); +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) 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 +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) 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 +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) 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 +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) 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_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, + `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) 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`), + 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) 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, + `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) 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`) +) 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) GENERATED ALWAYS AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `c` int(11) GENERATED ALWAYS 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) GENERATED ALWAYS AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `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 +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) GENERATED ALWAYS AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `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`), + 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) GENERATED ALWAYS AS (`a`) VIRTUAL, + `h` varchar(10) DEFAULT NULL, + `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, + 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 WHERE d > 0; +a b d +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..a80ec95a2ca --- /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) GENERATED ALWAYS 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) GENERATED ALWAYS 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) GENERATED ALWAYS AS (1) VIRTUAL, + `b` int(11) DEFAULT NULL, + `c` int(11) GENERATED ALWAYS 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..e09d52d6dd1 --- /dev/null +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -0,0 +1,160 @@ +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) GENERATED ALWAYS 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) GENERATED ALWAYS 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; +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/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/r/rpl_gcol.result b/mysql-test/suite/gcol/r/rpl_gcol.result new file mode 100644 index 00000000000..a7950b75bd0 --- /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) GENERATED ALWAYS 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..7ca50e62a7b --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -0,0 +1,538 @@ +################################################################################ +# 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, + 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; + +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, + 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; + +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, + 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; + +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 . 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 . gcol_varchar_key AS p1 +FROM bb AS p1 LEFT JOIN bb AS p2 +ON ( p1 . gcol_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, + 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)) 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, + 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, + col_int_key INTEGER GENERATED ALWAYS AS (col_int_nokey + col_int_nokey) VIRTUAL, + col_blob_nokey BLOB, + col_blob_key BLOB GENERATED ALWAYS AS (REPEAT(col_blob_nokey,15)) VIRTUAL, + 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, + 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 ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +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#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_OPERAND_COLUMNS +ALTER TABLE t ADD COLUMN c INT GENERATED ALWAYS AS ((1,1)) VIRTUAL; +DROP TABLE t; +--error ER_OPERAND_COLUMNS +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=""; + +CREATE TABLE t (a INTEGER AS (SUBSTR('','a',1))) engine=innodb; +DROP TABLE t; + +CREATE TABLE t (a INTEGER) engine=innodb; + +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..68931cd0706 --- /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= 1; +--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..6f04ecf3865 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_column_def_options_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# 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= 1; +--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..d54a6ae6f02 --- /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= 1; +--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..9cd89107126 --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_keys_myisam.test @@ -0,0 +1,47 @@ +################################################################################ +# 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= 1; +let $skip_foreign_key_check=1; +--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..8e3ba476ae4 --- /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_GENERATED_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..4cd1fcc46ac --- /dev/null +++ b/mysql-test/suite/gcol/t/gcol_rollback.test @@ -0,0 +1,110 @@ +--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); +--let $shutdown_timeout= 0 +--source include/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; +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/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..e078efbad0c --- /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= 1; +--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/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..4f88fb7f8f6 --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test @@ -0,0 +1,1476 @@ +--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_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; + +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_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_GENERATED_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_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)); + +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 WHERE d > 0; + +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..1e6cd44d0aa --- /dev/null +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test @@ -0,0 +1,194 @@ +--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; + +# +# 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; 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/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/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/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/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index 9837f567954..6fbb7dcc58f 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) 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`) @@ -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) 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`) @@ -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) 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`) @@ -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) 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/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_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/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/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/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_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/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/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/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/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/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 bb99e89b022..ab961222a66 100644 Binary files a/mysql-test/suite/parts/r/partition_char_innodb.result and b/mysql-test/suite/parts/r/partition_char_innodb.result differ diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result index 9936f3ec0f4..09b77cad211 100644 Binary files a/mysql-test/suite/parts/r/partition_char_myisam.result and b/mysql-test/suite/parts/r/partition_char_myisam.result differ diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index 0a5e9775c36..0c7b47edcda 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -7,14 +7,14 @@ 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 -/*!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 @@ -37,11 +37,11 @@ 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 -/*!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..40efba9d984 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -7,14 +7,14 @@ 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 -/*!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 @@ -37,11 +37,11 @@ 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 -/*!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/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/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 a1629b99bb3..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_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index f4648160bbd..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 @@ -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; @@ -675,11 +675,11 @@ 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 -/*!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..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 @@ -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; @@ -675,11 +675,11 @@ 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 -/*!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_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_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_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..4657ed7dde5 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_partition_innodb.result @@ -55,21 +55,21 @@ 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, `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` ( `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,21 +99,21 @@ 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, `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` ( `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 999f36fb47f..1d57c48ad78 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_memory.result +++ b/mysql-test/suite/rpl/r/rpl_partition_memory.result @@ -55,21 +55,21 @@ 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, `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` ( `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,21 +99,21 @@ 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, `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` ( `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 c760befed89..42ad10c8cf1 100644 --- a/mysql-test/suite/rpl/r/rpl_partition_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_partition_myisam.result @@ -55,21 +55,21 @@ 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, `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` ( `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,21 +99,21 @@ 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, `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` ( `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_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/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/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/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/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/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/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/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index d87d52c850a..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 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 MariaDB versions older than 10.0.4 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/mysql-test/suite/vcol/inc/vcol_keys.inc b/mysql-test/suite/vcol/inc/vcol_keys.inc index 6d859a4b0c3..4d4773ec3a6 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; @@ -106,33 +103,35 @@ 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; ---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)); @@ -158,6 +157,27 @@ drop table t1; --echo # - vcol_ins_upd.inc --echo # - vcol_select.inc ---echo # ---echo # TODO: CHECK +# +# Restrictions when indexed: +# +--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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add index (b); +drop table t1; + +--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_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +alter table t1 add index (b); +drop table t1; + +--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_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_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/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/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 f2d6b4105ff..d980c26dfb1 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) 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/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/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/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/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index a20719ad813..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) 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 new file mode 100644 index 00000000000..1dd80ae92b4 --- /dev/null +++ b/mysql-test/suite/vcol/r/update.result @@ -0,0 +1,156 @@ +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; +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; +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; +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; +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 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 +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/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_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result index 0e03d80014d..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` @@ -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` @@ -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..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,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 d60a3cf1a51..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,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_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_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_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/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 5070981f08f..43c911118c2 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -7,38 +7,37 @@ 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 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)); -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 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); -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,40 +49,38 @@ 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 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); -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); @@ -99,31 +96,37 @@ 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, 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: 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)); @@ -147,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 dccdf7f73e5..efca19db5bb 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,38 +123,37 @@ 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 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)); -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 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); -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,40 +165,38 @@ 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 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); -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); @@ -110,27 +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 -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 +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)); @@ -154,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/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 d4a583c34b2..a917159249b 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 MOD 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 (TIMESTAMP(a)) 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 (TIMESTAMP(a)) 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 76482b39d79..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 @@ -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 233f6778ca9..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 @@ -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_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/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index d6d01150e0b..4dee9f4fca6 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -273,16 +273,16 @@ 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 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 2e6dbc38b6f..d6161751fd4 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(atan2(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 (ceil(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 (mod(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 (oct(a)) 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 (power(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)) 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 (bin(a)) 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 (character_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 (instr(a,b)) 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 (lower(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 (mid(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 (a not 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); @@ -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) 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); @@ -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) 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 (position('bar' in 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 rlike '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 (a sounds like 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 (substring(a from 2 for 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 (upper(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 && 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 (binary a) 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 (a is null) 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) 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 || 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 (adddate(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 (date_add(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 (date_sub(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 (date(a)) 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 (datediff(a,'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 (day(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 (subdate(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 (time(a)) 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 (timestamp(a)) 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 (timestampadd(minute,1,a)) 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; @@ -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 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 (weekofyear(a)) 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)) 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); @@ -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() @@ -2629,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 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); @@ -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; # @@ -2658,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; @@ -2673,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; @@ -2688,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; @@ -2703,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; @@ -2718,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; @@ -2733,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; @@ -2748,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; @@ -2763,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; @@ -2778,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; @@ -2793,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) GENERATED ALWAYS AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2808,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; @@ -2823,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; @@ -2838,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; @@ -2853,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; @@ -2868,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; @@ -2883,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; @@ -2898,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 8515d790359..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) 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/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/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/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/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/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/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/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/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test new file mode 100644 index 00000000000..8326afe214f --- /dev/null +++ b/mysql-test/suite/vcol/t/update.test @@ -0,0 +1,112 @@ +# +# 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; +# +# 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; +# +# 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; + +# +# 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; + +# +# 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/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..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; @@ -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/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/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test index e408672ac07..8eeef96b43f 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test +++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test @@ -34,14 +34,14 @@ ##### 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; +let $with_foreign_keys = 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..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 # # # @@ -33,7 +87,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 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 746556eac02..a81f4867add 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; @@ -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 @@ -927,37 +928,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 # @@ -1591,7 +1592,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 # @@ -1719,7 +1720,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, @@ -1972,3 +1973,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/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/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/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/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 2b4385a43b9..a1d3d819adf 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); @@ -29,12 +30,32 @@ 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"'); 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('[{"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]"); @@ -45,6 +66,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"); @@ -54,6 +76,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); @@ -110,6 +133,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'); @@ -119,6 +143,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" }'), @@ -138,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/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index d1b9b170a3b..b65bff63298 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -185,3 +185,25 @@ 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; + +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/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/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/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/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/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/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); 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/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 6fc500e8d56..480fcfb9287 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) @@ -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; } @@ -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; } } @@ -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 @@ -8566,14 +8565,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; } @@ -9934,42 +9931,39 @@ 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); + ret= vcol->expr->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); + my_error(ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, + vcol_type_name(type), name); return TRUE; } /* 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; } @@ -9985,22 +9979,21 @@ 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, "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)) + Item *def_expr= default_value->expr; + if (check_expression(default_value, field_name, VCOL_DEFAULT)) DBUG_RETURN(TRUE); /* Constant's are stored in the 'empty_record', except for blobs */ @@ -10024,15 +10017,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)) { @@ -10721,8 +10714,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; @@ -10732,9 +10725,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_str.str= pos; - default_value->expr_str.length= res->length(); - default_value->expr_item= + default_value->expr= new (thd->mem_root) Item_string(thd, pos, res->length(), charset); default_value->utf8= 0; } @@ -10798,7 +10789,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 54617da1b6f..7410288fa48 100644 --- a/sql/field.h +++ b/sql/field.h @@ -546,6 +546,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, @@ -585,23 +607,20 @@ 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; + 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) { - expr_str.str= name.str= NULL; + name.str= NULL; name.length= 0; }; ~Virtual_column_info() {} - enum_field_types get_real_type() + enum_field_types get_real_type() const { return field_type; } @@ -610,7 +629,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; } @@ -618,7 +637,7 @@ public: { stored_in_db= stored; } - bool is_in_partitioning_expr() + bool is_in_partitioning_expr() const { return in_partitioning_expr; } @@ -626,13 +645,8 @@ public: { in_partitioning_expr= TRUE; } - bool is_equal(Virtual_column_info* vcol) - { - 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 @@ -695,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, @@ -914,7 +932,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; } /* @@ -934,14 +957,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, @@ -1169,6 +1184,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*); @@ -1259,7 +1279,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); } @@ -1391,7 +1411,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; } @@ -1700,7 +1720,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); @@ -2774,7 +2794,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); @@ -3202,7 +3226,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()); } @@ -3259,30 +3284,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); @@ -3296,8 +3320,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(); @@ -3313,7 +3336,10 @@ 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)); } + 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; } @@ -3842,8 +3868,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, @@ -3864,6 +3889,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; + } }; @@ -3960,8 +3991,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 @@ -3978,19 +4009,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 */ @@ -4006,10 +4031,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/filesort.cc b/sql/filesort.cc index 3c0a8ffffbd..c77304eba7c 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) - update_virtual_fields(thd, sort_form); 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) - update_virtual_fields(thd, sort_form); if (!flag) { my_store_ptr(ref_pos,ref_length,record); // Position to row @@ -1277,7 +1273,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/ha_partition.cc b/sql/ha_partition.cc index 400ca6129d6..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= @@ -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); } } @@ -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.cc b/sql/handler.cc index ede0bfad5ce..37e60f5c9bd 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; } @@ -4210,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 c1f6cb5b162..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 @@ -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 @@ -1845,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 @@ -1880,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. @@ -2951,7 +2971,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 @@ -3871,18 +3890,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; } diff --git a/sql/item.cc b/sql/item.cc index a1c3f131fa3..68dc86083ff 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); @@ -901,17 +919,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->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; } /* @@ -950,7 +966,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 @@ -958,6 +975,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 @@ -967,11 +985,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) || @@ -987,6 +1012,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->walk(&Item::update_vcol_processor, 0, arg); + field->vcol_info->expr->save_in_field(field, 0); + } + return 0; +} + bool Item::check_cols(uint c) { @@ -2619,16 +2656,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); @@ -2636,43 +2707,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 */ @@ -5548,6 +5594,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() { @@ -8622,7 +8676,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; @@ -9325,6 +9379,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) @@ -9480,6 +9545,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) @@ -9528,6 +9610,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) @@ -9579,6 +9673,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) @@ -9658,6 +9765,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; @@ -9958,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: @@ -10000,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); @@ -10012,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 @@ -10396,3 +10465,14 @@ void Item::register_in(THD *thd) next= thd->free_list; thd->free_list= this; } + +void Virtual_column_info::print(String *str) +{ + 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), + LOWEST_PRECEDENCE); +} diff --git a/sql/item.h b/sql/item.h index 6651fee421e..cf915f74a5e 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; @@ -697,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); @@ -1103,13 +1155,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, @@ -1362,67 +1414,41 @@ 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; } + /*========= 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 @@ -1474,21 +1500,40 @@ 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; } + 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 + 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; + + 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 *) { @@ -1500,42 +1545,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; @@ -1545,31 +1557,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 @@ -2436,7 +2423,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); /* @@ -2484,12 +2470,15 @@ 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); bool switch_to_nullable_fields_processor(void *arg); + 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(); @@ -2498,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); @@ -3255,9 +3244,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); } }; @@ -5003,6 +4994,8 @@ 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) { @@ -5082,6 +5075,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); @@ -5302,15 +5296,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); } }; @@ -5331,6 +5324,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); } }; @@ -5357,6 +5351,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); } }; @@ -5375,6 +5370,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); } }; @@ -5393,6 +5389,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); } }; @@ -5421,6 +5418,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); } }; @@ -5575,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; } @@ -5691,5 +5688,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->eq(vcol->expr, true); +} #endif /* SQL_ITEM_INCLUDED */ diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 61c5f5bffbb..da76f26dc03 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -288,20 +288,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()); } /** @@ -1193,8 +1183,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 ")); @@ -1202,7 +1191,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(')'); } @@ -2252,15 +2240,13 @@ longlong Item_func_between::val_int_cmp_real() 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()); } @@ -3313,27 +3299,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")); } @@ -4329,13 +4315,12 @@ bool Item_func_in::fix_for_row_comparison_using_cmp_items(THD *thd) 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(")")); } @@ -4853,19 +4838,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(')'); } @@ -5057,6 +5040,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); @@ -5094,9 +5084,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")); } @@ -5106,6 +5095,22 @@ bool Item_bool_func2::count_sargable_conds(void *arg) return 0; } +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()); + if (escape_used_in_parsing) + { + str->append(STRING_WITH_LEN(" escape ")); + escape_item->print(str, query_type); + } +} + longlong Item_func_like::val_int() { @@ -5124,11 +5129,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; } @@ -5138,6 +5143,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 6a59754623a..9749dabb88b 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -224,6 +224,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): @@ -489,6 +490,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) @@ -544,6 +546,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(); @@ -568,6 +571,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); @@ -848,7 +852,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) @@ -878,6 +881,7 @@ public: } 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); @@ -1590,6 +1594,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; } @@ -1754,7 +1759,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); @@ -1846,6 +1852,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() { @@ -1907,10 +1915,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); } @@ -1938,6 +1947,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; @@ -1958,13 +1968,10 @@ 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) - { - 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 @@ -2044,6 +2051,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() { @@ -2052,6 +2060,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) @@ -2161,10 +2175,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); } @@ -2575,6 +2590,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); @@ -2610,6 +2626,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_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); } diff --git a/sql/item_func.cc b/sql/item_func.cc index 90bec7bc62e..6b69d81aba7 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()); } @@ -968,6 +966,7 @@ double Item_func_hybrid_field_type::val_real_from_date_op() 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; @@ -4706,7 +4705,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; } @@ -5204,11 +5203,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()); } @@ -5218,8 +5216,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) @@ -5588,9 +5585,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(')'); } @@ -5800,7 +5796,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/item_func.h b/sql/item_func.h index 2ec329783e8..dbe23e372e3 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -815,6 +815,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 *); @@ -828,6 +829,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 *); @@ -843,6 +845,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 *); @@ -863,6 +866,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) @@ -877,9 +881,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); } @@ -900,6 +904,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;} @@ -918,6 +923,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;} @@ -1438,6 +1449,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); } }; @@ -1448,6 +1460,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); } }; @@ -1469,6 +1482,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); } }; @@ -1479,6 +1493,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); } }; @@ -1489,10 +1504,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); } @@ -2002,7 +2018,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, @@ -2240,6 +2257,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_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); } }; diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 829a547bb07..42570984e8d 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()); @@ -476,9 +599,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 +609,6 @@ String *Item_func_json_extract::val_str(String *str) */ first_value= (const char *) value; first_len= v_len; - continue; } else { @@ -500,20 +619,24 @@ 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. */ - null_value= 1; - return 0; + goto return_null; } if (multiple_values_found ? @@ -524,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; @@ -595,39 +720,165 @@ 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) + { + 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 || + (c_level && json_skip_to_level(js, c_level))) + 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; @@ -647,56 +898,55 @@ 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())) - goto error; - c_path->parsed= c_path->constant; + 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 return_null; - if (args[n_arg]->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.cur_step= path.p.steps; + if (json_find_path(&je, &path.p, &path.cur_step, array_counters)) { - /* Path wasn't found. */ if (je.s.error) + { + ve.s.error= 0; goto error; - continue; - } + } - if (json_read_value(&je)) - 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; + return FALSE; + } } + 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)) + goto error; + + result= check_contains(&je, &ve); + if (je.s.error || ve.s.error) + goto error; + + 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; } @@ -730,7 +980,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) @@ -739,12 +989,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; } @@ -762,8 +1020,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++) @@ -776,12 +1034,15 @@ longlong Item_func_json_contains_path::val_int() 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-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()); @@ -791,7 +1052,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) { @@ -809,7 +1070,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; } @@ -907,7 +1170,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++) @@ -967,16 +1230,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()); @@ -986,33 +1249,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 @@ -1026,7 +1289,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 @@ -1039,7 +1302,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. */ @@ -1058,7 +1321,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; } @@ -1086,16 +1352,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()); @@ -1105,59 +1378,65 @@ 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; 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) + goto js_error; + 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 error; /* 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. */ @@ -1176,8 +1455,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; } @@ -1220,17 +1500,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()); @@ -1287,6 +1567,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; } @@ -1311,13 +1596,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; } @@ -1340,6 +1624,7 @@ longlong Item_func_json_depth::val_int() switch (je.state) { case JST_VALUE: + case JST_KEY: if (inc_depth) { c_depth++; @@ -1363,13 +1648,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; } @@ -1423,6 +1707,7 @@ String *Item_func_json_type::val_str(String *str) return str; error: + report_json_error(js, &je, 0); null_value= 1; return 0; } @@ -1473,10 +1758,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--; @@ -1484,10 +1772,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()); @@ -1498,14 +1783,14 @@ 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) + if (lp->type & JSON_PATH_ARRAY) { uint n_item= 0; @@ -1519,12 +1804,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) || @@ -1532,7 +1817,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; } @@ -1546,7 +1831,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; @@ -1554,7 +1839,7 @@ String *Item_func_json_insert::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; if (!mode_insert) continue; @@ -1565,7 +1850,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*/ { @@ -1581,7 +1866,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; @@ -1589,7 +1874,7 @@ String *Item_func_json_insert::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; if (!mode_insert) continue; @@ -1602,7 +1887,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; @@ -1613,20 +1898,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. */ @@ -1645,7 +1930,9 @@ continue_point: return js; -error: +js_error: + report_json_error(js, &je, 0); +return_null: null_value= 1; return 0; } @@ -1688,10 +1975,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--; @@ -1701,10 +1991,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()); @@ -1714,14 +2001,14 @@ 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) + if (lp->type & JSON_PATH_ARRAY) { if (je.value_type != JSON_VALUE_ARRAY) continue; @@ -1739,7 +2026,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; @@ -1747,7 +2034,7 @@ String *Item_func_json_remove::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; continue; } @@ -1768,7 +2055,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++; @@ -1779,7 +2066,7 @@ String *Item_func_json_remove::val_str(String *str) } if (je.s.error) - goto error; + goto js_error; continue; } @@ -1787,7 +2074,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); @@ -1796,7 +2083,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. */ @@ -1815,8 +2102,9 @@ v_found: return js; +js_error: + report_json_error(js, &je, 0); null_return: -error: null_value= 1; return 0; } @@ -1851,9 +2139,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; } @@ -1917,8 +2208,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; } @@ -1981,7 +2273,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)) @@ -2003,34 +2295,43 @@ static int append_json_path(String *str, const json_path_t *p) 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; + const json_path_step_t *sa= a->steps + 1; + const json_path_step_t *sb= b->steps + 1; - if (a_len > b_len) + if (a->last_step - sa > b->last_step - sb) return -2; - for (i=0; i <= a_len; i++) + while (sa <= a->last_step) { - const json_path_step_t *sa= a->steps + i; - const json_path_step_t *sb= b->steps + i; - - if (sa->type != sb->type) - return -1; + if (sb > b->last_step) + return -2; - if (sa->type == JSON_PATH_ARRAY) + if (!((sa->type & sb->type) & JSON_PATH_KEY_OR_ARRAY)) + goto step_failed; + + if (sa->type & JSON_PATH_ARRAY) { - if (!sa->wild && sa->n_item != sb->n_item) - return -1; + if (!(sa->type & JSON_PATH_WILD) && sa->n_item != sb->n_item) + goto step_failed; } 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; + goto step_failed; } + sb++; + sa++; + continue; + +step_failed: + if (!(sa->type & JSON_PATH_DOUBLE_WILD)) + return -1; + sb++; } - return b_len > a_len; + return sb <= b->last_step; } @@ -2057,10 +2358,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; @@ -2076,7 +2374,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) @@ -2087,8 +2388,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 @@ -2100,12 +2400,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)) && @@ -2123,36 +2423,30 @@ 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) 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: @@ -2161,7 +2455,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) @@ -2169,20 +2463,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/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/sql/item_strfunc.cc b/sql/item_strfunc.cc index 556683a0a4c..81557787c36 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) @@ -3621,6 +3619,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_from_val_real(String *str) { ulonglong dec; @@ -4716,7 +4729,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); diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index abe08728f08..50258c84daa 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1187,6 +1187,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() @@ -1270,6 +1271,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); } }; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8f9bd917b75..2fe325dbe85 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -6188,7 +6188,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 8928648064b..74c03575272 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -1231,10 +1231,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/item_timefunc.cc b/sql/item_timefunc.cc index 5e0ae028d88..27ce83f3f2b 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); } @@ -1649,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 || @@ -1702,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. @@ -2179,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) @@ -2334,7 +2352,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 4502796686f..ad92f50661b 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) { @@ -334,6 +325,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 +335,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); } }; @@ -655,6 +657,7 @@ public: { return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } + void print(String *str, enum_query_type query_type); }; @@ -740,6 +743,7 @@ public: */ return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } + void print(String *str, enum_query_type query_type); }; @@ -747,7 +751,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) @@ -916,6 +920,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); } @@ -983,7 +988,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/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/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/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/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/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); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 39df7b8d288..461a2107437 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/partition_info.cc b/sql/partition_info.cc index 6eac6dba68b..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. @@ -560,42 +326,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' @@ -2203,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 99a71fea798..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(); @@ -344,51 +335,12 @@ 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); 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); @@ -400,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/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; } diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 8f81d23816e..aa11b55da0d 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 @@ -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 @@ -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/sql/sp_head.cc b/sql/sp_head.cc index 0cbbc9a994a..441de33b776 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -4165,7 +4165,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))) @@ -4174,32 +4174,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, true, belong_to_view, stab->trg_event_map, + query_tables_last_ptr); tab_buff+= ALIGN_SIZE(sizeof(TABLE_LIST)); result= TRUE; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e1d788ba367..1ca7e9c1574 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))) @@ -4143,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: @@ -4182,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; @@ -5033,7 +5092,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); @@ -6382,7 +6440,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) { @@ -6390,7 +6447,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) @@ -7485,7 +7541,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) { @@ -7505,7 +7560,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++; } } @@ -7773,7 +7827,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"); @@ -7799,8 +7852,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++)) { @@ -7833,8 +7884,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 && @@ -7842,10 +7891,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 && - update_virtual_fields(thd, vcol_table, - vcol_table->triggers ? VCOL_UPDATE_ALL : - 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; @@ -7903,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]); } } @@ -7996,9 +8043,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= table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); } } } @@ -8091,9 +8136,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)) + table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= abort_on_warning_saved; DBUG_RETURN(thd->is_error()); @@ -8147,10 +8190,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= table->update_virtual_fields(VCOL_UPDATE_FOR_WRITE); } return result; diff --git a/sql/sql_base.h b/sql/sql_base.h index bdfbe400e54..8f363a73863 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 */ @@ -331,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_class.cc b/sql/sql_class.cc index 80faca6bfec..6dbb8acdc65 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 @@ -540,13 +361,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" @@ -975,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; @@ -4562,6 +4384,94 @@ 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; + thd->security_ctx->host_or_ip=""; + 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()); @@ -5832,7 +5742,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/sql_class.h b/sql/sql_class.h index 0434f5485cf..f2e6f131f5f 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 { @@ -352,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; @@ -1530,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 * @@ -1991,14 +2084,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: @@ -4455,6 +4548,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 +5397,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(); }; @@ -5316,6 +5410,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; @@ -5349,16 +5444,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 4f9afca2f6d..e9a3be30060 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); + 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) @@ -926,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) @@ -955,7 +962,6 @@ multi_delete::initialize_tables(JOIN *join) } } - walk= delete_tables; for (JOIN_TAB *tab= first_linear_tab(join, WITHOUT_BUSH_ROOTS, @@ -979,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_handler.cc b/sql/sql_handler.cc index 405e7ce8c38..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) - update_virtual_fields(thd, table); if (cond && !cond->val_int()) { if (thd->is_error()) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 7c0c1b68a2b..9c21cb74802 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. @@ -950,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) @@ -1184,7 +1184,6 @@ values_loop_end: thd->lex->current_select->save_leaf_tables(thd); thd->lex->current_select->first_cond_optimization= 0; } - DBUG_RETURN(FALSE); abort: @@ -1518,8 +1517,6 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, if (!table) table= table_list->table; - if (table->s->virtual_stored_fields) - thd->lex->unit.insert_table_with_stored_vcol= table; if (!select_insert) { @@ -1696,6 +1693,15 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) HA_READ_KEY_EXACT)))) goto err; } + 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) { int res= 0; @@ -1855,6 +1861,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 */ } } @@ -1905,6 +1912,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: @@ -1916,6 +1924,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); } @@ -2339,6 +2348,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= NULL; \ + } /** As we can't let many client threads modify the same TABLE @@ -2360,7 +2375,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; @@ -2423,14 +2437,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; @@ -2449,9 +2455,17 @@ 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; + /* Ensure we don't use the table list of the original table */ copy->pos_in_table_list= 0; @@ -2466,12 +2480,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; } @@ -2484,42 +2500,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); @@ -3123,12 +3106,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) { - uchar *str; - ((Field_blob *) (*ptr))->get_ptr(&str); - my_free(str); - ((Field_blob *) (*ptr))->reset(); + if (f->vcol_info) + f->free(); + else + my_free(f->get_ptr()); + f->reset(); } } } @@ -3150,6 +3135,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)) @@ -3256,6 +3244,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 @@ -3362,6 +3352,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); @@ -3370,6 +3362,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())) @@ -3617,6 +3611,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 && @@ -4021,7 +4020,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, "", ""); 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_join_cache.cc b/sql/sql_join_cache.cc index d5883b1304e..b9d7f660a5a 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(); } } } @@ -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) - update_virtual_fields(thd, table); } 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) - update_virtual_fields(thd, table); } } @@ -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) - update_virtual_fields(join->thd, join_tab->table); } return rc; } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 19e7668790e..45a6bf59b99 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; @@ -2075,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; @@ -4122,7 +4120,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); - tab->merge_keys.clear_all(); + /* + 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_lex.h b/sql/sql_lex.h index 9fc27fa4d5f..edcbf1cb51b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -683,13 +683,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(); @@ -2683,8 +2676,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_load.cc b/sql/sql_load.cc index b1167534491..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->virtual_stored_fields) - thd->lex->unit.insert_table_with_stored_vcol= table; uint tot_length=0; bool use_blobs= 0, use_vars= 0; @@ -539,6 +537,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, @@ -881,7 +885,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_parse.cc b/sql/sql_parse.cc index a2a4ed2b77e..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 @@ -4167,7 +4158,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 +4166,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_partition.cc b/sql/sql_partition.cc index a2bc5000ec6..972ab3aa1f1 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); @@ -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"; @@ -3787,9 +3788,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 +3834,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 +3883,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 +3936,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 +3971,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 +7212,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/sql_select.cc b/sql/sql_select.cc index 168e0af5d38..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) { @@ -1926,7 +1927,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 @@ -7490,7 +7491,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; @@ -16338,7 +16339,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; @@ -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()) { @@ -18443,9 +18443,6 @@ 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); - if (select_cond) { select_cond_result= MY_TEST(select_cond->val_int()); @@ -18896,8 +18893,6 @@ join_read_system(JOIN_TAB *tab) empty_record(table); // Make empty record return -1; } - if (table->vfield) - update_virtual_fields(tab->join->thd, table); store_record(table,record[1]); } else if (!table->status) // Only happens with left join @@ -18943,8 +18938,6 @@ join_read_const(JOIN_TAB *tab) return report_error(table, error); return -1; } - if (table->vfield) - update_virtual_fields(tab->join->thd, table); store_record(table,record[1]); } else if (!(table->status & ~STATUS_NULL_ROW)) // Only happens with left join diff --git a/sql/sql_show.cc b/sql/sql_show.cc index de284cbe39d..0a2dab91c14 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,56 +1659,47 @@ 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) { - if (field->default_value->expr_item->need_parentheses_in_default()) + field->default_value->print(&str); + if (field->default_value->expr->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()); else - def_value->move(def_val); + def_value->append(def_val); } else if (quoted) def_value->set(STRING_WITH_LEN("''"), system_charset_info); @@ -1918,13 +1911,13 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, if (field->vcol_info) { - 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); + StringBuffer str(&my_charset_utf8mb4_general_ci); + field->vcol_info->print(&str); + 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")); } @@ -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(")")); } } @@ -2232,7 +2225,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 +2234,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); } @@ -5516,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)) @@ -7366,6 +7358,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) @@ -7410,10 +7403,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); } @@ -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_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) diff --git a/sql/sql_string.cc b/sql/sql_string.cc index fd0baaec89c..b12f0332035 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -788,7 +788,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 bbb384a6179..8062e2d465d 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -469,10 +469,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); @@ -590,6 +588,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 ad0e9152741..f10df953d7d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2510,8 +2510,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"); @@ -2523,12 +2522,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; } @@ -2858,15 +2854,13 @@ bool Column_definition::prepare_create_field(uint *blob_columns, if (charset->state & MY_CS_BINSORT) pack_flag|= FIELDFLAG_BINARY; length= 8; // Unireg field length - unireg_check= Field::BLOB_FIELD; (*blob_columns)++; break; case MYSQL_TYPE_GEOMETRY: #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(true); } pack_flag= FIELDFLAG_GEOM | @@ -2874,12 +2868,11 @@ bool Column_definition::prepare_create_field(uint *blob_columns, if (charset->state & MY_CS_BINSORT) pack_flag|= FIELDFLAG_BINARY; length= 8; // Unireg field length - unireg_check= Field::BLOB_FIELD; (*blob_columns)++; break; #else - my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0), - sym_group_geom.name, sym_group_geom.needed_define); + my_error(ER_FEATURE_DISABLED, MYF(0), + sym_group_geom.name, sym_group_geom.needed_define); DBUG_RETURN(true); #endif /*HAVE_SPATIAL*/ case MYSQL_TYPE_VARCHAR: @@ -2891,9 +2884,8 @@ bool Column_definition::prepare_create_field(uint *blob_columns, pack_length= calc_pack_length(sql_type, (uint) length); if ((length / charset->mbmaxlen) > MAX_FIELD_CHARLENGTH) { - my_printf_error(ER_TOO_BIG_FIELDLENGTH, ER(ER_TOO_BIG_FIELDLENGTH), - MYF(0), field_name, - static_cast(MAX_FIELD_CHARLENGTH)); + my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), field_name, + static_cast(MAX_FIELD_CHARLENGTH)); DBUG_RETURN(true); } } @@ -2908,7 +2900,6 @@ bool Column_definition::prepare_create_field(uint *blob_columns, pack_flag= pack_length_to_packflag(pack_length) | FIELDFLAG_INTERVAL; if (charset->state & MY_CS_BINSORT) pack_flag|= FIELDFLAG_BINARY; - unireg_check= Field::INTERVAL_FIELD; if (check_duplicates_in_interval("ENUM", field_name, interval, charset, &dup_val_count)) DBUG_RETURN(true); @@ -2917,7 +2908,6 @@ bool Column_definition::prepare_create_field(uint *blob_columns, pack_flag= pack_length_to_packflag(pack_length) | FIELDFLAG_BITFIELD; if (charset->state & MY_CS_BINSORT) pack_flag|= FIELDFLAG_BINARY; - unireg_check= Field::BIT_FIELD; if (check_duplicates_in_interval("SET", field_name, interval, charset, &dup_val_count)) DBUG_RETURN(true); @@ -3231,53 +3221,14 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (sql_field->prepare_blob_field(thd)) 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. 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 || @@ -3288,7 +3239,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 */ @@ -3296,16 +3247,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 */ { @@ -3731,9 +3682,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); } } @@ -3809,16 +3758,21 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } #endif - if (!sql_field->stored_in_db()) + if (sql_field->vcol_info) { - /* 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)); - DBUG_RETURN(TRUE); + if (key->type == Key::PRIMARY) + { + my_error(ER_PRIMARY_KEY_BASED_ON_GENERATED_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)) { @@ -4104,11 +4058,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); } } @@ -6167,11 +6120,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 @@ -6219,7 +6167,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. @@ -6233,20 +6181,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) @@ -6261,7 +6212,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); @@ -6306,21 +6262,59 @@ 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; } - /* - 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 (field->vcol_info || new_field->vcol_info) { - if (is_equal == IS_EQUAL_NO || - !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; + /* 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) + { + bool value_changes= is_equal == IS_EQUAL_NO; + 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; + 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. The check is kind of expensive, so don't + do it if ALTER_COLUMN_VCOL is already set. + */ + if (field->vcol_info->expr->walk( + &Item::check_func_default_processor, 0, 0)) + { + 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; + } + } + else /* base <-> stored */ + ha_alter_info->handler_flags|= + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE; } /* Check if field was renamed */ @@ -6353,8 +6347,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()) @@ -6377,27 +6381,28 @@ 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; } } 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 - | 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; } @@ -6406,17 +6411,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; } } @@ -7491,7 +7496,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) @@ -9669,8 +9674,6 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, error= 1; break; } - if (from->vfield) - update_virtual_fields(thd, from); if (++thd->progress.counter >= time_to_report_progress) { time_to_report_progress+= MY_HOW_OFTEN_TO_WRITE/10; @@ -9700,7 +9703,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_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. 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; }; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b452e4fe6ae..1f1af7f2660 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; @@ -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; @@ -619,9 +620,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); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || (error= select->skip_record(thd)) > 0) { @@ -726,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 @@ -738,9 +739,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); + table->update_virtual_fields(VCOL_UPDATE_FOR_READ_WRITE); thd->inc_examined_row_count(1); if (!select || select->skip_record(thd) > 0) { @@ -749,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 */ @@ -908,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; @@ -1756,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++) @@ -1788,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]; @@ -1804,6 +1811,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 @@ -1920,12 +1942,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(); /* @@ -2056,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) @@ -2101,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, @@ -2318,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++) @@ -2387,8 +2412,13 @@ 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; + 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; @@ -2411,8 +2441,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))) + 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/sql_yacc.yy b/sql/sql_yacc.yy index f2b3036c140..f826dbb8dd5 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); } @@ -862,28 +861,15 @@ 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->expr= expr; v->utf8= 0; /* connection charset */ return v; } @@ -953,7 +939,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; @@ -1634,7 +1620,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 */ @@ -1713,7 +1699,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 @@ -1957,7 +1943,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 @@ -2583,7 +2569,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)) @@ -2626,7 +2612,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; @@ -6069,10 +6055,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; @@ -6183,7 +6169,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 @@ -6191,7 +6177,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; } ; @@ -6213,10 +6205,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; @@ -6229,19 +6221,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); } @@ -6825,19 +6811,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 @@ -6857,11 +6843,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: @@ -7237,7 +7223,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); @@ -8190,7 +8176,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; } @@ -8696,12 +8682,6 @@ remember_tok_start: } ; -remember_cur_pos: - { - $$= (char*) YYLIP->get_cpp_ptr(); - } - ; - remember_name: { $$= (char*) YYLIP->get_cpp_tok_start(); @@ -8964,8 +8944,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 { @@ -8979,8 +8958,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 { @@ -9005,9 +8983,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 { @@ -9604,7 +9580,7 @@ function_call_keyword: if ($$ == NULL) MYSQL_YYABORT; } - | USER '(' ')' + | USER_SYM '(' ')' { $$= new (thd->mem_root) Item_func_user(thd); if ($$ == NULL) @@ -9970,15 +9946,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; } @@ -12147,7 +12115,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); } @@ -12997,14 +12965,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; @@ -13450,7 +13418,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; @@ -14870,7 +14838,7 @@ keyword_sp: | UNDOFILE_SYM {} | UNKNOWN_SYM {} | UNTIL_SYM {} - | USER {} + | USER_SYM {} | USE_FRM {} | VARIABLES {} | VIEW_SYM {} @@ -15775,7 +15743,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; } 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 2aaf25c1e8d..0d1286695cd 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 *, String *, 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")}; @@ -932,7 +935,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) @@ -957,6 +960,187 @@ 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 ; 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+ + 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) +{ + 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; + sql_mode_t saved_mode= thd->variables.sql_mode; + Query_arena backup_arena; + Virtual_column_info *vcol; + StringBuffer expr_str; + bool res= 1; + 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*)); + + 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); + thd->variables.sql_mode &= ~MODE_NO_BACKSLASH_ESCAPES; + + 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); + goto end; + } + 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 + } + + 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, &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, &expr_str, + &((*field_ptr)->default_value), + error_reported); + *(dfield_ptr++)= *field_ptr; + break; + case VCOL_CHECK_FIELD: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + &((*field_ptr)->check_constraint), + error_reported); + *check_constraint_ptr++= (*field_ptr)->check_constraint; + break; + case VCOL_CHECK_TABLE: + vcol= unpack_vcol_info_from_frm(thd, mem_root, table, &expr_str, + check_constraint_ptr, error_reported); + check_constraint_ptr++; + break; + } + if (!vcol) + goto end; + 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()) + { + 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); + *(dfield_ptr++)= *field_ptr; + if (!field->default_value->expr) + goto end; + } + 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)) + goto end; + } + + 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); + thd->variables.sql_mode= saved_mode; + DBUG_RETURN(res); +} + /** Read data from a binary .frm file image into a TABLE_SHARE @@ -982,7 +1166,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 +1583,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))) @@ -1454,6 +1636,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); @@ -1537,8 +1722,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++) @@ -1633,18 +1817,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= (bool) (uint) 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->stored_in_db= vcol_screen_pos[3]; vcol_info->utf8= 0; vcol_screen_pos+= vcol_info_length + MYSQL57_GCOL_HEADER_SIZE;; share->virtual_fields++; @@ -1659,8 +1845,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) */ @@ -1672,20 +1857,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= (bool) (uint) 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++; } @@ -1726,7 +1902,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) { @@ -1770,11 +1946,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, @@ -1784,17 +1955,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++; } @@ -1816,11 +1981,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)) @@ -2171,6 +2340,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 @@ -2183,40 +2354,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; @@ -2228,25 +2387,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++; - share->virtual_stored_fields= true; // For insert/load data 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; } @@ -2533,14 +2691,16 @@ 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; 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); } @@ -2558,8 +2718,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)); } @@ -2612,10 +2772,10 @@ 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; + Item* func_expr= vcol->expr; DBUG_ENTER("fix_and_check_vcol_expr"); DBUG_PRINT("info", ("vcol: %p", vcol)); DBUG_ASSERT(func_expr); @@ -2630,7 +2790,7 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, 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)) @@ -2650,7 +2810,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; @@ -2674,10 +2834,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,118 +2856,51 @@ 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, - 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, + 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; - LEX_STRING *vcol_expr= &vcol->expr_str; + 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"); - DBUG_ASSERT(vcol_expr); - 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, - vcol_expr->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; - 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_safe(), 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, 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 + *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); } @@ -2815,15 +2908,11 @@ 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; } -/* - Read data from a binary .frm file from MySQL 3.23 - 5.0 into TABLE_SHARE -*/ - /* Open a table based on a TABLE_SHARE @@ -2886,7 +2975,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(); @@ -3033,104 +3121,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 @@ -3269,13 +3267,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; @@ -3349,6 +3342,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); @@ -3713,7 +3708,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); @@ -3767,8 +3762,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; @@ -4051,13 +4046,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]; @@ -4430,7 +4423,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 @@ -5029,7 +5022,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, @@ -6139,9 +6132,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); } } @@ -6189,6 +6182,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) @@ -6199,9 +6193,13 @@ 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); + } } - file->column_bitmaps_signal(); + need_signal= true; } if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) { @@ -6215,11 +6213,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(); } @@ -6244,22 +6248,42 @@ 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(); 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]); + } + } } - file->column_bitmaps_signal(); + need_signal= true; } if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) { @@ -6273,16 +6297,14 @@ 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); 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 @@ -6291,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; } @@ -6471,7 +6498,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); } @@ -6494,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 @@ -6507,42 +6534,49 @@ 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; + bool bitmap_updated= false; for (vfield_ptr= vfield; *vfield_ptr; vfield_ptr++) { 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)) { - 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; + 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; + } } } } if (bitmap_updated) file->column_bitmaps_signal(); + return bitmap_updated; } /* @@ -6563,7 +6597,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; @@ -6591,7 +6625,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()) @@ -6600,6 +6634,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 @@ -7229,19 +7275,11 @@ 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 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 @@ -7249,37 +7287,67 @@ 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; - int error __attribute__ ((unused))= 0; - DBUG_ASSERT(table && 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); - 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) + DBUG_ASSERT(vcol_info->expr); + + bool update; + switch (update_mode) { + case VCOL_UPDATE_FOR_READ_WRITE: + if (triggers) + { + update= true; + break; + } + 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) { /* Compute the actual value of the virtual fields */ - error= vcol_info->expr_item->save_in_field(vfield, 0); - DBUG_PRINT("info", ("field '%s' - updated", vfield->field_name)); + vcol_info->expr->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); +} + +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->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); } @@ -7306,7 +7374,7 @@ int update_virtual_fields(THD *thd, TABLE *table, 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); @@ -7327,9 +7395,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); - else - res|= field->evaluate_insert_default_function(); + res|= (field->default_value->expr->save_in_field(field, 0) < 0); } else res|= field->evaluate_update_default_function(); @@ -8062,3 +8128,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 a404e250bc2..e68f4ec8563 100644 --- a/sql/table.h +++ b/sql/table.h @@ -326,8 +326,9 @@ enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP }; enum enum_vcol_update_mode { VCOL_UPDATE_FOR_READ= 0, + VCOL_UPDATE_FOR_READ_WRITE, VCOL_UPDATE_FOR_WRITE, - VCOL_UPDATE_ALL + VCOL_UPDATE_INDEXED }; @@ -581,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; @@ -644,17 +646,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 +675,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 +686,6 @@ struct TABLE_SHARE bool table_creation_was_logged; bool non_determinstic_insert; bool vcols_need_refixing; - bool virtual_stored_fields; bool check_set_initialized; bool has_update_default_function; ulong table_map_id; /* for row-based replication */ @@ -1029,7 +1032,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 @@ -1040,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. @@ -1059,11 +1061,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 */ @@ -1306,7 +1308,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); @@ -1418,8 +1420,12 @@ 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_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(); inline ha_rows stat_records() { return used_stat_records; } @@ -1473,6 +1479,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; @@ -1480,13 +1489,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 @@ -1747,6 +1758,30 @@ 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, + bool routine, + 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= 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; + + **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 @@ -2027,7 +2062,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. @@ -2634,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/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.cc b/sql/unireg.cc index 2d83ca54edb..959f8341a90 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); @@ -284,8 +293,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; @@ -338,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. @@ -498,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; } @@ -594,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,no_empty, 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) @@ -608,21 +605,11 @@ 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; - 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; @@ -632,23 +619,8 @@ 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; - 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. @@ -723,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,no_empty); + // bytes 264-265 are unused int2store(forminfo+266,reclength); int2store(forminfo+268,n_length); int2store(forminfo+270,int_count); @@ -758,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 */ @@ -820,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, @@ -968,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); } @@ -1000,7 +919,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; @@ -1038,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) { @@ -1063,11 +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; - type= (Field::utype) MTYP_TYPENR(field->unireg_check); - - 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; + 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) { @@ -1083,12 +1001,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..b1cab841092 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -83,68 +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 SC_INFO_LENGTH 4 /* Form format constant */ -#define TE_INFO_LENGTH 3 -#define MTYP_NOEMPTY_BIT 128 +#define OPEN_TRIGGER_ONLY (1 << 21) /* Minimum length pattern before Turbo Boyer-Moore is used 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; } 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/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; 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 a5da1b9fb0c..73399f14081 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -127,13 +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) - || dict_table_is_intrinsic(index->table)); + ut_ad(mtr_memo_contains_flagged(mtr, block, + MTR_MEMO_PAGE_S_FIX + | MTR_MEMO_PAGE_X_FIX)); } #endif /* UNIV_DEBUG */ @@ -283,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) @@ -422,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); @@ -444,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( @@ -523,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/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 " diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 31952424119..2d891854c03 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; @@ -2203,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 */ @@ -2245,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); @@ -2277,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); @@ -2509,12 +2492,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")) { @@ -2532,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) { @@ -2540,7 +2518,6 @@ dict_create_add_foreigns_to_dictionary( } } -exit_loop: trx->op_info = "committing foreign key definitions"; if (trx_is_started(trx)) { @@ -2796,14 +2773,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..4f77d2168f4 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 @@ -660,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) @@ -1388,18 +1347,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 +1363,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 +2605,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 +2638,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 +2723,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 +2846,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 +2882,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 +3204,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 +3298,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 +3363,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 eb817b295af..83dd0c17eaa 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 @@ -281,6 +289,77 @@ 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 */ +} + +/** 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(); + thd_proc_info(thd, "InnoDB background thread"); + + 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_fast_shutdown = (ulint) innobase_fast_shutdown; + if (srv_fast_shutdown == 0) { + 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(); + + 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" @return InnoDB ROW_FORMAT value from rec_format_t enum. */ @@ -453,9 +532,11 @@ 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), + PSI_KEY(pending_checkpoint_mutex), PSI_KEY(innobase_share_mutex) }; @@ -580,6 +661,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 */ @@ -851,13 +933,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. @@ -1693,6 +1779,56 @@ 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(); + thd_proc_info(thd, "InnoDB background thread"); + 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 @@ -1790,13 +1926,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 +1964,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 +2085,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 +2093,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 +2109,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 @@ -2700,11 +2755,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)); } @@ -3110,16 +3164,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); } @@ -3313,6 +3363,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 @@ -3362,8 +3413,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)); @@ -4047,12 +4097,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 @@ -4650,6 +4694,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 @@ -4784,6 +4834,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; } @@ -5062,7 +5119,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"); } @@ -5576,7 +5633,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"); } @@ -5597,7 +5654,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.", @@ -5620,10 +5677,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); } @@ -5665,9 +5718,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 +5731,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) << "("<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 */ @@ -6208,8 +6280,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 */ @@ -6253,7 +6323,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 @@ -6313,21 +6382,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 @@ -6335,16 +6389,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; @@ -6376,15 +6428,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++) { @@ -6484,12 +6529,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 @@ -6586,7 +6626,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; @@ -6751,18 +6791,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; */ @@ -6783,7 +6811,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" @@ -6829,7 +6857,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"); @@ -6859,13 +6886,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 @@ -6874,30 +6895,19 @@ 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) - && 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 - << " columns in MySQL. Please check" + " 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" " issue."; @@ -7042,7 +7052,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); @@ -7054,12 +7064,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 */ @@ -7070,12 +7078,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" @@ -7423,19 +7430,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 @@ -7486,7 +7480,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); @@ -8186,10 +8180,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) { @@ -8204,8 +8197,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); @@ -8387,10 +8380,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 @@ -8443,12 +8436,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 @@ -8470,16 +8462,14 @@ 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); + if (index_contains) + goto no_icp; } else { index_contains = dict_index_contains_col_or_prefix( index, i - num_v, false); @@ -8500,8 +8490,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)) { @@ -8510,17 +8499,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; @@ -8602,7 +8591,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++; } } @@ -8614,15 +8603,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 { @@ -8630,7 +8615,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, @@ -8639,16 +8624,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; @@ -8667,18 +8652,15 @@ 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 */ 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 @@ -8686,7 +8668,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)) @@ -8698,11 +8680,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 { @@ -8711,16 +8693,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; @@ -8763,18 +8743,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); @@ -8850,30 +8822,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. @@ -8894,15 +8842,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); @@ -9342,14 +9285,14 @@ 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); 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); @@ -9357,19 +9300,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); @@ -9584,7 +9523,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; } @@ -9630,10 +9569,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 @@ -9798,7 +9733,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. @@ -9823,7 +9758,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)) { @@ -9834,19 +9769,17 @@ 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( - 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; @@ -9873,8 +9806,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); @@ -9988,8 +9920,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); @@ -9999,7 +9930,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)) { @@ -10049,28 +9980,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); } /**********************************************************************//** @@ -10084,11 +9994,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; } @@ -10098,8 +10004,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 @@ -10187,8 +10091,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; @@ -10390,29 +10292,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 { @@ -10592,8 +10482,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); @@ -10720,9 +10609,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); @@ -10732,17 +10619,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); @@ -10896,8 +10774,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)); } @@ -11147,10 +11024,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); @@ -11744,7 +11618,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); } @@ -11929,7 +11803,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->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 @@ -11942,10 +11852,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++) { @@ -11963,10 +11875,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 @@ -11979,12 +11890,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++) { @@ -12006,8 +11919,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 */ @@ -12017,7 +11930,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; @@ -12026,6 +11938,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; @@ -12062,9 +11975,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]; @@ -12073,7 +11984,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)); @@ -12099,8 +12009,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; } @@ -12111,7 +12020,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) { @@ -12140,32 +12049,10 @@ create_table_info_t::create_table_def() for (i = 0; i < n_cols; i++) { ulint is_virtual; - bool is_stored MY_ATTRIBUTE((unused)); + bool is_stored = false; + Field* field = m_form->field[i]; - if (!field->stored_in_db()) { - 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); @@ -12241,9 +12128,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); @@ -12255,7 +12142,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 @@ -12263,35 +12150,26 @@ err_col: charset_no), col_len); } 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 | 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; @@ -12332,7 +12210,6 @@ err_col: } } } -#endif /* MYSQL_VIRTUAL_COLUMNS */ /* Add the FTS doc_id hidden column. */ if (m_flags2 & DICT_TF2_FTS && !has_doc_id_col) { @@ -12365,7 +12242,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 */ @@ -12381,18 +12257,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();); @@ -12575,7 +12441,7 @@ create_index( DBUG_RETURN(convert_error_code_to_mysql( row_create_index_for_mysql( - index, trx, NULL, NULL), + index, trx, NULL), flags, NULL)); } @@ -12590,13 +12456,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)); @@ -12606,26 +12466,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; @@ -12649,13 +12489,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); @@ -12676,7 +12509,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.", @@ -12705,13 +12538,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); @@ -12737,26 +12566,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)); } @@ -12873,8 +12683,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); @@ -13718,8 +13527,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 @@ -13873,22 +13680,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 */ @@ -14162,6 +13953,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_GENERATED_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 */ @@ -14199,10 +14014,14 @@ 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); } + if (gcols_in_fulltext_or_spatial()) { + DBUG_RETURN(HA_ERR_UNSUPPORTED); + } + DBUG_RETURN(parse_table_name(name)); } @@ -14343,17 +14162,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); @@ -14379,19 +14188,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; } @@ -14399,23 +14204,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); @@ -14430,17 +14227,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) { @@ -14574,13 +14362,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; @@ -14588,14 +14371,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(); @@ -14610,38 +14391,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); @@ -14796,11 +14546,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); } @@ -14879,17 +14624,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); } @@ -14935,16 +14670,11 @@ 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) { - 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]; @@ -14994,9 +14724,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; } @@ -15009,11 +14739,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]; @@ -15035,20 +14761,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); @@ -15069,8 +14791,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); @@ -15507,9 +15228,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] = '/'; @@ -15600,9 +15319,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; } @@ -15610,12 +15329,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]; @@ -15764,8 +15478,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()"); @@ -15837,16 +15552,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 = ""; @@ -15856,6 +15570,7 @@ ha_innobase::records(ha_rows* num_rows) DBUG_RETURN(HA_ERR_QUERY_INTERRUPTED); } + *num_rows= n_rows; DBUG_RETURN(0); } #endif /* MYSQL_57_SELECT_COUNT_OPTIMIZATION */ @@ -16228,7 +15943,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()); @@ -16350,7 +16065,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); @@ -16387,7 +16102,7 @@ ha_innobase::info_low( } m_prebuilt->trx->op_info = - "returning various info to MySQL"; + "returning various info to MariaDB"; } @@ -16488,8 +16203,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, @@ -16501,8 +16215,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 { @@ -16607,7 +16321,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", @@ -16667,9 +16381,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; } } @@ -16732,72 +16445,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. @@ -17425,41 +17072,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( @@ -17921,16 +17553,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); @@ -18060,18 +17682,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 @@ -18397,12 +18007,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); } @@ -18837,15 +18443,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)); @@ -18994,7 +18594,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 @@ -19680,7 +19279,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"); } @@ -19824,64 +19423,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( /*====================================*/ @@ -21035,12 +20576,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); } @@ -22364,7 +21901,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 MariaDB versions older than 10.0.4", NULL, NULL, SRV_CHECKSUM_ALGORITHM_CRC32, &innodb_checksum_algorithm_typelib); @@ -23336,7 +22873,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, @@ -23810,6 +23347,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 }; @@ -23984,29 +23522,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); @@ -24014,36 +23552,53 @@ 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'; 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); } @@ -24069,11 +23624,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'; @@ -24157,7 +23708,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; @@ -24183,15 +23733,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; @@ -24250,46 +23805,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 @@ -24301,11 +23821,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)) { @@ -24345,7 +23860,7 @@ innobase_get_computed_value( return(field); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ + /** Attempt to push down an index condition. @param[in] keyno MySQL key number @@ -24875,7 +24390,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 " @@ -24889,17 +24404,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); @@ -24910,7 +24425,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; @@ -24919,7 +24434,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 " @@ -24934,7 +24449,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); } @@ -24943,7 +24458,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; diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 84feea119c1..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. @@ -203,9 +205,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 +467,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(); @@ -787,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. */ @@ -833,14 +831,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 @@ -1051,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 @@ -1134,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 @@ -1171,19 +1155,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 9bbe3a010a4..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,29 +504,15 @@ 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; } 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; } @@ -541,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; } @@ -567,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. @@ -602,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 @@ -658,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); } @@ -806,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 */ @@ -824,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 @@ -840,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). */ @@ -862,25 +836,23 @@ ha_innobase::check_if_supported_inplace_alter( + ha_alter_info->key_count; 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, 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; 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++); @@ -939,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)); @@ -1225,29 +1193,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; } @@ -1367,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 @@ -1430,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 @@ -1678,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++; } @@ -1805,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( @@ -1853,7 +1814,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( /*=====================*/ @@ -1861,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) @@ -1870,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)) { @@ -1913,7 +1871,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( /*==================*/ @@ -1921,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)); @@ -1931,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(); @@ -1960,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); + } } /*************************************************************//** @@ -2136,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"); @@ -2164,34 +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; - 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) || (key_part->length < field->pack_length() @@ -2226,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; @@ -2306,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; } @@ -2329,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; @@ -2360,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)++; @@ -2684,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; @@ -2696,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++; @@ -2713,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; } @@ -2743,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++; @@ -3144,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) @@ -3166,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++) { @@ -3189,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] @@ -3216,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) { @@ -3249,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, @@ -3679,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 @@ -3746,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(); @@ -3775,7 +3685,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); } @@ -3806,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; @@ -3841,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 @@ -3855,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; } @@ -3883,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(); @@ -3919,7 +3804,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); } @@ -3949,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++; } @@ -4412,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; } @@ -4432,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; @@ -4446,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++; } } @@ -4454,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. @@ -4519,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( @@ -4548,12 +4431,9 @@ 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 */ /* Create a background transaction for the operations on the data dictionary tables. */ @@ -4668,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; @@ -4694,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++; @@ -4754,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 */ @@ -4792,7 +4664,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; } @@ -4835,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, @@ -4843,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, @@ -4857,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; @@ -4875,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; } @@ -5033,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, @@ -5578,7 +5439,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. @@ -5612,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 @@ -5637,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; @@ -5660,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() @@ -5801,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(); @@ -6239,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, @@ -6313,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( @@ -6327,7 +6190,6 @@ err_exit: ha_alter_info, altered_table, table)) { DBUG_RETURN(true); } -#endif /* MYSQL_VIRTUAL_COLUMNS */ DBUG_RETURN(false); } @@ -6343,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; @@ -6371,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; } @@ -6424,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: @@ -6438,7 +6286,6 @@ found_col: } i++; - innodb_idx++; } DBUG_ASSERT(heap); @@ -6612,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. */ @@ -6620,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) { @@ -6641,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; } @@ -6656,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 @@ -7463,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++; @@ -7478,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++) { @@ -7625,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( @@ -7708,7 +7541,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", @@ -8224,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( @@ -8240,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/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/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 a912f3eb127..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) @@ -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); } } 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/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 */ diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index ccef08ff73f..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) @@ -843,17 +831,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 +1993,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 +2002,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 +2011,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..c44dc156aaa 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; } @@ -2068,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 4ee19f96008..c81d893ed5a 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 */ @@ -1439,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. @@ -1874,18 +1768,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/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/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/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/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/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/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/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/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/ut0crc32.h b/storage/innobase/include/ut0crc32.h index 91af6a910ff..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,8 +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; -/** 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/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 diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 41b48228487..0a178abde37 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1754,9 +1754,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 @@ -1769,12 +1769,15 @@ has_higher_priority( } else if (lock2 == NULL) { return true; } - // No preference. Compre them by wait mode and trx age. + // 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 false; + } return lock1->trx->start_time_micro <= lock2->trx->start_time_micro; } 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/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 d93b80778b5..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 @@ -5243,13 +5241,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 ) { diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 720ad44b4b8..271d70d4da9 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); } /*********************************************************************//** @@ -936,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 @@ -1047,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, @@ -1343,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( @@ -1354,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++) { @@ -1384,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( @@ -1395,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; @@ -2152,7 +2141,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 +2163,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 +2496,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 +2514,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 +2525,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 +2568,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 +2658,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 +2750,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 +2762,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 +2831,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 +2926,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 +2976,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 +3140,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 +3159,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 +3201,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 +3220,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 +3659,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/row0merge.cc b/storage/innobase/row/row0merge.cc index 0b7c1c36231..7a8b74279f5 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) @@ -660,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); @@ -692,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); @@ -706,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); @@ -4514,9 +4504,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); } } diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 4a063c9af83..100e1bcb708 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); } @@ -5740,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 d23a0d8c432..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); @@ -4091,320 +4089,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 +4143,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 +4403,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..2a990904242 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; } } @@ -1078,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 ( @@ -1143,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()); @@ -2063,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 @@ -2142,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 @@ -2192,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; @@ -2255,7 +2247,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 +2265,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 +2278,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()) { @@ -2400,7 +2388,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); @@ -2877,10 +2866,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 +3043,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 +3070,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 +3273,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/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 e7ca007e73e..51e898d98d8 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" @@ -1046,10 +1044,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 +1114,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); @@ -2669,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(srv_fast_shutdown != 0 || n_purged == 0); + } + switch (srv_shutdown_state) { case SRV_SHUTDOWN_NONE: /* Normal operation. */ @@ -2741,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 " @@ -2760,7 +2759,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 { @@ -2786,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); @@ -2795,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(); @@ -2812,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 */ { @@ -2882,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); @@ -2895,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 @@ -2982,7 +2982,7 @@ srv_purge_coordinator_suspend( } } - } while (stop); + } while (stop && !thd_kill_level(thd)); srv_sys_mutex_enter(); @@ -3006,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; @@ -3041,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; } @@ -3055,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; @@ -3121,8 +3121,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/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4be92906851..96c2d8fa8c4 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; } @@ -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) { @@ -1856,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) { @@ -2575,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( @@ -2774,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 */ @@ -2790,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 diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 2d892be869b..1a5890eed42 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 @@ -82,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" @@ -96,6 +103,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; + /** Swap the byte order of an 8 byte integer. @param[in] i 8-byte integer @return 8-byte integer */ @@ -116,10 +126,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 +290,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 +379,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 +429,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); } @@ -452,7 +452,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; @@ -476,7 +475,6 @@ ut_crc32_slice8_table_init() } ut_crc32_slice8_table_initialized = true; -#endif } /** Calculate CRC32 over 8-bit data using a software implementation. @@ -706,6 +704,12 @@ void ut_crc32_init() /*===========*/ { + 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__) uint32_t vend[3]; uint32_t model; @@ -733,27 +737,23 @@ 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 & 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; + ut_crc32_implementation = "Using SSE2 crc32 instructions"; } -#endif /* defined(__GNUC__) && defined(__x86_64__) */ - -#ifdef HAVE_CRC32_VPMSUM - ut_crc32_power8_enabled = true; - ut_crc32 = ut_crc32_power8; +#elif defined(HAVE_CRC32_VPMSUM) +#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 - 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; - } } 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; diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index cd1f34dbaaf..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 | @@ -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, 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/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/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/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index b5371a2b0c3..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; @@ -1031,15 +1083,18 @@ 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; } 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 57ac5bdca97..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; @@ -2207,7 +2209,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 +2639,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; @@ -3268,12 +3270,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) { @@ -3555,7 +3554,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, @@ -3568,9 +3567,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 +3636,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 +3645,14 @@ 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; + 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); } @@ -4509,7 +4511,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/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_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 b8cbefe6ac2..776594a6409 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -328,21 +328,27 @@ 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; 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; + 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); + 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; + 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,35 +372,35 @@ 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) && - 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 (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; - share->keyinfo[i].keysegs--; + 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]; @@ -409,7 +415,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= @@ -419,10 +425,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; @@ -746,7 +752,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); } @@ -1389,4 +1395,3 @@ int mi_indexes_are_disabled(MI_INFO *info) */ return 2; } - diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 7835ab83531..68c91154505 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]); @@ -820,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 | HA_OPEN_FROM_SQL_LAYER; + 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; @@ -1067,7 +1068,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) 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 */ 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/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 (!) 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)) 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/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, 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..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 @@ -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; @@ -675,11 +675,11 @@ 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 -/*!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..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,21 +55,21 @@ 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, `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` ( `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,21 +99,21 @@ 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, `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` ( `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 e5a196f894b..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,14 +108,14 @@ 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, `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/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/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/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 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_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 178174872b5..0d206906df3 100644 Binary files a/storage/tokudb/mysql-test/tokudb_parts/r/partition_char_tokudb.result and b/storage/tokudb/mysql-test/tokudb_parts/r/partition_char_tokudb.result differ 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..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,14 +7,14 @@ 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 -/*!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 @@ -37,11 +37,11 @@ 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 -/*!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 , 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..f8981ee544d 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,10 @@ void ut_crc32_init() /*===========*/ { + ut_crc32_slice8_table_init(); + ut_crc32 = ut_crc32_slice8; + ut_crc32_implementation = "Using generic crc32 instructions"; + #if defined(__GNUC__) && defined(__x86_64__) ib_uint32_t vend[3]; ib_uint32_t model; @@ -329,21 +330,19 @@ 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_power8_enabled = true; - ut_crc32 = ut_crc32_power8; -#else - if (ut_crc32_sse2_enabled) { + if ((features_ecx >> 20) & 1) { ut_crc32 = ut_crc32_sse42; - } else { - ut_crc32_slice8_table_init(); - ut_crc32 = ut_crc32_slice8; + ut_crc32_implementation = "Using SSE2 crc32 instructions"; + } + +#elif defined(HAVE_CRC32_VPMSUM) +#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/strings/json_lib.c b/strings/json_lib.c index 976fab7e7f6..a93200cd4dd 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; @@ -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,13 +1071,14 @@ 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; + p->types_used= JSON_PATH_KEY_NULL; do { @@ -1096,8 +1105,12 @@ 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; + p->types_used|= JSON_PATH_WILD; continue; case PS_INT: p->last_step->n_item*= 10; @@ -1109,8 +1122,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->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; case PS_EAR: @@ -1119,13 +1134,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->types_used|= 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,33 +1147,23 @@ 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; } -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; } @@ -1167,6 +1171,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; @@ -1196,7 +1207,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 +1252,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 +1268,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 +1328,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 +1366,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 +1398,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/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; } 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}' 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); 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"); }